packages/monit: use new service functions, fix /etc/monitrc permissions
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28887 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
ec59faaca6
commit
3dc31f9f9f
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=monit
|
PKG_NAME:=monit
|
||||||
PKG_VERSION:=5.2.5
|
PKG_VERSION:=5.2.5
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=http://mmonit.com/monit/dist
|
PKG_SOURCE_URL:=http://mmonit.com/monit/dist
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
# Copyright (C) 2006 OpenWrt.org
|
# Copyright (C) 2006-2011 OpenWrt.org
|
||||||
|
|
||||||
START=60
|
START=60
|
||||||
BIN=monit
|
|
||||||
DEFAULT=/etc/default/$BIN
|
SERVICE_USE_PID=1
|
||||||
RUN_D=/var/run
|
|
||||||
PID_F=$RUN_D/$BIN.pid
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
[ -f $DEFAULT ] && . $DEFAULT
|
[ -f /etc/monitrc ] || return 1
|
||||||
mkdir -p $RUN_D
|
[ "$(stat -c "%a" /etc/monitrc)" = "0700" ] || chmod 0700 /etc/monitrc
|
||||||
$BIN $OPTIONS
|
service_start /usr/bin/monit -d 60
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
[ -f $PID_F ] && kill $(cat $PID_F)
|
service_stop /usr/bin/monit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user