-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmaxkernel.initd
More file actions
64 lines (55 loc) · 1.49 KB
/
maxkernel.initd
File metadata and controls
64 lines (55 loc) · 1.49 KB
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
#!/bin/bash
### BEGIN INIT INFO
# Provides: maxkernel
# Default-Start: 2 3 4 5
# Default-Stop:
# Required-Start: $network
# Required-Stop:
# Short-Description: Start up maxkernel and autostart client script
# Description: A utility service that starts/stops maxkernel and autostart client script
### END INIT INFO
INSTALL=
test $INSTALL/maxkernel || exit 0
. /lib/lsb/init-functions
if [ $UID -ne 0 ]; then
echo "Must be root!" 1>&2
exit 1
fi
case "$1" in
start)
log_daemon_msg "Starting maxkernel"
if start-stop-daemon --start --name maxkernel --pidfile /var/run/maxkernel.pid --startas $INSTALL/maxkernel -- --daemon; then
log_end_msg 0
else
log_end_msg 1
fi
log_daemon_msg "Starting maxkernel autostart client"
if start-stop-daemon --start --background --make-pidfile --name max-autostart --pidfile /var/run/max-autostart.pid --startas $INSTALL/max-autostart -- -x; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping maxkernel autostart client"
$INSTALL/max-client -k
if start-stop-daemon --stop --oknodo --name max-autostart --pidfile /var/run/max-autostart.pid --retry=INT/15/TERM/5/KILL/5; then
log_end_msg 0
else
log_end_msg 1
fi
log_daemon_msg "Stopping maxkernel"
if start-stop-daemon --stop --oknodo --name maxkernel --pidfile /var/run/maxkernel.pid --retry=INT/15/TERM/5/KILL/5; then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
$0 stop
$0 start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
esac
exit 0