summaryrefslogtreecommitdiffstats
path: root/ivan/ivan-startup
diff options
context:
space:
mode:
authoreuer <root@euer.krebsco.de>2012-12-20 03:19:28 +0100
committereuer <root@euer.krebsco.de>2012-12-20 03:19:28 +0100
commit38dbb8ee3867060fddd427d1bb4e57ee0300c8bb (patch)
treeabb7b2ab988934d6ddfbdd0448517b3a957645bf /ivan/ivan-startup
parent7c1b02b086a8377ad76a46c277a224150c5b85d6 (diff)
parent09dc57b9d5f564d13f80707eefadd845a4aa9aec (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'ivan/ivan-startup')
-rwxr-xr-xivan/ivan-startup74
1 files changed, 74 insertions, 0 deletions
diff --git a/ivan/ivan-startup b/ivan/ivan-startup
new file mode 100755
index 00000000..8a7f8daa
--- /dev/null
+++ b/ivan/ivan-startup
@@ -0,0 +1,74 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides: evan
+# Required-Start: $remote_fs $network
+# Required-Stop: $remote_fs $network
+# Should-Start: $syslog $named
+# Should-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start evan daemons
+# Description:
+
+### END INIT INFO
+#
+# Based on Lubomir Bulej's Redhat init script.
+
+DAEMON="/root/bin/evan"
+PIDFILE="/var/lock/evan"
+NAME="evan"
+DESC="evan daemons"
+TCONF="/etc/evan"
+
+test -f $DAEMON || exit 0
+
+[ -r /etc/default/evan ] && . /etc/default/evan
+
+
+start() {
+ [ -e $PIDFILE ] && echo "$PIDFILE already exists" && return
+ $DAEMON $EXTRA -d "$@" &
+ echo $(($$+1)) > $PIDFILE #TODO fix this ugly hack!
+}
+stop() {
+ [ ! -e $PIDFILE ] && echo "$PIDFILE does not exist" && return
+ kill `cat $PIDFILE`
+ #killall evan
+ rm $PIDFILE
+}
+
+reload() {
+ echo "do nothing"
+ # do nothing
+}
+
+restart() {
+ stop "$@"
+ start "$@"
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC:"
+ start
+ ;;
+ stop)
+ echo -n "Stopping $DESC:"
+ stop
+ ;;
+ reload|force-reload)
+ echo -n "Reloading $DESC configuration:"
+ reload
+ ;;
+ restart)
+ echo -n "Restarting $DESC:"
+ restart
+ ;;
+ *)
+ echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}"
+ exit 1
+ ;;
+esac
+echo "done"
+exit 0