|
@@ -1,16 +1,15 @@
|
1
|
1
|
#!/bin/sh /etc/rc.common
|
2
|
|
-# Copyright (C) 2006-2013 OpenWrt.org
|
|
2
|
+# Copyright (C) 2014 OpenWrt.org
|
3
|
3
|
|
4
|
4
|
START=60
|
|
5
|
+USE_PROCD=1
|
|
6
|
+PROG=/usr/bin/monit
|
5
|
7
|
|
6
|
|
-SERVICE_USE_PID=1
|
7
|
|
-
|
8
|
|
-start() {
|
9
|
|
- [ -f /etc/monitrc ] || return 1
|
|
8
|
+start_service() {
|
|
9
|
+ [ -f /etc/monitrc ] || { echo "monit: /etc/monitrc is missing"; return 1; }
|
10
|
10
|
chmod 0600 /etc/monitrc
|
11
|
|
- service_start /usr/bin/monit
|
12
|
|
-}
|
13
|
|
-
|
14
|
|
-stop() {
|
15
|
|
- service_stop /usr/bin/monit
|
|
11
|
+ procd_open_instance
|
|
12
|
+ # -I runs in foreground, as procd requires
|
|
13
|
+ procd_set_param command "$PROG" -I
|
|
14
|
+ procd_close_instance
|
16
|
15
|
}
|