2 # Start/stop the tuer status updater.
5 # Provides: tuer_status
6 # Required-Start: $remote_fs $syslog $time $tuer_core
7 # Required-Stop: $remote_fs $syslog $time $tuer_core
8 # Default-Start: 2 3 4 5
12 EXE_TRACK=/flash/tuer/track-presence.py
13 EXE_UWEB=/flash/tuer/update-web-status.py
14 EXE_XMPP=/flash/tuer/update-xmpp-status.py
16 CFG_TRACK=/flash/tuer/track-presence.cfg
17 CFG_UWEB=/flash/tuer/update-web-status.cfg
18 CFG_XMPP=/flash/tuer/update-xmpp-status.cfg
22 PIDFILE_TRACK=${DIR_RUN}/track-presence.pid
23 PIDFILE_UWEB=${DIR_RUN}/update-web-status.pid
24 PIDFILE_XMPP=${DIR_RUN}/update-xmpp-status.pid
26 test -f $EXE_TRACK || exit 1
27 test -f $EXE_UWEB || exit 1
28 test -f $EXE_XMPP || exit 1
29 if [ ! -d $DIR_RUN ]; then
30 mkdir -p $DIR_RUN || exit 2
31 chown -R $DOOR_USR:$DOOR_GRP $DIR_RUN
34 . /lib/lsb/init-functions
36 # Read the system's locale and set cron's locale. This locale
37 # will be inherited by cron (used to set charset of emails)
38 # and tasks running under it.
42 log_daemon_msg "Starting door daemon" "track-presence"
43 start-stop-daemon --start --quiet --pidfile $PIDFILE_TRACK -b -m -c $DOOR_USR --name track-presence.py --startas $EXE_TRACK -- $CFG_TRACK
45 log_daemon_msg "Starting door daemon" "update-web-status"
46 start-stop-daemon --start --quiet --pidfile $PIDFILE_UWEB -b -m -c $DOOR_USR --name update-web-status.py --startas $EXE_UWEB -- $CFG_UWEB
48 log_daemon_msg "Starting door daemon" "update-xmpp-status"
49 start-stop-daemon --start --quiet --pidfile $PIDFILE_XMPP -b -m -c $DOOR_USR --name update-xmpp-status.py --startas $EXE_XMPP -- $CFG_XMPP
53 log_daemon_msg "Stopping door daemon" "update-web-status"
54 start-stop-daemon --stop --quiet --pidfile $PIDFILE_UWEB -m --retry TERM/1/TERM/1/KILL
56 log_daemon_msg "Stopping door daemon" "update-xmpp-status"
57 start-stop-daemon --stop --quiet --pidfile $PIDFILE_XMPP -m --retry TERM/1/TERM/1/KILL
59 log_daemon_msg "Stopping door daemon" "track-presence"
60 start-stop-daemon --stop --quiet --pidfile $PIDFILE_TRACK -m --retry TERM/1/TERM/1/KILL
67 *) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"