Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37042935
en ru br
Репозитории 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
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: monit

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

#! /bin/sh
#
# $Id: monit.init,v 1.4 2003/01/09 08:01:09 homyakov Exp $
#
# monit Monitors processes and restarts them if they exit
#
# chkconfig: 345 98 02
# 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

# Source function library.
. /etc/rc.d/init.d/functions

[ -r /etc/monitrc ] || exit

LOCKFILE=/var/lock/subsys/monit

RETVAL=0

start ()
{
echo -n "Starting monit daemon: "
daemon monit
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE
return $RETVAL
}

stop ()
{
echo -n "Stopping monit daemon: "
monit quit
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f "$LOCKFILE"
sleep 1 # restart slowly
return $RETVAL
}

status ()
{
monit status
return $?
}

restart ()
{
stop
start
}

reload ()
{
echo -n "Reloading monit configuration: "
killproc monit -HUP
RETVAL=$?
echo
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
reload)
reload
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
*)
echo "Usage: ${0##*/} {start|stop|reload|restart|condstop|condrestart|status}"
esac

exit $RETVAL
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin