d1159d300c
I wanted to configure monit with a rule that checks a network connection, restarts the connection if it fails, and eventually reboots the entire router if the connection restarts don't work. I wrote this in my rules: start "/sbin/ifup inet" stop "/sbin/ifdown inet" if failed icmp type echo count 3 timeout 10 seconds then restart if 3 restarts within 5 cycles then exec "/sbin/reboot" When I tested these rules I found that monit 5.0.3 does not support the phrase: ... then exec "/sbin/reboot" But this phrase is supported by monit 5.1.1. I patched the Makefile to upgrade to 5.1.1, rebuilt and reflashed, and now my monit rule runs as intended. So I have tested this on a grand total of one machine (Linksys WAG354G, TI AR7). Is this enough to justify upgrading monit for everyone? My changes to package/feeds/packages/monit/Makefile are below. They were generated with svn diff. Signed-off-by: Jon Hirst <openwrt@jonmail.co.uk> git-svn-id: svn://svn.openwrt.org/openwrt/packages@23624 3c298f89-4303-0410-b956-a3cf2f4a3e73
106 lines
2.3 KiB
Makefile
106 lines
2.3 KiB
Makefile
#
|
|
# Copyright (C) 2006-2009 OpenWrt.org
|
|
#
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
# See /LICENSE for more information.
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=monit
|
|
PKG_VERSION:=5.1.1
|
|
PKG_RELEASE:=1
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
PKG_SOURCE_URL:=http://mmonit.com/monit/dist/
|
|
PKG_MD5SUM:=4bbd3845ae1cbab13ec211824e0486dc
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
define Package/monit/Default
|
|
SECTION:=admin
|
|
CATEGORY:=Administration
|
|
DEPENDS:= +libpthread
|
|
TITLE:=System services monitoring utility
|
|
URL:=http://mmonit.com/monit/
|
|
endef
|
|
|
|
define Package/monit/Default/description
|
|
An utility for monitoring services on a Unix system
|
|
endef
|
|
|
|
define Package/monit
|
|
$(call Package/monit/Default)
|
|
DEPENDS+= +libopenssl
|
|
TITLE+= (with SSL support)
|
|
endef
|
|
|
|
define Package/monit/description
|
|
$(call Package/monit/Default/description)
|
|
This package is built with SSL support.
|
|
endef
|
|
|
|
define Package/monit-nossl
|
|
$(call Package/monit/Default)
|
|
TITLE+= (without SSL support)
|
|
endef
|
|
|
|
define Package/monit-nossl/description
|
|
$(call Package/monit/Default/description)
|
|
This package is built without SSL support.
|
|
endef
|
|
|
|
define Build/Template
|
|
|
|
$(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
|
|
-$(MAKE) -C $(PKG_BUILD_DIR) clean
|
|
$(call Build/Configure/Default,$(3))
|
|
$(MAKE) -C $(PKG_BUILD_DIR)
|
|
( cd $(PKG_BUILD_DIR); mv -f monit monit-$(2) )
|
|
touch $$@
|
|
|
|
$(STAMP_BUILT): $(STAMP_BUILT)-$(2)
|
|
|
|
define Package/$(1)/conffiles
|
|
/etc/monitrc
|
|
endef
|
|
|
|
define Package/$(1)/install
|
|
$(INSTALL_DIR) $$(1)/etc
|
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/monitrc $$(1)/etc/
|
|
$(INSTALL_DIR) $$(1)/etc/init.d
|
|
$(INSTALL_BIN) ./files/monit.init $$(1)/etc/init.d/monit
|
|
$(INSTALL_DIR) $$(1)/usr/sbin
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/monit-$(2) $$(1)/usr/sbin/monit
|
|
endef
|
|
|
|
endef
|
|
|
|
define Build/Configure
|
|
endef
|
|
|
|
define Build/Compile
|
|
endef
|
|
|
|
ifneq ($(SDK)$(CONFIG_PACKAGE_monit),)
|
|
define Build/with-ssl
|
|
$(call Build/Template,monit,with-ssl, \
|
|
--with-ssl \
|
|
--with-ssl-dir="$(STAGING_DIR)/usr" \
|
|
)
|
|
endef
|
|
endif
|
|
$(eval $(Build/with-ssl))
|
|
|
|
ifneq ($(SDK)$(CONFIG_PACKAGE_monit-nossl),)
|
|
define Build/without-ssl
|
|
$(call Build/Template,monit-nossl,without-ssl, \
|
|
--without-ssl \
|
|
)
|
|
endef
|
|
endif
|
|
$(eval $(Build/without-ssl))
|
|
|
|
$(eval $(call BuildPackage,monit))
|
|
$(eval $(call BuildPackage,monit-nossl))
|