]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
monit addon: First version.
authorDirk Wagner <dirk.wagner@ipfire.org>
Fri, 9 May 2014 06:59:17 +0000 (08:59 +0200)
committerDirk Wagner <dirk.wagner@ipfire.org>
Fri, 9 May 2014 06:59:17 +0000 (08:59 +0200)
config/rootfiles/packages/monit [new file with mode: 0644]
lfs/monit [new file with mode: 0644]
make.sh
src/initscripts/init.d/monit [new file with mode: 0644]

diff --git a/config/rootfiles/packages/monit b/config/rootfiles/packages/monit
new file mode 100644 (file)
index 0000000..7a8c5f6
--- /dev/null
@@ -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 (file)
index 0000000..35bb949
--- /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 <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# 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 d280d9c8f77149f448d5a6a6e8b7f763e3e1361f..e94e8556de199cb71f25293999fb0b3bf99f32e2 100755 (executable)
--- 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 (file)
index 0000000..79cec50
--- /dev/null
@@ -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