gasleak alert spaceapi
[svn42.git] / uc_sensor_node_zmq.initscript
1 #!/bin/sh
2 # Start/stop the tuer status updater.
3 #
4 ### BEGIN INIT INFO
5 # Provides:          uc_sensor_node_zmq
6 # Required-Start:    $remote_fs $syslog $time
7 # Required-Stop:     $remote_fs $syslog $time
8 # Default-Start:     2 3 4 5
9 # Default-Stop:      0 1 6
10 ### END INIT INFO
11
12 EXE_NODE=/home/realraum/uc_sensor_node_zmq
13 CFG_NODE=""
14 DIR_RUN=/var/run
15 DOOR_USR=realraum
16 DOOR_GRP=nogroup
17
18 #. /etc/default/tuer
19
20 PIDFILE_NODE=/var/run/uc_sensor_node_zmq.pid
21
22 test -f $EXE_NODE  || exit 1
23 if [ ! -d $DIR_RUN ]; then
24         mkdir -p $DIR_RUN || exit 2
25         chown -R $DOOR_USR:$DOOR_GRP $DIR_RUN
26 fi
27
28 . /lib/lsb/init-functions
29
30 # Read the system's locale and set cron's locale. This locale
31 # will be inherited by cron (used to set charset of emails)
32 # and tasks running under it.
33
34 case "$1" in
35 start)
36   log_daemon_msg "Starting daemon" uc_sensor_node_zmq
37   start-stop-daemon --start --quiet --pidfile $PIDFILE_NODE -b -m -c $DOOR_USR --startas $EXE_NODE  -- $CFG_NODE
38   log_end_msg $?
39         ;;
40 stop)
41   log_daemon_msg "Stopping daemon" uc_sensor_node_zmq
42   start-stop-daemon --stop --quiet --pidfile $PIDFILE_NODE -m --retry TERM/1/TERM/1/KILL
43   log_end_msg $?
44         ;;
45 restart)
46         $0 stop
47         $0 start
48         ;;
49 *)      log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
50         exit 2
51         ;;
52 esac
53 exit 0