Репозитории ALT
S: | 3.2.2-alt9 |
5.1: | 3.2.2-alt5 |
4.1: | 3.2.2-alt2 |
4.0: | 3.2.2-alt2 |
3.0: | 3.2.2-alt1 |
Группа :: Система/Серверы
Пакет: apmd
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# chkconfig: 2345 35 65
# description: apmd is used for monitoring battery status and logging it via \
# syslog(8). It can also be used for shutting down the machine when \
# the battery is low.
# processname: apmd
# config: /etc/sysconfig/apmd
# pidfile: /var/run/apmd.pid
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network
PIDFILE=/var/run/apmd.pid
LOCKFILE=/var/lock/subsys/apmd
EXTRAOPTIONS="-W"
# Source config.
SourceIfNotEmpty /etc/sysconfig/apmd
RETVAL=0
start()
{
apm_available || modprobe apm >/dev/null 2>&1
msg_starting $"Advanced Power Management"
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --no-announce --expect-user root -- apmd $EXTRAOPTIONS
RETVAL=$?
return $RETVAL
}
stop()
{
msg_stopping $"Advanced Power Management"
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --no-announce --expect-user root apmd
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload|restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condreload|condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root apmd
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
RETVAL=1
esac
exit $RETVAL