#! /bin/sh ### BEGIN INIT INFO # Provides: speech-dispatcher # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Should-Start: festival # Should-Stop: festival # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Speech Dispatcher # Description: Common interface to speech synthesizers ### END INIT INFO setglobal PATH = '/sbin:/bin:/usr/sbin:/usr/bin' setglobal DAEMON = '/usr/bin/speech-dispatcher' setglobal PIDFILE = '/var/run/speech-dispatcher/speech-dispatcher.pid' setglobal NAME = 'speech-dispatcher' setglobal DESC = ''Speech Dispatcher'' setglobal USER = 'speech-dispatcher' test -f $DAEMON || exit 0 source /lib/lsb/init-functions setglobal RUN = 'no' # Include speech-dispatcher defaults if available if test -f /etc/default/speech-dispatcher { source /etc/default/speech-dispatcher } if test "x$RUN" != "xyes" { log_action_msg "$NAME disabled; edit /etc/default/speech-dispatcher" exit 0 } set -e proc do_start { setglobal PIDDIR = $[dirname $PIDFILE] test -e $PIDDIR || install -d -ospeech-dispatcher -gaudio -m750 $PIDDIR setglobal SDDIR = "$PIDDIR/.speech-dispatcher" test -e $SDDIR || ln -s $PIDDIR $SDDIR setglobal LOGDIR = "$SDDIR/log" test -e $LOGDIR || ln -s /var/log/speech-dispatcher $LOGDIR start-stop-daemon --oknodo --start --quiet --chuid $USER --pidfile $PIDFILE \ --exec $DAEMON -- --pid-file $PIDFILE } proc do_stop { start-stop-daemon --oknodo --stop --quiet --user $USER \ --pidfile $PIDFILE --exec $DAEMON } match $1 { with start log_daemon_msg "Starting $DESC" "speech-dispatcher" do_start log_end_msg $Status with stop log_daemon_msg "Stopping $DESC" "speech-dispatcher" do_stop log_end_msg $Status with reload|force-reload log_daemon_msg "Reloading $DESC configuration files" "speech-dispatcher" start-stop-daemon --oknodo --stop --signal 1 --quiet --user $USER \ --pidfile $PIDFILE --exec $DAEMON log_end_msg $Status with restart log_daemon_msg "Restarting $DESC" "speech-dispatcher" do_stop sleep 3 do_start log_end_msg $Status with * setglobal N = "/etc/init.d/$NAME" echo "Usage: $N {start|stop|restart|reload|force-reload}" > !2 exit 1 } exit 0