#! /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 setvar PATH = "/sbin:/bin:/usr/sbin:/usr/bin" setvar DAEMON = '/usr/bin/speech-dispatcher' setvar PIDFILE = '/var/run/speech-dispatcher/speech-dispatcher.pid' setvar NAME = 'speech-dispatcher' setvar DESC = ''Speech Dispatcher'' setvar USER = 'speech-dispatcher' test -f $DAEMON || exit 0 source /lib/lsb/init-functions setvar 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 { setvar PIDDIR = $(dirname $PIDFILE) test -e $PIDDIR || install -d -ospeech-dispatcher -gaudio -m750 $PIDDIR setvar SDDIR = "$PIDDIR/.speech-dispatcher" test -e $SDDIR || ln -s $PIDDIR $SDDIR setvar 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 * setvar N = "/etc/init.d/$NAME" echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 exit 1 } exit 0