diff debian/audiodb.init @ 24:e614ae0ebfe1 audiodb-debian

Include init.d script and defaults file for running an audiodb web services server automatically. Update changelog for this change (and for svn update)
author mas01cr
date Thu, 16 Aug 2007 10:50:34 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/audiodb.init	Thu Aug 16 10:50:34 2007 +0000
@@ -0,0 +1,40 @@
+#! /bin/bash
+
+test -f /usr/bin/audiodb || exit 0
+. /lib/lsb/init-functions
+
+RUNASUSER=nobody
+PORT=20703
+
+[ -f /etc/default/audiodb ] && . /etc/default/audiodb
+
+case "$1" in
+        start)
+                log_begin_msg "Starting audiodb web service" "audiodb"
+                start-stop-daemon --start --quiet --background \
+                  --pidfile /var/run/audiodb.pid --make-pidfile \
+                  --exec /usr/bin/audiodb --chuid ${RUNASUSER} -- -s ${PORT}
+                log_end_msg $?
+                ;;
+        stop)
+                log_begin_msg "Stopping audiodb web service" "audiodb"
+                start-stop-daemon --stop --quiet --oknodo \
+                  --pidfile /var/run/audiodb.pid
+		ES=$?
+		rm -f /var/run/audiodb.pid
+		log_end_msg $ES
+		;;
+	reload)
+		log_warning_msg "No configuration to reload for audiodb"
+		;;
+	restart|force-reload)
+		"$0" stop
+		exec "$0" start
+		;;
+	*)
+		echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+		exit 1
+		;;
+esac
+
+exit 0