#! /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 global PATH := '/sbin:/bin:/usr/sbin:/usr/bin' global DAEMON := '/usr/bin/speech-dispatcher' global PIDFILE := '/var/run/speech-dispatcher/speech-dispatcher.pid' global NAME := 'speech-dispatcher' global DESC := ''Speech Dispatcher'' global USER := 'speech-dispatcher' test -f $DAEMON || exit 0 source /lib/lsb/init-functions global 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 { global PIDDIR := $[dirname $PIDFILE] test -e $PIDDIR || install -d -ospeech-dispatcher -gaudio -m750 $PIDDIR global SDDIR := "$PIDDIR/.speech-dispatcher" test -e $SDDIR || ln -s $PIDDIR $SDDIR global 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 } matchstr $1 { start { log_daemon_msg "Starting $DESC" "speech-dispatcher" do_start log_end_msg $Status } stop { log_daemon_msg "Stopping $DESC" "speech-dispatcher" do_stop log_end_msg $Status } 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 } restart { log_daemon_msg "Restarting $DESC" "speech-dispatcher" do_stop sleep 3 do_start log_end_msg $Status } * { global N := "/etc/init.d/$NAME" echo "Usage: $N {start|stop|restart|reload|force-reload}" > !2 exit 1 } } exit 0