aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-11-02 19:58:26 +0100
committerChristian Weiske <cweiske@cweiske.de>2014-11-02 19:58:26 +0100
commitd7af2527afe27d01a8ed809529c2d569d14fd0ee (patch)
tree010cf68449f07f003230070d16424e6296031775 /scripts
parentc60f3430cacb864af1d7288bbe223099efc84256 (diff)
downloadauerswald-callnotifier-d7af2527afe27d01a8ed809529c2d569d14fd0ee.tar.gz
auerswald-callnotifier-d7af2527afe27d01a8ed809529c2d569d14fd0ee.zip
make init script actually run on startup and log output
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/init.d/auerswald-callnotifier18
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/init.d/auerswald-callnotifier b/scripts/init.d/auerswald-callnotifier
index 3256b26..3d38451 100755
--- a/scripts/init.d/auerswald-callnotifier
+++ b/scripts/init.d/auerswald-callnotifier
@@ -1,11 +1,12 @@
#! /bin/sh
+
### BEGIN INIT INFO
# Provides: auerswald-callnotifier
-# Required-Start: $local_fs $network
-# Required-Stop: $local_fs $network
+# Required-Start: $local_fs $network $syslog mysql slapd
+# Required-Stop: $local_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
-# Short-Description: Run the call notification program
+# Short-Description: Call notification program
### END INIT INFO
# Author: Christian Weiske <cweiske@cweiske.de>
@@ -13,7 +14,7 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Run auerswald callnotifier"
-NAME=callnotifier
+NAME=auerswald-callnotifier
DAEMON=/usr/bin/php
DAEMON_ARGS="/usr/local/src/auerswald-callnotifier/callnotifier.php"
PIDFILE=/var/run/$NAME.pid
@@ -37,10 +38,11 @@ do_start()
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
- || return 1
- start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- \
- $DAEMON_ARGS \
- || return 2
+ || return 1
+ start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE\
+ --startas /bin/bash -- -c "exec $DAEMON $DAEMON_ARGS >> /var/log/$NAME.log 2>&1" \
+ || return 2
+ #--exec $DAEMON -- $DAEMON_ARGS \
}
do_stop()