From e0ec5d2e8560ae433ee677622b24ba82dbe7630b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 May 2011 15:47:21 +0200 Subject: lowered filesystem hierarchy--everything are modules --- noise/init.d/noise | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 noise/init.d/noise (limited to 'noise/init.d') diff --git a/noise/init.d/noise b/noise/init.d/noise new file mode 100755 index 00000000..075e47d7 --- /dev/null +++ b/noise/init.d/noise @@ -0,0 +1,48 @@ +#!/bin/sh -e +### BEGIN INIT INFO +# Provides: noise +# Required-Start: $remote_fs $syslog dbus +# Required-Stop: $remote_fs $syslog dbus +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Start the noise "Telnet" server +# Description: System mode startup script for +# the noise "Telnet" server. +### END INIT INFO + +DAEMON=/krebs/noise/noise-server + +test -x $DAEMON || exit 1 + +noise_pid() { + ps aux | grep tcpserver | grep noise-as-user | awk '{print$2}' +} + +noise_start() { + "$DAEMON" & +} + +noise_stop() { + kill "`noise_pid`" +} + +case "$1" in + start|stop) + noise_${1} + ;; + restart|reload|force-reload) + noise_stop + noise_start + ;; + #force-stop) ;; + status) + kill -s 0 "`noise_pid`" + exit $? + ;; + *) + echo "Usage: /etc/init.d/noise {start|stop|force-stop|restart|reload|force-reload|status}" + exit 1 + ;; +esac + +exit 0 -- cgit v1.2.3