annotate 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
rev   line source
mas01cr@24 1 #! /bin/bash
mas01cr@24 2
mas01cr@24 3 test -f /usr/bin/audiodb || exit 0
mas01cr@24 4 . /lib/lsb/init-functions
mas01cr@24 5
mas01cr@24 6 RUNASUSER=nobody
mas01cr@24 7 PORT=20703
mas01cr@24 8
mas01cr@24 9 [ -f /etc/default/audiodb ] && . /etc/default/audiodb
mas01cr@24 10
mas01cr@24 11 case "$1" in
mas01cr@24 12 start)
mas01cr@24 13 log_begin_msg "Starting audiodb web service" "audiodb"
mas01cr@24 14 start-stop-daemon --start --quiet --background \
mas01cr@24 15 --pidfile /var/run/audiodb.pid --make-pidfile \
mas01cr@24 16 --exec /usr/bin/audiodb --chuid ${RUNASUSER} -- -s ${PORT}
mas01cr@24 17 log_end_msg $?
mas01cr@24 18 ;;
mas01cr@24 19 stop)
mas01cr@24 20 log_begin_msg "Stopping audiodb web service" "audiodb"
mas01cr@24 21 start-stop-daemon --stop --quiet --oknodo \
mas01cr@24 22 --pidfile /var/run/audiodb.pid
mas01cr@24 23 ES=$?
mas01cr@24 24 rm -f /var/run/audiodb.pid
mas01cr@24 25 log_end_msg $ES
mas01cr@24 26 ;;
mas01cr@24 27 reload)
mas01cr@24 28 log_warning_msg "No configuration to reload for audiodb"
mas01cr@24 29 ;;
mas01cr@24 30 restart|force-reload)
mas01cr@24 31 "$0" stop
mas01cr@24 32 exec "$0" start
mas01cr@24 33 ;;
mas01cr@24 34 *)
mas01cr@24 35 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
mas01cr@24 36 exit 1
mas01cr@24 37 ;;
mas01cr@24 38 esac
mas01cr@24 39
mas01cr@24 40 exit 0