2 # Start/stop the tuer daemon core.
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
15 DOOR_LOG="--log syslog:3,door_daemon,local1"
20 PIDFILE_DOOR=${DIR_RUN}/door_daemon.pid
21 PIDFILE_CARD=${DIR_RUN}/checkcard.pid
23 test -f $EXE_DOOR || exit 1
24 test -f $EXE_CARD || exit 1
25 if [ ! -d $DIR_RUN ]; then
26 mkdir -p $DIR_RUN || exit 2
27 chown -R $DOOR_USR:$DOOR_GRP $DIR_RUN
29 chown $DOOR_USR:$DOOR_GRP $DOOR_DEV
31 . /lib/lsb/init-functions
33 # Read the system's locale and set cron's locale. This locale
34 # will be inherited by cron (used to set charset of emails)
35 # and tasks running under it.
39 log_daemon_msg "Starting door daemon" "door_daemon"
40 start-stop-daemon --start --quiet --pidfile $PIDFILE_DOOR --name door_daemon --startas $EXE_DOOR -- -d $DOOR_DEV -s $DOOR_SOCKET -u $DOOR_USR -g $DOOR_GRP -P $PIDFILE_DOOR $DOOR_LOG
42 log_daemon_msg "Starting door daemon" "checkcard"
43 start-stop-daemon --start --quiet --pidfile $PIDFILE_CARD -b -m --name checkcard.pl --startas $EXE_CARD -- $DOOR_SOCKET
44 #start-stop-daemon --start --quiet --pidfile $PIDFILE_CARD -c $DOOR_USR -b -m --name checkcard.pl --startas $EXE_CARD -- $DOOR_SOCKET
48 log_daemon_msg "Stopping door daemon" "door_daemon"
49 start-stop-daemon --stop --quiet --pidfile $PIDFILE_DOOR -m --name door_daemon
51 log_daemon_msg "Stopping door daemon" "checkcard"
52 start-stop-daemon --stop --quiet --pidfile $PIDFILE_CARD -m --name checkcard.pl
54 killall "mifare-read" 2>/dev/null
60 *) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"