UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have installed apcupsd 3.14.13 on Ubuntu 14.04. I have an APC Back-UPS 550 connected via USB. It *almost* works. When I lose power, it logs the event to /var/log/apcupsd.events and sends an email to the configured $SYSADMIN. I also get a GUI notice, with percent remaining, in Unity. When power is restored I likewise get notices.
However, if the battery does drop below the configured % threshold, there is no notice an no email. It just shuts things down. My computer does not shutdown, but goes to the Ubuntu splash screen with the 5 blinking dots and stays there ... forever; even after the power resumes.
I don't own a UPS (no need with a laptop), but in an effort to assist I installed it and from a quick look under the hood, I note that /etc/apcupsd/apccontrol is the script used to do a bunch of things including shutdown. By default, it uses '/sbin/shutdown -h now' to do this.
Code:
SHUTDOWN=/sbin/shutdown
Code:
doshutdown)
. /etc/sysconfig/apcupsd
if test "$APCUPSD_POWERFAIL_BEHAVIOR" = "hibernate" ; then
echo "UPS ${2} initiated hibernation" | ${WALL}
$HIBERNATE
else
echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
fi
;;
Does your computer shutdown cleanly when this is command is invoked manually?
Does your computer shutdown cleanly when this is command is invoked manually?
Yes, it does shutdown normally when I invoke `shutdown -h now` manually, but good info on the /etc/apcupsd/apccontrol script. Maybe it's running the HIBERNATE option. Something to check.
Excellent links in your 2nd post. These seem very relevant to my issue. Unfortunately, I've returned the UPS to the owner, but I'll bring the laptop in and check it out there on my next trip.
In any case, apcupsd seems to work fine on the production Slackware servers, so far ... I've pulled the plug and received the notifications, but I haven't actually tried the shutdown test yet as these are production, but I'll do that on a test host and report back.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.