]> matita.cs.unibo.it Git - helm.git/commitdiff
added /etc/init.d/ stuff
authorStefano Zacchiroli <zack@upsilon.cc>
Wed, 9 Oct 2002 09:36:49 +0000 (09:36 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Wed, 9 Oct 2002 09:36:49 +0000 (09:36 +0000)
helm/scripts/init.d/etc_default_helm [new file with mode: 0644]
helm/scripts/init.d/helm [new file with mode: 0755]
helm/scripts/init.d/helm-draw-graph [new file with mode: 0755]
helm/scripts/init.d/helm-http-getter [new file with mode: 0755]
helm/scripts/init.d/helm-proof-checker [new file with mode: 0755]
helm/scripts/init.d/helm-uri-set-queue [new file with mode: 0755]

diff --git a/helm/scripts/init.d/etc_default_helm b/helm/scripts/init.d/etc_default_helm
new file mode 100644 (file)
index 0000000..d6e8413
--- /dev/null
@@ -0,0 +1,18 @@
+# Configuration for helm daemons
+
+  # DAEMONS started/stopped/ecc. by /etc/init.d/helm, name listed here
+  # must correspond to scripts located in /etc/init.d
+DAEMONS="
+  helm-http-getter
+  helm-proof-checker
+  helm-uri-set-queue
+  helm-draw-graph
+"
+
+  # script used to define a good(TM) environment for daemons
+ENVSCRIPT="/projects/helm/shared/scripts/phd.rc"
+
+  # user which will own the daemons
+OWNER="sacerdot:helm"
+
+# vim: set ft=sh:
diff --git a/helm/scripts/init.d/helm b/helm/scripts/init.d/helm
new file mode 100755 (executable)
index 0000000..c58a15d
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# init.d script for HELM daemons
+#
+# by --Zack <zack@cs.unibo.it>
+# Created: Tue,  8 Oct 2002 17:18:17 +0200
+# Last-Modified: Tue,  8 Oct 2002 17:18:17 +0200
+
+DAEMONS=""
+if [ -f /etc/default/helm ]; then
+  . /etc/default/helm
+fi
+
+case "$1" in
+
+  start|stop|restart|force-reload|reload)
+    for d in $DAEMONS; do
+      /etc/init.d/$d $1
+    done
+    ;;
+
+  *)
+    echo
+    echo "Usage: /etc/init.d/helm { start | stop | restart | force-reload | reload }" >&2
+    echo
+    if [ -z "$DAEMONS" ]; then
+      echo "Actually, no daemons are considered!"
+    else
+      echo "Actually, considered daemons are: $DAEMONS"
+    fi
+    echo "to change this setting see /etc/default/helm"
+    echo
+    exit 1
+    ;;
+
+esac
+
diff --git a/helm/scripts/init.d/helm-draw-graph b/helm/scripts/init.d/helm-draw-graph
new file mode 100755 (executable)
index 0000000..cdb5c05
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# init.d script for HELM draw_graph.cgi
+#
+# by --Zack <zack@cs.unibo.it>
+# Created: Wed,  9 Oct 2002 11:12:01 +0200
+# Last-Modified: Wed,  9 Oct 2002 11:12:01 +0200
+
+DAEMON=/projects/helm/graphs/tools/draw_graph.cgi
+USAGE="Usage: /etc/init.d/helm-draw-graph { start | stop | restart }"
+
+ENVSCRIPT=""
+if [ -f /etc/default/helm ]; then
+  . /etc/default/helm
+fi
+if ! [ -f "$ENVSCRIPT" ]; then
+  echo "Can't find environment script '$ENVSCRIPT'"
+  exit 1
+fi
+. $ENVSCRIPT &> /dev/null
+
+NAME=`basename $DAEMON`
+PIDFILE=/projects/helm/run/$NAME.pid
+
+do_start () {
+  echo "Starting $DAEMON ..."
+  start-stop-daemon \
+    --start --background --pidfile $PIDFILE --make-pidfile \
+    --chuid $OWNER --exec $DAEMON
+}
+
+do_stop () {
+  echo "Stopping $DAEMON ..."
+  start-stop-daemon --stop --pidfile $PIDFILE && \
+  (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
+}
+
+case "$1" in
+
+  start)
+    do_start
+    ;;
+
+  stop)
+    do_stop
+    ;;
+
+  restart)
+    do_stop
+    do_start
+    ;;
+
+  *)
+    echo "$USAGE" >&2
+    exit 1
+    ;;
+
+esac
+
diff --git a/helm/scripts/init.d/helm-http-getter b/helm/scripts/init.d/helm-http-getter
new file mode 100755 (executable)
index 0000000..87f7a5b
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# init.d script for http_getter.pl
+#
+# by --Zack <zack@cs.unibo.it>
+# Created: Tue,  8 Oct 2002 17:18:17 +0200
+# Last-Modified: Wed,  9 Oct 2002 11:12:01 +0200
+
+DAEMON=/projects/helm/http_getter/http_getter.pl
+USAGE="Usage: /etc/init.d/helm-http-getter { start | stop | restart }"
+
+ENVSCRIPT=""
+if [ -f /etc/default/helm ]; then
+  . /etc/default/helm
+fi
+if ! [ -f "$ENVSCRIPT" ]; then
+  echo "Can't find environment script '$ENVSCRIPT'"
+  exit 1
+fi
+. $ENVSCRIPT &> /dev/null
+
+NAME=`basename $DAEMON`
+PIDFILE=/projects/helm/run/$NAME.pid
+
+do_start () {
+  echo "Starting $DAEMON ..."
+  start-stop-daemon \
+    --start --background --pidfile $PIDFILE --make-pidfile \
+    --chuid $OWNER --exec $DAEMON
+}
+
+do_stop () {
+  echo "Stopping $DAEMON ..."
+  start-stop-daemon --stop --pidfile $PIDFILE && \
+  (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
+}
+
+case "$1" in
+
+  start)
+    do_start
+    ;;
+
+  stop)
+    do_stop
+    ;;
+
+  restart)
+    do_stop
+    do_start
+    ;;
+
+  *)
+    echo "$USAGE" >&2
+    exit 1
+    ;;
+
+esac
+
diff --git a/helm/scripts/init.d/helm-proof-checker b/helm/scripts/init.d/helm-proof-checker
new file mode 100755 (executable)
index 0000000..e96d10c
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# init.d script for HELM proof checker
+#
+# by --Zack <zack@cs.unibo.it>
+# Created: Wed,  9 Oct 2002 11:12:01 +0200
+# Last-Modified: Wed,  9 Oct 2002 11:12:01 +0200
+
+DAEMON=/projects/helm/proofChecker/proofChecker.pl
+USAGE="Usage: /etc/init.d/helm-proof-checker { start | stop | restart }"
+
+ENVSCRIPT=""
+if [ -f /etc/default/helm ]; then
+  . /etc/default/helm
+fi
+if ! [ -f "$ENVSCRIPT" ]; then
+  echo "Can't find environment script '$ENVSCRIPT'"
+  exit 1
+fi
+. $ENVSCRIPT &> /dev/null
+
+NAME=`basename $DAEMON`
+PIDFILE=/projects/helm/run/$NAME.pid
+
+do_start () {
+  echo "Starting $DAEMON ..."
+  start-stop-daemon \
+    --start --background --pidfile $PIDFILE --make-pidfile \
+    --chuid $OWNER --exec $DAEMON
+}
+
+do_stop () {
+  echo "Stopping $DAEMON ..."
+  start-stop-daemon --stop --pidfile $PIDFILE && \
+  (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
+}
+
+case "$1" in
+
+  start)
+    do_start
+    ;;
+
+  stop)
+    do_stop
+    ;;
+
+  restart)
+    do_stop
+    do_start
+    ;;
+
+  *)
+    echo "$USAGE" >&2
+    exit 1
+    ;;
+
+esac
+
diff --git a/helm/scripts/init.d/helm-uri-set-queue b/helm/scripts/init.d/helm-uri-set-queue
new file mode 100755 (executable)
index 0000000..7711405
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# init.d script for HELM uri_set_queue.cgi
+#
+# by --Zack <zack@cs.unibo.it>
+# Created: Tue,  8 Oct 2002 17:18:17 +0200
+# Last-Modified: Wed,  9 Oct 2002 11:12:01 +0200
+
+DAEMON=/projects/helm/graphs/tools/uri_set_queue.cgi
+USAGE="Usage: /etc/init.d/helm-uri-set-queue { start | stop | restart }"
+
+ENVSCRIPT=""
+if [ -f /etc/default/helm ]; then
+  . /etc/default/helm
+fi
+if ! [ -f "$ENVSCRIPT" ]; then
+  echo "Can't find environment script '$ENVSCRIPT'"
+  exit 1
+fi
+. $ENVSCRIPT &> /dev/null
+
+NAME=`basename $DAEMON`
+PIDFILE=/projects/helm/run/$NAME.pid
+
+do_start () {
+  echo "Starting $DAEMON ..."
+  start-stop-daemon \
+    --start --background --pidfile $PIDFILE --make-pidfile \
+    --chuid $OWNER --exec $DAEMON
+}
+
+do_stop () {
+  echo "Stopping $DAEMON ..."
+  start-stop-daemon --stop --pidfile $PIDFILE && \
+  (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
+}
+
+case "$1" in
+
+  start)
+    do_start
+    ;;
+
+  stop)
+    do_stop
+    ;;
+
+  restart)
+    do_stop
+    do_start
+    ;;
+
+  *)
+    echo "$USAGE" >&2
+    exit 1
+    ;;
+
+esac
+