From 58dca4e50ba32dcad9551300691c12c55e740344 Mon Sep 17 00:00:00 2001 From: Dirk Wagner Date: Fri, 9 May 2014 08:59:17 +0200 Subject: [PATCH] monit addon: First version. --- config/rootfiles/packages/monit | 7 +++ lfs/monit | 93 +++++++++++++++++++++++++++++++++ make.sh | 1 + src/initscripts/init.d/monit | 39 ++++++++++++++ 4 files changed, 140 insertions(+) create mode 100644 config/rootfiles/packages/monit create mode 100644 lfs/monit create mode 100644 src/initscripts/init.d/monit diff --git a/config/rootfiles/packages/monit b/config/rootfiles/packages/monit new file mode 100644 index 0000000000..7a8c5f6916 --- /dev/null +++ b/config/rootfiles/packages/monit @@ -0,0 +1,7 @@ +etc/rc.d/rc0.d/K40monit +etc/rc.d/rc3.d/S60monit +etc/rc.d/rc6.d/K40monit +etc/init.d/monit +usr/bin/monit +#usr/share/man/man1/monit.1 +var/ipfire/backup/addons/includes/monit diff --git a/lfs/monit b/lfs/monit new file mode 100644 index 0000000000..35bb949a21 --- /dev/null +++ b/lfs/monit @@ -0,0 +1,93 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2009 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 5.8 + +THISAPP = monit-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +PROG = monit +PAK_VER = 1 + +DEPS = "" + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = c6873b0828f872676f9e7fe1476a8dc2 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/etc + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + install -v -m 644 $(DIR_SRC)/config/backup/includes/monit \ + /var/ipfire/backup/addons/includes/monit + ln -sf ../init.d/pound /etc/rc.d/rc3.d/S60monit + ln -sf ../init.d/pound /etc/rc.d/rc0.d/K40monit + ln -sf ../init.d/pound /etc/rc.d/rc6.d/K40monit + + # Remove temporary file. + rm -vf /root/.rnd + +# @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index d280d9c8f7..e94e8556de 100755 --- a/make.sh +++ b/make.sh @@ -730,6 +730,7 @@ buildipfire() { ipfiremake iftop ipfiremake motion ipfiremake joe + ipfiremake monit ipfiremake nut ipfiremake watchdog ipfiremake libpri diff --git a/src/initscripts/init.d/monit b/src/initscripts/init.d/monit new file mode 100644 index 0000000000..79cec500e0 --- /dev/null +++ b/src/initscripts/init.d/monit @@ -0,0 +1,39 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/monit +# +# Description : monit monitoring daemon +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + boot_mesg "Starting monit..." + loadproc /usr/sbin/monit + ;; + + stop) + boot_mesg "Stopping monit..." + killproc /usr/sbin/monit + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /usr/sbin/monit + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/monit -- 2.39.2