]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/daemons/scripts/init.d/helm-uwobo
(dis)organized web stuff
[helm.git] / helm / software / daemons / scripts / init.d / helm-uwobo
diff --git a/helm/software/daemons/scripts/init.d/helm-uwobo b/helm/software/daemons/scripts/init.d/helm-uwobo
new file mode 100755 (executable)
index 0000000..a5ab6c7
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# init.d script for http_getter
+#
+# by --Zack <zack@cs.unibo.it>
+# Created: Wed, 15 Jan 2003 15:14:07 +0100
+# Last-Modified: Fri, 16 Apr 2004 17:54:54 +0200
+
+DAEMON="/projects/helm/daemons/uwobo/uwobo.opt"
+USAGE="Usage: /etc/init.d/helm-uwobo { start | stop | restart }"
+
+if [ -f /etc/default/helm ]; then
+  . /etc/default/helm
+fi
+
+NAME=`basename $DAEMON`
+# Warning: $PIDFILE value is shared by UWOBO respawner, change at your own risk
+PIDFILE=/var/run/$NAME.pid
+
+do_start () {
+  echo -n "Starting $DAEMON"
+  start-stop-daemon \
+    --start --background --pidfile $PIDFILE --make-pidfile \
+    --chuid $OWNER --exec $DAEMON
+  echo "."
+  echo -n "Waiting for UWOBO to startup (2 seconds) ... "
+  sleep 2
+  echo "done!"
+  /etc/init.d/helm-uwobo-stylesheets start
+  echo -n "Starting $DAEMON respawner"
+  /etc/init.d/daemon_respawner.sh -p $PIDFILE \ -m root@localhost \
+    -r http://localhost:58080/help -d `basename $0` &
+  echo "."
+}
+
+do_stop () {
+  echo -n "Stopping $DAEMON respawner"
+  /etc/init.d/daemon_respawner.sh -d `basename $0` -s
+  echo "."
+  echo -n "Stopping $DAEMON ... "
+  start-stop-daemon --stop --pidfile $PIDFILE && \
+  (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
+  echo "done!"
+}
+
+case "$1" in
+
+  start)
+    do_start
+    ;;
+
+  stop)
+    do_stop
+    ;;
+
+  restart)
+    do_stop
+    do_start
+    ;;
+
+  *)
+    echo "$USAGE" >&2
+    exit 1
+    ;;
+
+esac
+