3 # speech-dispatcher A device independent layer for speech synthesis
7 # description: A device independent layer for speech synthesis.
9 # $Id: template.init 9117 2007-11-28 20:28:39Z qboosh
11 # Source function library
12 . /etc/rc.d/init.d/functions
14 # $ speech-dispatcher -h
15 # Usage: speech-dispatcher [-{d|s}] [-l {1|2|3|4|5}] [-p=port] | [-v] | [-h]
16 # Speech Dispatcher -- Common interface for Speech Synthesis (GNU GPL)
18 # -d, --run-daemon - Run as a daemon
19 # -s, --run-single - Run as single application
20 # -l, --log-level - Set log level (1..5)
21 # -p, --port - Specify a port number
22 # -P, --pid-file - Set path to pid file
23 # -C, --config-dir - Set path to configuration
24 # -v, --version - Report version of this program
25 # -h, --help - Print this info
32 # Get service config - may override defaults
33 [ -f /etc/sysconfig/speech-dispatcher ] && . /etc/sysconfig/speech-dispatcher
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/speech-dispatcher ]; then
38 msg_starting speech-dispatcher
39 daemon --user ${RUNAS:-speech-dispatcher} \
40 "$SERVICE_RUN_NICE_LEVEL" \
41 speech-dispatcher --pid-file ${PIDFILE:-/var/run/speech-dispatcher/speech-dispatcher.pid} \
42 ${LOGLEVEL:+--log-level $LOGLEVEL}
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/speech-dispatcher
46 msg_already_running speech-dispatcher
51 if [ -f /var/lock/subsys/speech-dispatcher ]; then
53 msg_stopping speech-dispatcher
54 killproc speech-dispatcher
55 killproc --pidfile ${PIDFILE:-/var/run/speech-dispatcher/speech-dispatcher.pid} speech-dispatcher -TERM
56 rm -f /var/lock/subsys/speech-dispatcher
58 msg_not_running speech-dispatcher
63 if [ -f /var/lock/subsys/speech-dispatcher ]; then
64 msg_reloading speech-dispatcher
65 killproc speech-dispatcher -HUP
66 killproc --pidfile ${PIDFILE:-/var/run/speech-dispatcher/speech-dispatcher.pid} speech-dispatcher -HUP
69 msg_not_running speech-dispatcher
75 if [ -f /var/lock/subsys/speech-dispatcher ]; then
79 msg_not_running speech-dispatcher
85 # See how we were called.
100 # include force-reload here if program allows reloading without restart
101 # otherwise remove reload action and support force-reload as restart if running
105 # use this one if program doesn't support reloading without restart
110 status speech-dispatcher
114 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"