Fixed init.d script - hopefully

This commit is contained in:
Rick Falkvinge
2013-06-04 20:47:10 +00:00
parent e5cfb4c821
commit 49c5a9a96b
+6 -6
View File
@@ -20,11 +20,12 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Swarmops backend daemon"
NAME=daemonexecutablename
DAEMON=/opt/swarmops/backend/bin/
NAME=swarmops-backend
MONO=/usr/bin/mono
DAEMON=/opt/swarmops/backend
DAEMON_ARGS="--options args"
PIDFILE=/var/run/swarmops-backend.pid
SCRIPTNAME=/etc/init.d/$NAME
SCRIPTNAME=/etc/init.d/swarmops-backend
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
@@ -49,10 +50,9 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $MONO --make-pidfile --chdir $DAEMON --background --test $DAEMON/$NAME > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $MONO --make-pidfile --chdir $DAEMON --background $DAEMON/$NAME > /dev/null \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend