Репозитории ALT

S: | 5.33.0-alt1 |
5.1: | 5.2.5-alt0.M51.1 |
4.1: | 5.0-alt0.1 |
4.0: | 5.2.5-alt0.M40.1 |
3.0: | 4.1.1-alt1.1 |
Группа :: Мониторинг
Пакет: monit
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#! /bin/sh
#
# $Id: monit.init.Sisyphus,v 1.1 2004/02/12 22:05:45 homyakov Exp $
#
# monit Monitors processes and restarts them if they exit
#
# chkconfig: - 99 01
# description: monit is a simple daemon process to restart processes if \
# they die. It can also check tcp and udp ports to make sure \
# that they are responding.
# processname: monit
# pidfile: /var/run/monit.pid
# config: /etc/monitrc
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network
# Source config.
SourceIfNotEmpty /etc/sysconfig/monit
[ -r /etc/monitrc ] || exit
PIDFILE=/var/run/monit.pid
LOCKFILE=/var/lock/subsys/monit
RETVAL=0
start ()
{
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- monit $MONIT_OPTIONS
RETVAL=$?
return $RETVAL
}
stop ()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- monit
RETVAL=$?
return $RETVAL
}
summary ()
{
monit summary || echo "Please enable web interface for localhost"
RETVAL=$?
return $RETVAL
}
restart ()
{
conftest || exit $?
stop
start
}
reload ()
{
conftest || exit $?
msg_reloading monit
stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- monit
RETVAL=$?
return $RETVAL
}
conftest()
{
action "Checking configuration sanity for monit: " monit -t
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
conftest || exit $?
start
;;
stop)
stop
;;
summary)
summary
;;
restart)
restart
;;
reload)
reload
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root -- monit
# monit status
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL