Gracefully Powering Off System In Case Of Power Failure

Home » CentOS » Gracefully Powering Off System In Case Of Power Failure
CentOS 10 Comments

Hi

I am using the system as shown below.

*********************************
[root@localhost sbin]# cat /etc/*release LSB_VERSION

10 thoughts on - Gracefully Powering Off System In Case Of Power Failure

  • <>

    use what is already packaged for CentOS:

    apcupsd – apc ups
    http://www.apcupsd.com or
    nut – network ups tools
    http://www.networkupstools.org/

    apcupsd is designed to run with apc brand ups.

    nut is designed to run with apc and other brands.

    both monitor ups and will shut system down via shutdown command.

    i use apcupsd on my system with an apc back-ups rs 800 and have never had problems.

    during a 5 day power outage, i had change config so i could run system when i used a gas powered generator to supply mains and voltage would drop to a low of around 90 v.

    hth.

  • yeah, they have their own support forums and stuff.

    if your UPS is on this list, http://www.networkupstools.org/stable-hcl.html install NUT (Network UPS Tools), available from the EPEL repository,
    and configure it to talk to your UPS.

    NUT documentation:
    http://www.networkupstools.org/docs/user-manual.chunked/index.html

    that is advise for a tinylinux embedded system, not a EL 6 system.
    IMHO, you should never muck about with /etc/inittab on CentOS/rhel

    I hope you restored your inittab to its original state.

  • does `init 0` as a root command cause it to gracefully shut down and power off ? thats all the ACPI support you need.

    what brand/model UPS (battery backup) do you have ? the UPS software, apcupsd and/or NUT, needs to listen to the UPS to tell it when the power has failed, then it can tell your OS to shutdown after a suitable delay
    (if your UPS is good for 30 minutes, you might not want to shut down until the power has failed for 15 minutes, so brief outages don’t cause a shutdown)

  • [Jatin] Yes, init 0 does gracefully shutdown the server and power off.
    [Jatin] I am still reading through the documentation of my server to find out the battery backup in it. Is there any command within the OS
    that i can use to find out this information ?

  • I’ve never heard of a UPS built into a server, every one I’ve ever seen has been external… the mains power cable(s) for the server are plugged into the UPS. The UPS communications can be over ethernet, or USB, or serial signaling cable, depending on what sort of UPS. for an example, in my lab, each of my two racks has a pair of 7KVA UPS’s in the bottom of the rack. these UPS’s also have network cards, and are plugged into my management LAN. for my servers to talk to these UPS’s, I need to know the IP address that the UPS is configured for.

  • I dont seem to have a battery in my server.

    **********************************
    [root@node-103 ~]# ls /proc/acpi/battery/
    [root@node-103 ~]#
    **********************************

    Thanks Jatin

  • No , i was referring to the battery backup unit within the server. Since the server was installed by someone else across geographies i am not aware of its details. I have found that the server does not have a battery backup unit as seen from the output below:

    **********************************
    [root@node-103 ~]# ls /proc/acpi/battery/
    [root@node-103 ~]#
    **********************************

    As of the UPS connectivity over LAN , I dont think this is done for the server that i am using currently.

    Thanks Jatin

  • This sounds like it might actually be a battery backup unit (BBU) for the RAID card in the server. This is common but different to a UPS. What the BBU does is backup the volatile RAM for the RAID write cache so you don’t end up corrupting your RAID in the event of a power failure during a write, the write can then be completed from the cache once power is restored. This cannot be used to keep the server running for any length of time or gracefully shutdown the server in the event of a power failure, it simply protects the write cache on your RAID.

    Peter