Mercurial > hg > audiodb
annotate debian/audiodb.init @ 277:abfb26e08d9c audiodb-debian
Merge trunk changes -r326:386 into audiodb-debian branch.
Plus new debian/changelog version. (Should have used an epoch really,
but couldn't be bothered; TODO: work out a sane version numbering
policy).
author | mas01cr |
---|---|
date | Tue, 01 Jul 2008 09:12:40 +0000 |
parents | e614ae0ebfe1 |
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 |