Results 1 to 7 of 7

Thread: apcupsd not waking suspended server when battery loses charge

  1. #1
    Join Date
    Apr 2006
    Location
    Sweden
    Beans
    420
    Distro
    Xubuntu 13.04 Raring Ringtail

    apcupsd not waking suspended server when battery loses charge

    Running Ubuntu server 13.04, with APC500ES connected using USB cable.

    apcupsd works fine when server is up and running. As soon as battery is almost drained, it shuts down server.

    However, I want to pm-suspend my server and only wake it when needed. When I lose power during pm-suspend, and battery gets drained, server simply loses power, triggering an (EXT4-fs] recovery on next boot according to dmesg.

    My concern is corrupt filesystems, and I have a RAID-0 plus a RAID-1 array that I do not want to suffer during powerloss.

    Anyone know if apcupsd can be configured to wake up server to be able to do clean shutdown before battery is fully drained?

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,604
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: apcupsd not waking suspended server when battery loses charge

    Take a look at the apccontrol script. It allows you to customize how various events are handled. You might need to write a small shell to do what you want. I think all you need to do is point the SHUTDOWN environment variable to your script rather than having it run /sbin/shutdown as it does by default.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: apcupsd not waking suspended server when battery loses charge

    Quote Originally Posted by SeijiSensei View Post
    Take a look at the apccontrol script. It allows you to customize how various events are handled. You might need to write a small shell to do what you want. I think all you need to do is point the SHUTDOWN environment variable to your script rather than having it run /sbin/shutdown as it does by default.
    That should do it. I thought there was a setting that allowed the machine to turn back on after the battery was sufficiently charged.

    EDIT: With that being said, I think it would be a better idea to have the machine power off entirely, then turn back on after the battery is sufficiently charged. This might help:
    http://askubuntu.com/questions/37097...-power-is-back
    Last edited by CharlesA; July 1st, 2013 at 04:04 PM. Reason: added extra thought
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  4. #4
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,078
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: apcupsd not waking suspended server when battery loses charge

    I believe the OP is saying that the computer is in pm-suspend state when it loses power and the APC takes over. He wants the computer to "wakeup" when the power is lost to power down, and then wakeup when power is restored. Frankly, if power is that much of an issue, I'd rather have my computer be either off or on so that apcupsd can safely shut it down (especially with a RAID0 array involved). I'd leave it off when you aren't using it, and consider wake on LAN to wake the computer up when it's needed.

  5. #5
    Join Date
    Apr 2006
    Location
    Sweden
    Beans
    420
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: apcupsd not waking suspended server when battery loses charge

    Thanks rubylaser (you understood my request). I sort of suspected this. I use Wake On LAN/WAN from my mobile phone, which works great, so that is not an issue. I'll have to reconfigure my BIOS to stop it turning on automatically every morning.

    But having said that, really, I'm kind of surprised that apcupsd doesn't take this into account automatically. Looks like a feature request needs to be sent off.

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: apcupsd not waking suspended server when battery loses charge

    Quote Originally Posted by finite9 View Post
    Thanks rubylaser (you understood my request). I sort of suspected this. I use Wake On LAN/WAN from my mobile phone, which works great, so that is not an issue. I'll have to reconfigure my BIOS to stop it turning on automatically every morning.

    But having said that, really, I'm kind of surprised that apcupsd doesn't take this into account automatically. Looks like a feature request needs to be sent off.
    You could try their mailing lists: http://www.apcupsd.com/

    But their last stable release was back in 2011, so I dunno if they would even be able to implement this.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,604
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: apcupsd not waking suspended server when battery loses charge

    I think they'd probably suggest you handle this by writing a script to do what you want as I suggested before.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •