mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-18 22:06:04 +01:00
system/monit: Added to 12.0 repository
This commit is contained in:
parent
9e4c1ae975
commit
4fd7a6d9d4
6 changed files with 213 additions and 0 deletions
6
system/monit/README
Normal file
6
system/monit/README
Normal file
|
@ -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.
|
24
system/monit/doinst.sh
Normal file
24
system/monit/doinst.sh
Normal file
|
@ -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
|
||||
|
80
system/monit/monit.SlackBuild
Normal file
80
system/monit/monit.SlackBuild
Normal file
|
@ -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
|
8
system/monit/monit.info
Normal file
8
system/monit/monit.info
Normal file
|
@ -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"
|
76
system/monit/rc.monit
Normal file
76
system/monit/rc.monit
Normal file
|
@ -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
|
||||
|
19
system/monit/slack-desc
Normal file
19
system/monit/slack-desc
Normal file
|
@ -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:
|
Loading…
Reference in a new issue