diff --git a/admin/monit/Makefile b/admin/monit/Makefile index 57d7adae1..ef40bd916 100644 --- a/admin/monit/Makefile +++ b/admin/monit/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=monit PKG_VERSION:=5.2.5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://mmonit.com/monit/dist diff --git a/admin/monit/files/monit.init b/admin/monit/files/monit.init index 6a3e5c081..af31d898f 100644 --- a/admin/monit/files/monit.init +++ b/admin/monit/files/monit.init @@ -1,19 +1,16 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org START=60 -BIN=monit -DEFAULT=/etc/default/$BIN -RUN_D=/var/run -PID_F=$RUN_D/$BIN.pid + +SERVICE_USE_PID=1 start() { - [ -f $DEFAULT ] && . $DEFAULT - mkdir -p $RUN_D - $BIN $OPTIONS + [ -f /etc/monitrc ] || return 1 + [ "$(stat -c "%a" /etc/monitrc)" = "0700" ] || chmod 0700 /etc/monitrc + service_start /usr/bin/monit -d 60 } stop() { - [ -f $PID_F ] && kill $(cat $PID_F) + service_stop /usr/bin/monit } -