diff --git a/Backend/etcinitd/swarmops-backend b/Backend/etcinitd/swarmops-backend index c5597de8..5cda97b7 100644 --- a/Backend/etcinitd/swarmops-backend +++ b/Backend/etcinitd/swarmops-backend @@ -27,6 +27,7 @@ DAEMON=/opt/swarmops/backend DAEMON_ARGS="--options args" PIDFILE=/var/run/swarmops-backend.pid SCRIPTNAME=/etc/init.d/swarmops-backend +LOGDIR=/var/log/swarmops # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -34,6 +35,11 @@ SCRIPTNAME=/etc/init.d/swarmops-backend # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME +# Assert that log dir exists +if [ ! -d $LOGDIR ]; then + mkdir $LOGDIR +fi + # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -71,6 +77,7 @@ do_stop() # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred + echo "Stopping Swarmops backend..." start-stop-daemon --stop --retry=TERM/120/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2