Репозитории ALT
S: | 2.8.0-alt2 |
5.1: | 2.0.5-alt4 |
4.1: | 2.0.5-alt3 |
4.0: | 2.0.5-alt2 |
3.0: | 2.0.2-alt1 |
Группа :: Система/Серверы
Пакет: nut
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# chkconfig: 2345 88 12
# description: The UPS information server
# processname: upsd
# config: /etc/ups/
# pidfile: /var/run/upsd/upsd.pid
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source service configuration.
SourceIfNotEmpty /etc/sysconfig/upsd
PIDDIR=/var/lib/upsd
PIDFILE=$PIDDIR/upsd.pid
LOCKFILE=/var/lock/subsys/upsd
RETVAL=0
start()
{
upsd_configured || return 0
msg_starting $"UPS information"
if ! service upsdrv status >/dev/null 2>&1; then
msg_not_running $"UPS driver"
failure "upsd startup"
RETVAL=$?
echo
return $RETVAL
fi
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user upsd --no-announce -- upsd $UPSD_OPTIONS
RETVAL=$?
return $RETVAL
}
stop()
{
msg_stopping $"UPS information"
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user upsd --no-announce -- upsd
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
msg_reloading $"UPS information"
stop_daemon --pidfile "$PIDFILE" --expect-user upsd -HUP -- upsd
RETVAL=$?
return $RETVAL
}
# See how we are called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status --pidfile "$PIDFILE" --expect-user upsd -- upsd
RETVAL=$?
;;
reload)
reload
;;
restart)
restart
;;
condstart)
if [ ! -e "$LOCKFILE" ]; then
start
fi
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
*)
msg_usage "${0##*/} {start|stop|status|reload|restart|condstart|condstop|condreload|condrestart}"
RETVAL=1
esac
exit $RETVAL