aboutsummaryrefslogtreecommitdiff
path: root/system/monit
diff options
context:
space:
mode:
Diffstat (limited to 'system/monit')
-rw-r--r--system/monit/README6
-rw-r--r--system/monit/doinst.sh24
-rw-r--r--system/monit/monit.SlackBuild80
-rw-r--r--system/monit/monit.info8
-rw-r--r--system/monit/rc.monit76
-rw-r--r--system/monit/slack-desc19
6 files changed, 213 insertions, 0 deletions
diff --git a/system/monit/README b/system/monit/README
new file mode 100644
index 0000000000000..72db6efd13e91
--- /dev/null
+++ b/system/monit/README
@@ -0,0 +1,6 @@
+monit - Unix System Management
+
+Monit is a utility for managing and monitoring processes,
+files, directories and devices on a Unix system. Monit conducts
+automatic maintenance and repair and can execute meaningful causal
+actions in error situations.
diff --git a/system/monit/doinst.sh b/system/monit/doinst.sh
new file mode 100644
index 0000000000000..0899c24df5d28
--- /dev/null
+++ b/system/monit/doinst.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+# Keep same perms on rc.monit.new:
+if [ -e etc/rc.d/rc.monit ]; then
+ cp -a etc/rc.d/rc.monit etc/rc.d/rc.monit.new.incoming
+ cat etc/rc.d/rc.monit.new > etc/rc.d/rc.monit.new.incoming
+ mv etc/rc.d/rc.monit.new.incoming etc/rc.d/rc.monit.new
+fi
+
+config etc/rc.d/rc.monit.new
+
diff --git a/system/monit/monit.SlackBuild b/system/monit/monit.SlackBuild
new file mode 100644
index 0000000000000..73c4f5beacbef
--- /dev/null
+++ b/system/monit/monit.SlackBuild
@@ -0,0 +1,80 @@
+#!/bin/sh
+#
+# Slackware build script of monit
+
+# Copyright 2006 Ricardson Williams <ricardsonwilliams at yahoo.com.br>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=monit
+VERSION=4.9
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-2}
+TAG=${TAG:-_SBo}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP || exit 1
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
+cd $PRGNAM-$VERSION || exit 1
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --mandir=/usr/man \
+ || exit 1
+
+make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+if [ -d $PKG/usr/man ]; then
+( cd $PKG/usr/man
+ find . -type f -exec gzip -9 {} \;
+ for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+)
+fi
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CHANGES.txt CONTRIBUTORS COPYING doc FAQ.txt LICENSE PLATAFORMS \
+ README README.ssl STATUS UPGRADE.txt $PKG/usr/doc/$PRGNAM-$VERSION
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+mkdir -p $PKG/etc/rc.d
+cat $CWD/rc.monit > $PKG/etc/rc.d/rc.monit.new
+
+cd $PKG
+/sbin/makepkg -c n -l y -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
diff --git a/system/monit/monit.info b/system/monit/monit.info
new file mode 100644
index 0000000000000..b1e4048404af0
--- /dev/null
+++ b/system/monit/monit.info
@@ -0,0 +1,8 @@
+PRGNAM="monit"
+VERSION="4.9"
+HOMEPAGE="http://www.tildeslash.com/monit/index.php"
+DOWNLOAD="http://www.tildeslash.com/monit/dist/monit-4.9.tar.gz"
+MD5SUM="bcbaab776a54d1e34e3a057c925de9ca"
+MAINTAINER="Ricardson Williams"
+EMAIL="ricardsonwilliams@yahoo.com.br"
+APPROVED="rworkman"
diff --git a/system/monit/rc.monit b/system/monit/rc.monit
new file mode 100644
index 0000000000000..f1bd5107f823e
--- /dev/null
+++ b/system/monit/rc.monit
@@ -0,0 +1,76 @@
+#!/bin/bash
+#
+# Init file for Monit process monitor.
+#
+# Written by Dag Wieers <dag@wieers.com>.
+# Adapted for Slackware by Eric Hameleers <alien@slackware.com>
+#
+
+### Default variables
+CONFIG="/etc/monit.conf"
+PIDFILE="/var/run/monit.pid"
+
+[ -x /usr/bin/monit ] || exit 1
+[ -r "$CONFIG" ] || exit 1
+
+RETVAL=0
+prog="monit"
+desc="Process Monitor"
+
+start() {
+ echo "Starting $desc ($prog): /etc/rc.d/rc.$prog start"
+ $prog -c $CONFIG -p $PIDFILE
+ return $?
+}
+
+stop() {
+ echo "Shutting down $desc ($prog)..."
+ if [ -f $PIDFILE ]; then
+ kill -TERM $(cat $PIDFILE)
+ else
+ killall -TERM $prog
+ fi
+ return $?
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo "Reloading $desc ($prog)"
+ $prog -c $CONFIG reload
+ return $?
+}
+
+status() {
+ PIDS=$(pidof $prog)
+ if [ "$PIDS" == "" ]; then
+ echo "$prog is not running!"
+ else
+ echo "$prog is running at pid(s) ${PIDS}."
+ fi
+ return $?
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ reload)
+ reload
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|status}"
+esac
+
diff --git a/system/monit/slack-desc b/system/monit/slack-desc
new file mode 100644
index 0000000000000..72580408c8ec9
--- /dev/null
+++ b/system/monit/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+monit: monit (Unix System Management)
+monit:
+monit: Monit is a utility for managing and monitoring processes,
+monit: files, directories and devices on a Unix system. Monit conducts
+monit: automatic maintenance and repair and can execute meaningful causal
+monit: actions in error situations.
+monit:
+monit: Homepage: http://www.tildeslash.com/monit/index.php
+monit:
+monit:
+monit: