From 796402f6c50933ba8f57184528323670ef200267 Mon Sep 17 00:00:00 2001 From: Etienne CHAMPETIER Date: Wed, 11 Jun 2014 22:52:07 +0200 Subject: [PATCH] monit: switch init script to procd Successfully tested on ar71xx Signed-off-by: Etienne CHAMPETIER --- admin/monit/files/monit.init | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/admin/monit/files/monit.init b/admin/monit/files/monit.init index b8a8ff8240..2bb360923a 100644 --- a/admin/monit/files/monit.init +++ b/admin/monit/files/monit.init @@ -1,16 +1,15 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006-2013 OpenWrt.org +# Copyright (C) 2014 OpenWrt.org START=60 +USE_PROCD=1 +PROG=/usr/bin/monit -SERVICE_USE_PID=1 - -start() { - [ -f /etc/monitrc ] || return 1 +start_service() { + [ -f /etc/monitrc ] || { echo "monit: /etc/monitrc is missing"; return 1; } chmod 0600 /etc/monitrc - service_start /usr/bin/monit -} - -stop() { - service_stop /usr/bin/monit + procd_open_instance + # -I runs in foreground, as procd requires + procd_set_param command "$PROG" -I + procd_close_instance } -- 2.30.2