10e267418b
- use start-stop-daemon in startup script - remove bogus symlink - /usr/man -> /usr/share/man
37 lines
770 B
Bash
Executable File
37 lines
770 B
Bash
Executable File
#!/bin/sh
|
|
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
|
|
|
|
USER="lirc"
|
|
GROUP="lirc"
|
|
RUNDIR="/var/run/lirc"
|
|
PIDFILE="$RUNDIR/lircd.pid"
|
|
PROG="/usr/sbin/lircd"
|
|
ARGS=""
|
|
|
|
case $1 in
|
|
start)
|
|
install -d -m 755 -o $USER -g $GROUP $RUNDIR || exit 1
|
|
start-stop-daemon --start --pidfile $PIDFILE --chuid $USER --group $GROUP --exec $PROG -- $ARGS
|
|
;;
|
|
stop)
|
|
start-stop-daemon --stop --retry 60 --pidfile $PIDFILE --user $USER
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
status)
|
|
start-stop-daemon --status --pidfile $PIDFILE
|
|
case $? in
|
|
0) echo "$PROG running with pid: $(cat $PIDFILE)" ;;
|
|
1) echo "$PROG not running, stale pidfile: $PIDFILE" ;;
|
|
3) echo "$PROG not running" ;;
|
|
4) echo "Unable to determine program status" ;;
|
|
esac
|
|
;;
|
|
*)
|
|
echo "usage: $0 [start|stop|restart|status]"
|
|
;;
|
|
esac
|
|
|