blob: 630636f1eed356c7d3791b6e6bb38ea7112bdef0 (
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
|
#!/sbin/runscript
depend() {
need net
}
start() {
ebegin "Starting monitorix"
start-stop-daemon --start --exec /usr/sbin/monitorix --pidfile /var/run/monitorix.pid -- -c /etc/monitorix/monitorix.conf -p /var/run/monitorix.pid
local i=0
local timeout=5
while [ ! -f /var/run/monitorix.pid ] && [ $i -le $timeout ]; do
sleep 1
i=$(($i + 1))
done
[ $timeout -gt $i ]
eend $?
}
stop() {
ebegin "Stopping monitorix"
start-stop-daemon --stop --signal QUIT --stop --exec /usr/sbin/monitorix --pidfile /var/run/monitorix.pid
eend $?
}
|