diff --git a/debian/sylkserver.init b/debian/sylkserver.init index e84e4db..f545398 100644 --- a/debian/sylkserver.init +++ b/debian/sylkserver.init @@ -1,76 +1,75 @@ #!/bin/sh # ### BEGIN INIT INFO # Provides: sylkserver # Required-Start: $syslog $network $local_fs $remote_fs $time # Required-Stop: $syslog $network $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start the SylkServer # Description: Start the SylkServer ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin INSTALL_DIR="/usr/bin" RUNTIME_DIR="/var/run/sylkserver" DEFAULTS="/etc/default/sylkserver" SERVER="$INSTALL_DIR/sylk-server" PID="$RUNTIME_DIR/server.pid" OPTIONS="" NAME="sylk-server" DESC="SylkServer" test -f $SERVER || exit 0 . /lib/lsb/init-functions # Load startup options if available if [ -f $DEFAULTS ]; then . $DEFAULTS || true fi if [ "$RUN_SYLKSERVER" != "yes" ]; then echo "SylkServer not yet configured. Edit /etc/default/sylkserver first." exit 0 fi if [ "$DUMP_CORE" = "yes" ]; then ulimit -c unlimited fi start() { log_daemon_msg "Starting $DESC: $NAME " start-stop-daemon --start --quiet --pidfile $PID \ --exec $SERVER -- $OPTIONS || log_progress_msg "already running" } stop () { log_daemon_msg "Stopping $DESC: $NAME " - start-stop-daemon --stop --quiet --oknodo --pidfile $PID + start-stop-daemon --stop --quiet --oknodo --retry=TERM/15/KILL/5 --pidfile $PID } case "$1" in start) start log_end_msg 0 ;; stop) stop log_end_msg 0 ;; restart|force-reload) stop - sleep 1 start log_end_msg 0 ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0