[Nut-upsuser] cyberpower ups need to manully turn on the switch
Min Wang
mingewang at gmail.com
Mon May 9 02:42:48 UTC 2016
Hi
centos 6.3 uses traditional SysV script ( not systemctl)
here is the /etc/init.d/ups ( script) assuming it similar to nutshutdown
# more /etc/init.d/ups
#! /bin/bash
#
# ups: Starts the Network UPS Tools
#
# chkconfig: - 26 74
# description: Network UPS Tools is a collection of programs which provide
a common \
# interface for monitoring and administering UPS hardware.
# processname: upsd
# config: /etc/ups/
# config: /etc/sysconfig/ups
#
### BEGIN INIT INFO
# Provides: ups
# Required-Start: $syslog $network $named
# Required-Stop: $local_fs
# Default-Stop: 0 1 6
# Short-Description: Starts the Network UPS tools
# Description: Network UPS Tools is a collection of programs which provide
a common \
# interface for monitoring and administering UPS hardware.
### END INIT INFO
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Get config.
if [ -f /etc/sysconfig/ups ]; then
. /etc/sysconfig/ups
else
SERVER="no"
fi
start() {
if [ "$SERVER" = "yes" ]; then
echo -n $"Starting UPS driver controller: "
daemon /sbin/upsdrvctl start > /dev/null 2>&1 && success || failure
RETVAL=$?
echo
prog="upsd"
echo -n $"Starting $prog: "
daemon /usr/sbin/upsd $UPSD_OPTIONS > /dev/null 2>&1 && success || failure
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
echo
echo -n $"Starting UPS monitor (master): "
daemon /usr/sbin/upsmon > /dev/null 2>&1 && success || failure
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
echo
else
echo -n $"Starting UPS monitor (slave): "
daemon /usr/sbin/upsmon > /dev/null 2>&1 && success || failure
RETVAL=$?
echo
fi
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/ups
}
stop() {
echo -n $"Stopping UPS monitor: "
killproc upsmon
RETVAL=$?
echo
if [ "$SERVER" = "yes" ]; then
prog="upsd"
echo -n $"Stopping $prog: "
killproc upsd > /dev/null 2>&1 && success || failure
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
echo
echo -n $"Shutting down upsdrvctl: "
/sbin/upsdrvctl stop > /dev/null 2>&1 && success || failure
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
echo
fi
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ups
}
restart() {
stop
start
}
reload() {
# FIXME: upsd and upsmon always return 0
# => can't tell if reload was successful
if [ "$SERVER" = "yes" ]; then
action "Reloading upsd:" /usr/sbin/upsd -c reload
RETVAL=$?
fi
action "Reloading upsmon:" /usr/sbin/upsmon -c reload
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
}
# See how we are called.
case "$1" in
start)
start ;;
stop)
stop ;;
restart)
restart ;;
try-restart)
[ -f /var/lock/subsys/ups ] && restart || :
;;
reload)
reload ;;
force-reload)
restart ;;
status)
if [ "$SERVER" = "yes" ]; then
status upsd
fi
status upsmon
;;
*)
echo $"Usage: $0
{start|stop|restart|try-restart|reload|force-reload|status}"
RETVAL=3
esac
exit $RETVAL
min
On Sun, May 8, 2016 at 3:16 AM, Roger Price <roger at rogerprice.org> wrote:
> On Sat, 7 May 2016, Min Wang wrote:
>
> I am using centos 6.3, and nut-2.6.5-2.el6.x86_64.
>> could you explain why not sending "a delayed command to the UPS to turn
>> it off" may cause that issue?
>>
>
> You need to stop the UPS from beeping. Only then can you get a clear
> restart when power returns. To stop the UPS from beeping, you must turn it
> off.
>
> ups.delay.shutdown: 20
>> ups.delay.start: 30
>>
>> is it something related?
>>
>
> Yes, they are related: the two ups.delay values are used by the program
> which turns off the UPS. This program is called by by script nutshutdown
> which is part of the nut package. Do you have this script installed?
>
> What does command "systemctl status nutshutdown" report?
>
> Roger
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
>
--
http://www.comrite.com
Yellow pages, Ads and Search
http://www.meidongnet.com
News, Ads, Free Online dating, Games for Chinese Community in NY, NJ, PA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20160508/f6e6e104/attachment.html>
More information about the Nut-upsuser
mailing list