packages/monit: use new service functions, fix /etc/monitrc permissions
authornico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 9 Nov 2011 19:48:55 +0000 (19:48 +0000)
committernico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 9 Nov 2011 19:48:55 +0000 (19:48 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28887 3c298f89-4303-0410-b956-a3cf2f4a3e73

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

index 57d7ada..ef40bd9 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 6a3e5c0..af31d89 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
 }
-