First version of init script (autostart)
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 17 Apr 2012 13:46:46 +0000 (13:46 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 17 Apr 2012 13:46:46 +0000 (13:46 +0000)
etc/init.sh [new file with mode: 0755]

diff --git a/etc/init.sh b/etc/init.sh
new file mode 100755 (executable)
index 0000000..069a512
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          ais
+# Required-Start:    apache2 postgresql
+# Required-Stop:     apache2 postgresql
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: AIS server
+# Description:       Start/stop the AIS aquisition daemon and the job runner
+### END INIT INFO
+#
+# XXX Server to installed with:
+# ln -s THISFILE /etc/init.d/ais
+# update-rc.d ais defaults
+
+set -e
+
+. /lib/lsb/init-functions
+
+case $1 in
+    start)
+        sudo -u nirgal python -m ais.inputs.run --background
+        sudo -u nirgal python -m ais.jobrunner --debug
+    ;;
+    stop)
+        log_success_msg "Not implemented"
+        exit 1
+    ;;
+    *)
+        log_success_msg "Usage: ais.sh {start|stop}"
+        exit 1
+    ;;
+esac