diff --git a/debian/sylkserver.default b/debian/sylkserver.default index c489035..ac8b529 100644 --- a/debian/sylkserver.default +++ b/debian/sylkserver.default @@ -1,8 +1,11 @@ # # SylkServer startup options # # Set to yes to enable SylkServer, once configured properly # by editing /etc/sylkserver/config.ini RUN_SYLKSERVER=no +# Set to yes to enable creating code dump files in case of a crash +DUMP_CORE=no + diff --git a/debian/sylkserver.init b/debian/sylkserver.init index abd0201..e84e4db 100644 --- a/debian/sylkserver.init +++ b/debian/sylkserver.init @@ -1,72 +1,76 @@ #!/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 } 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