From 27f6df60784630e6931c21f7b1db34c5ad5cb668 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Thu, 18 May 2006 06:27:22 +0000 Subject: [PATCH] Karloch-supplied Debian Linux run script. This script should probably use the 'sbbs -d' option to force daemon mode. This script could probably be merged with the Redhat/SUSE version. --- install/init.d/sbbs.debian | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 install/init.d/sbbs.debian diff --git a/install/init.d/sbbs.debian b/install/init.d/sbbs.debian new file mode 100644 index 0000000000..c31e052838 --- /dev/null +++ b/install/init.d/sbbs.debian @@ -0,0 +1,81 @@ +#!/bin/sh + +######################################## +# Synchronet BBS Debian startup script # +######################################## +# by Karloch <karloch@hispamsx.org> 8 Dec 2005 + +# Please be sure to config your Synchronet BBS in +# "daemonized" mode if you are going to use this script. +# You can activate "daemonized" mode at /sbbs/ctrl/sbbs.ini + +# You can edit these vars to meet your system configuration + +PATH=/bin:/sbin:/usr/bin:/usr/bin +SBBSROOT=/sbbs +DAEMON=$SBBSROOT/exec/sbbs + +OPTIONS="" + +export SBBSCTRL=$SBBSROOT/ctrl +export SHELL=/bin/bash + +# DO NOT edit anything below this line unless you know what you doing + +test -x $DAEMON || exit 0 + +case "$1" in + start) + echo -n "Starting Synchronet BBS services... " + if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON + then + echo "[already running]" + else + start-stop-daemon --quiet --start --exec $DAEMON + fi + ;; + stop) + echo -n "Stopping Synchronet BBS services... " + if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON + then + start-stop-daemon --quiet --stop --exec $DAEMON + sleep 2 + echo "[OK]" + else + echo "[not running]" + fi + ;; + restart|force-reload) + $0 stop + sleep 40 + $0 start + ;; + status) + echo -n "Synchronet BBS services status: " + if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON + then + echo "[running]" + echo -n "PID(s): " + pidof sbbs + else + echo "[not running]" + fi + ;; + recycle) + echo -n "Putting recycle server mark on Synchronet: " + if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON + then + touch $SBBSCTRL/recycle + echo "[OK]" + else + echo "[FAILED]" + echo -n "Synchronet server doesn't seem to be running" + fi + ;; + *) + echo "Usage: /etc/init.d/sbbs {start|stop|restart|force-reload|status|recycle}" + exit 1 + +esac + +exit 0 -- GitLab