2 # Start/stop the tuer status updater.
5 # Provides: tuer_actions
6 # Required-Start: $remote_fs $syslog $time $tuer_core $tuer_presence
7 # Required-Stop: $remote_fs $syslog $time $tuer_core $tuer_presence
8 # Default-Start: 2 3 4 5
12 EXE_SWITCH=/flash/tuer/switch-power.py
13 EXE_SOUND=/flash/tuer/play-sound-status.py
15 CFG_SWITCH=/flash/tuer/switch-power.cfg
16 CFG_SOUND=/flash/tuer/play-sound-status.cfg
20 PIDFILE_SWITCH=${DIR_RUN}/switch-power.pid
21 PIDFILE_SOUND=${DIR_RUN}/play-sound-status.pid
23 test -f $EXE_SWITCH || exit 1
24 test -f $EXE_SOUND || exit 1
25 if [ ! -d $DIR_RUN ]; then
26 mkdir -p $DIR_RUN || exit 2
27 chown -R $DOOR_USR:$DOOR_GRP $DIR_RUN
30 . /lib/lsb/init-functions
32 # Read the system's locale and set cron's locale. This locale
33 # will be inherited by cron (used to set charset of emails)
34 # and tasks running under it.
38 log_daemon_msg "Starting door daemon" "switch-power"
39 start-stop-daemon --start --quiet --pidfile $PIDFILE_SWITCH -b -m -c $DOOR_USR --name update-xmpp-status.py --startas $EXE_SWITCH -- $CFG_SWITCH
41 log_daemon_msg "Starting door daemon" "play-sound"
42 start-stop-daemon --start --quiet --pidfile $PIDFILE_SOUND -b -m -c $DOOR_USR --name update-xmpp-status.py --startas $EXE_SOUND -- $CFG_SOUND
46 log_daemon_msg "Stopping door daemon" "switch-power"
47 start-stop-daemon --stop --quiet --pidfile $PIDFILE_SWITCH -m --retry TERM/1/TERM/1/KILL
50 log_daemon_msg "Stopping door daemon" "play-sound"
51 start-stop-daemon --stop --quiet --pidfile $PIDFILE_SOUND -m --retry TERM/1/TERM/1/KILL
58 *) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"