blob: b622c5c9051a49566ab0aaec6dd04ddd2a3dec82 (
plain)
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
|
#!/bin/sh
### BEGIN INIT INFO
# Provides: pwrtray-backend
# Required-Start: $syslog $local_fs dbus bluetooth
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: pwrtray-backend daemon
# Description: Tiny power control daemon
### END INIT INFO
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
NAME=pwrtray-backend
DAEMON="$(which $NAME)"
PIDFILE="/run/pwrtray/pwrtray-backend.pid"
DESC="tiny power control daemon"
. /lib/lsb/init-functions
case "$1" in
start)
log_begin_msg "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--oknodo --exec "$DAEMON" -- \
-B -P $PIDFILE
log_end_msg $?
;;
stop)
log_begin_msg "Stopping $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--name "$NAME"
RES=$?
rm -f $PIDFILE
log_end_msg $RES
;;
restart|reload|force-reload)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage $0 [start|stop|restart|reload|force-reload]"
exit 1
;;
esac
exit 0
|