packages/monit: use new service functions, fix /etc/monitrc permissions
authorNicolas Thill <nico@openwrt.org>
Wed, 9 Nov 2011 19:48:55 +0000 (19:48 +0000)
committerNicolas Thill <nico@openwrt.org>
Wed, 9 Nov 2011 19:48:55 +0000 (19:48 +0000)
SVN-Revision: 28887

admin/monit/Makefile
admin/monit/files/monit.init

index 57d7adae177a00eb489f06ba6a3723492b6c23bb..ef40bd9163f237167dedbf6624dde6e9db0664c6 100644 (file)
@@ -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
index 6a3e5c081399487db97294d1c09c6bd191e2d79c..af31d898fb9733917a5f5601a6e268dae17f59b4 100644 (file)
@@ -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
 }
-