-
Notifications
You must be signed in to change notification settings - Fork 13
/
qt-kiosk-browser.initd
67 lines (55 loc) · 1.49 KB
/
qt-kiosk-browser.initd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
### BEGIN INIT INFO
# Provides: $NAME
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
set -e
DESC="Qt kiosk browser"
NAME="qt-kiosk-browser"
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="-platform eglfs /etc/$NAME.conf"
PIDFILE=/var/run/$NAME.pid
test -x ${DAEMON} || exit 0
umask 022
. /etc/init.d/functions
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
case "$1" in
start)
echo "Starting ${DESC}"
if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- ${DAEMON_ARGS}; then
exit 0
else
exit 1
fi
;;
stop)
echo "Stopping ${DESC}"
if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE}; then
rm -f ${PIDFILE}
exit 0
else
exit 1
fi
;;
restart)
echo "Restarting ${DESC}"
if start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${PIDFILE}; then
rm -f ${PIDFILE}
fi
if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- ${DAEMON_ARGS}; then
exit 0
else
exit 1
fi
;;
status)
status ${DAEMON} && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0