Jump to content

SOLVED: Clean Powerdown using Power Button


rdenney

Recommended Posts

(I'm using 5.0-rc8a.)

 

Joe L. included a detailed description of this issue in this post:

 

http://lime-technology.com/forum/index.php?topic=2068.msg82590#msg82590

 

When I look at unMENU package installer, I see that the "Clean Powerdown" package is shown as "Currently installed. Will NOT be reinstalled upon reboot."

 

I installed the Clean Powerdown feature apparently while installing the APCUPSD package, which I installed using a newer procedure that I found in a recent thread that I cannot now recall. (I have installed APCUPSD version 3.14.10, rather than 3.14.8 shown in the unMENU package installer.) UnMENU reports that APCUPSD is "Installed. Not downloaded." The APCUPSD service is shown in the Simple Features version of the regular web GUI, and it shows what portion of the relevant information that is supplied by my cheapie APC Back-UPS.

 

These messages persist after reboots, so I'm given to believe that the Clean Powerdown feature remains installed. My suspicion is that the Clean Powerdown feature is not installed in a way that unMENU recognizes when its package installer checks for it. Is that the case? Is there a way to know for sure?

 

And, given the answer to that, are Joe's instructions for linking the power button service to the Powerdown feature in that old post from 2010 still valid, given that some newer version of Clean Powerdown might be installed? Given the inclusion of many features into the later release candidates, it's a little hard to know which unMENU packages are now built in or otherwise superseded by events.

 

Rick "who would like the power button to do its job, but can already do a clean powerdown using Cntrl-Alt-Del" Denney

Link to comment

Okay, more exploration.

 

In another thread, Joe mentioned that the following should be done when installing the clean power down in the go script:

 

CTRLALTDEL=yes installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz
[ -f /usr/local/sbin/powerdown ] && mv /usr/local/sbin/powerdown /usr/local/sbin/unraid_powerdown
[ -f /usr/local/sbin/unraid_powerdown ] && sed -i "sX/usr/local/sbin/powerdownX/sbin/powerdownX" /etc/acpi/acpi_handler.sh
[ ! -f /usr/local/sbin/unraid_powerdown ] && sed -i "sX/sbin/init 0X/sbin/powerdownX" /etc/acpi/acpi_handler.sh
sysctl -w kernel.poweroff_cmd=/sbin/powerdown

 

He explained that the next-to-last of these changed the ACPI_handler script to replace an "init" command with a "powerdown" command, and the previous lines were used to replace the unRAID-supplied powerdown (which is renamed "unraid_powerdown") with a clean powerdown.

 

After a fresh reboot, I have looked in /etc/acpi/acpi_handler.sh and found where the change he described was made. And I see "unraid_powerdown" in /usr/local/sbin. UnMENU reports the clean powerdown is installed, and before rebooting I set it to automatically reinstall on boot.

 

I don't see where the final sysctl command is issued, but I suspect that is in an install package somewhere, perhaps for APCUPSD.

 

I think the next step is to press the power button and see what happens.

 

Rick "film at 11" Denney

Link to comment

Look here for how most of this ties together.

http://lime-technology.com/forum/index.php?topic=6078.0

 

unMENU will say the clean powerdown is installed if /sbin/powerdown exists, regardless of how you installed it in combination with APCUPSD as part of a plugin.  If you elected for unMENU to re-install a pacage on reboot, it will create a package-name.auto_install script under /boot/packages.  If it does not exist, unMENU will tell you it will NOT be re-installed on reboot.  If you are installing it with an alternate script or command, or plugin, then it will not be telling you the entire truth.  unMENU might not re-install the package on reboot, but something else might.

 

unMENU existed way before plugins, and you are now faced with the ability to load add-ons in multiple ways as the same features are migrated to the new plugin system in the 5.X series of unRAID..  I would say most unMENU installs are more complete and proven than some others developed more recently, although they are getting better.  Basically, most are building on the work I originally did.

 

The link above will let you discover what happens when you press the power button.  Follow its steps and you'll learn for yourself.  To keep from having to endure a parity check if something is not as expected, stop the array prior to pressing the power-button when doing your tests.

 

Joe L.

 

Link to comment

Thank you--that description (and the thread you linked) was what I was hoping to learn before I started guessing and pushing buttons. I was able to test all the elements and be sure I had addressed all your "maybes".

 

I have no data on the drives as yet, so there was no harm in conducting a bit of dangerous testing to make sure.

 

I pressed the power switch. Sure enough, it appeared to go through the clean powerdown, and a check of the log that it saved in the process confirms it.

 

I then tested the UPS. APSUPSD only reports battery charge, time left, and load percentage realistically when the status is ON BATTERY, but the numbers I saw then were completely plausible. And after 300 seconds, it did an orderly shutdown. This time, the log announced the power failure, and 300 seconds later the log started to look identical to the log created when I pushed the power button.

 

Rick "very close to putting this in production" Denney

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...