2 # Start/stop the tuer daemon.
6 # Required-Start: $remote_fs $syslog $time
7 # Required-Stop: $remote_fs $syslog $time
8 # Default-Start: 2 3 4 5
12 EXE_DOOR=/flash/tuer/door_daemon
13 EXE_CARD=/flash/tuer/checkcard.pl
16 DOOR_SOCKET=${DIR_RUN}/door_cmd.socket
18 #DOOR_LOG=/var/log/tmp/tuer.log
23 PIDFILE1=${DIR_RUN}/door_daemon.pid
24 PIDFILE2=${DIR_RUN}/checkcard.pid
26 test -f $EXE_DOOR || exit 1
27 test -f $EXE_CARD || exit 1
28 if [ ! -d $DIR_RUN ]; then
29 mkdir -p $DIR_RUN || exit 2
30 chown -R $DOOR_USR:$DOOR_GRP $DIR_RUN
32 chown $DOOR_USR:$DOOR_GRP $DOOR_DEV
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" "door_daemon"
43 start-stop-daemon --start --quiet --pidfile $PIDFILE1 --name door_daemon --startas $EXE_DOOR -- -d $DOOR_DEV -s $DOOR_SOCKET -u $DOOR_USR -g $DOOR_GRP -P $PIDFILE1
45 log_daemon_msg "Starting door daemon" "checkcard"
46 start-stop-daemon --start --quiet --pidfile $PIDFILE2 -b -m --name checkcard.pl --startas $EXE_CARD -- $DOOR_SOCKET
47 #start-stop-daemon --start --quiet --pidfile $PIDFILE2 -c $DOOR_USR -b -m --name checkcard.pl --startas $EXE_CARD -- $DOOR_SOCKET
51 log_daemon_msg "Stopping door daemon" "door_daemon"
52 start-stop-daemon --stop --quiet --pidfile $PIDFILE1 -m --name door_daemon
54 log_daemon_msg "Stopping door daemon" "checkcard"
55 start-stop-daemon --stop --quiet --pidfile $PIDFILE2 -m --name checkcard.pl
57 killall "mifare-read" 2>/dev/null
63 *) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"