Powerdown package for unRAID v5 and v6 (DEPRECATED)


dlandon

Recommended Posts

I installed the apcupsd plugin and then installed the powerdown script that is in unmenu which is 1.0.2.  I'd like to get onto this new version but am totally confused as to how to do that.

 

In looking in /boot/packages I actually see the new version sitting there, but I didn't do that so I guess it's automatic.  How do I get the new version active and working with apcupsd and the old one uninstalled?  I'm guessing I can uninstall the old version via unmenu?

 

Thanks.

Link to comment
  • Replies 678
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I installed the apcupsd plugin and then installed the powerdown script that is in unmenu which is 1.0.2.  I'd like to get onto this new version but am totally confused as to how to do that.

 

In looking in /boot/packages I actually see the new version sitting there, but I didn't do that so I guess it's automatic.  How do I get the new version active and working with apcupsd and the old one uninstalled?  I'm guessing I can uninstall the old version via unmenu?

 

Thanks.

The latest apcupsd plugin already has the latest powerdown script active. No need to install it twice.
Link to comment

I installed the apcupsd plugin and then installed the powerdown script that is in unmenu which is 1.0.2.  I'd like to get onto this new version but am totally confused as to how to do that.

 

In looking in /boot/packages I actually see the new version sitting there, but I didn't do that so I guess it's automatic.  How do I get the new version active and working with apcupsd and the old one uninstalled?  I'm guessing I can uninstall the old version via unmenu?

 

Thanks.

The latest apcupsd plugin already has the latest powerdown script active. No need to install it twice.

 

Crap!  Well, it sure didn't make that clear in unmenu.  So I can safely uninstall 1.0.2 from unmenu then?  And actually, is there a way to uninstall it via command line so I don't have to reboot?  Cause it looks like unmenu can only disable reinstall at boot.  I can't reboot at the moment.

Link to comment

I installed the apcupsd plugin and then installed the powerdown script that is in unmenu which is 1.0.2.  I'd like to get onto this new version but am totally confused as to how to do that.

 

In looking in /boot/packages I actually see the new version sitting there, but I didn't do that so I guess it's automatic.  How do I get the new version active and working with apcupsd and the old one uninstalled?  I'm guessing I can uninstall the old version via unmenu?

 

Thanks.

The latest apcupsd plugin already has the latest powerdown script active. No need to install it twice.

 

Crap!  Well, it sure didn't make that clear in unmenu.  So I can safely uninstall 1.0.2 from unmenu then?  And actually, is there a way to uninstall it via command line so I don't have to reboot?  Cause it looks like unmenu can only disable reinstall at boot.  I can't reboot at the moment.

Which plugin did you install?  You keep talking about unmenu so now I'm confused.  did you install this plugin,  Apcupsd-3.14.10-i486-4_rlw-dl.plg?  From what thread did you download the apcupsd plugin from?
Link to comment

I installed the apcupsd plugin and then installed the powerdown script that is in unmenu which is 1.0.2.  I'd like to get onto this new version but am totally confused as to how to do that.

 

In looking in /boot/packages I actually see the new version sitting there, but I didn't do that so I guess it's automatic.  How do I get the new version active and working with apcupsd and the old one uninstalled?  I'm guessing I can uninstall the old version via unmenu?

 

Thanks.

The latest apcupsd plugin already has the latest powerdown script active. No need to install it twice.

 

Crap!  Well, it sure didn't make that clear in unmenu.  So I can safely uninstall 1.0.2 from unmenu then?  And actually, is there a way to uninstall it via command line so I don't have to reboot?  Cause it looks like unmenu can only disable reinstall at boot.  I can't reboot at the moment.

Which plugin did you install?  You keep talking about unmenu so now I'm confused.  did you install this plugin,  Apcupsd-3.14.10-i486-4_rlw-dl.plg?  From what thread did you download the apcupsd plugin from?

 

Yeah, I'm confused as well.  After I built my box I installed unMenu so I could manage packages/install them.  This is what I thought I was supposed to do.  I added the latest apcupsd (3.14.10), mail and the clean powerdown package since all that was needed for apcupsd (or at least that's what it said).

 

If apcupsd was already setup to use the newer version of powerdown then my addition of it might not have done anything, but I have no idea.  I didn't realize that unMenu was so outdated with things.

 

After a bit I also installed Dynamix, but that shouldn't have anything to do with this.

 

Should I even be using unMenu at this point?  Maybe switch over to control panel or just do command line?  I just need to know what I need to do to have the proper one installed at boot, if it isn't setup to do this already.

Link to comment

The latest version of apcupsd that is installed by unMenu is not the same as the plugin, even though the plugin is installing that version of apcupsd. The plugin also has the latest powerdown. Dynamix also has the latest powerdown, so it might not matter which apcupsd you have. If you will post a syslog we can see exactly what is getting installed.

Link to comment

The latest version of apcupsd that is installed by unMenu is not the same as the plugin, even though the plugin is installing that version of apcupsd. The plugin also has the latest powerdown. Dynamix also has the latest powerdown, so it might not matter which apcupsd you have. If you will post a syslog we can see exactly what is getting installed.

 

Thanks.  I appreciate the help.  I looked at the logs and it shows (I think) the proper powerdown being installed.  So whatever I did must have had no affect whatsoever.  I'm attaching the log so you or others can verify what is getting loaded up, but it all looks correct. 

 

Although I also installed infozip via unMenu since I was getting console errors about it and the logs not getting archived, but I don't see anything in the log about that either.  So I have no idea if it's actually there or not.

 

The apcupsd isn't loading as a plugin that I can see, but it shows it's starting up.  I didn't even realize there was a plugin other than what was in unMenu so if I need to modify my installation at all, please let me know.  Otherwise if everything is OK, then I won't mess with it. :)

 

Thanks again.

syslog.txt

Link to comment

I don't think we can be sure now that I look at it because things that get installed in unMenu are not logged. I can see where Dynamix is installing the new powerdown, but if you have unMenu also installing powerdown that would happen later. I think unMenu Pkg Manager installations actually happen from a line in the go script that calls another script, and the go script runs after the plugins. So unMenu powerdown could be replacing the one Dynamix installed.

 

If you have unMenu installing powerdown you should disable it.

 

In general, I would use plugins for those things that have them and only use unMenu Pkg Manager if there isn't a working plugin for it. There is always the possibility of bugs and conflicts in these things that have been added by the user community, and some might argue that unMenu is more stable, but you will probably have a better chance of getting support for the plugins.

 

Since you seem to have had some confusion about the distinction, plugins will be available as separate downloads with .plg extensions. They typically have their own support thread in the forum. They will usually add a configuration page to the webGUI in Settings for configuration of the plugin.

 

There is also the Control Panel plugin which will download and install some of the more common plugins for you, but I haven't used it.

 

Link to comment

I don't think we can be sure now that I look at it because things that get installed in unMenu are not logged. I can see where Dynamix is installing the new powerdown, but if you have unMenu also installing powerdown that would happen later. I think unMenu Pkg Manager installations actually happen from a line in the go script that calls another script, and the go script runs after the plugins. So unMenu powerdown could be replacing the one Dynamix installed.

 

If you have unMenu installing powerdown you should disable it.

 

In general, I would use plugins for those things that have them and only use unMenu Pkg Manager if there isn't a working plugin for it. There is always the possibility of bugs and conflicts in these things that have been added by the user community, and some might argue that unMenu is more stable, but you will probably have a better chance of getting support for the plugins.

 

Since you seem to have had some confusion about the distinction, plugins will be available as separate downloads with .plg extensions. They typically have their own support thread in the forum. They will usually add a configuration page to the webGUI in Settings for configuration of the plugin.

 

There is also the Control Panel plugin which will download and install some of the more common plugins for you, but I haven't used it.

 

Thanks.  When I setup this box I was using the configuration tutorial which has me use unMenu and I didn't realize the different plugin type until later on.  As soon as I'm able to I'm going to do as you suggest and use plugins for anything that is available.  That will be my first choice from now on!

 

Thanks again for straitening me out on this. 

Link to comment
  • 1 month later...
  • 4 weeks later...

After installing the plugin and creating the K00.sh in /boot/config/plugins/powerdown/rc.unRAID.d with:

[ -f /var/run/xenstored.pid ] && xl shutdown –a -w

 

I am able to halt the system fine, although the power does not go off as it would with a shutdown from the gui. Just wondering if others are experiencing the same.

Running v6b5 with one domU, ubuntu.

Link to comment
  • 2 months later...

Hi guys

 

i had a random case where powerdown caused a parity check afterwards, and i was wondering if there could is someone that could shed some light on the matter?

 

running  powerdown v2.06 on a stock unraid 5.0.5 without dynamix. only "addon" is unmenu, which i can probably stop as well if needed. Dont have any APC packages installed.

 

 

syslog is attached (which was generated by powerdown). Not that the auto_s3_sleep did show all drives was spinned down for 5 minutes before the powerdown was intiated.

 

 

note since its version 5, no VM's / Xen / Dockers etc is running - just a  clean cache drive doing just caching :)

 

thx

 

Regards

 

Neo_x

syslog-20140811-230820.zip

Link to comment

i had a random case where powerdown caused a parity check afterwards, and i was wondering if there could is someone that could shed some light on the matter?

 

running  powerdown v2.06 on a stock unraid 5.0.5 without dynamix. only "addon" is unmenu, which i can probably stop as well if needed. Dont have any APC packages installed.

 

syslog is attached (which was generated by powerdown). Not that the auto_s3_sleep did show all drives was spinned down for 5 minutes before the powerdown was intiated.

 

Just a quick analysis, reviewing the code and relevant scripts might shed more light...

 

Drives appear to all be spun down prior to first powerdown call at 23:05:28.  Side note:  before the system can shut down, they must all be spun up and synced, which can be a potential issue if all other processes don't allow enough time for this.  There appear to be multiple calls to Powerdown, with Powerdown 2.06 announcing itself 3 different times, first at 23:05:28 (little is accomplished here), then again 2.6 minutes later at 23:08:10 (the same little amount is accomplished), then again (called from rc.unRAID this time) at 23:08:12, where the real work of shutting down begins.  Sync is called at 23:08:13, which will begin the spin up of all drives.  Unmounting of the drives begins within seconds, almost too soon I think, and Disk 2 and Disk 3 are unable to unmount, claiming to be 'busy'.  I wonder if 5 seconds was not long enough for them to spin up.  5 seconds *should* be enough for any drive, but old drives, especially old worn drives that need a little longer to calibrate, or drives starting to have mechanical issues may need a few more seconds to spin up.  It would be nice if Powerdown had a mount command here, as well as a loop to check spin up status for all drives, and logged the mount report and spin status info both to the syslog and to the console.

 

At 23:08:20, the last drive is unmounted (but not Disk 2 and Disk 3), and stop is called, then the syslog stops abruptly (too abruptly!) with the message "kernel: md: 2 devices still in use".  I'm almost certain there should have been a few more statements.  We do know that Powerdown saved this syslog to the flash drive, then shut the computer off.  The parity check on next boot tells us that shutdown had not completed, and the flash drive had not been completely updated.

 

Your syslog has the very common statement "FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck".  In a recent post, Thornwood has suggested that servers are being shut down too fast for the flash drive to complete its final writes, and its file system be closed (clean bit written to disk).  I believe he's identified the problem here, and I'll go further and suggest that Powerdown be revised to include a final pause before shutdown, to allow all final writes to complete.  This may resolve this issue for many of us, perhaps all who use Powerdown.

Link to comment

Dlandon would you mind taking a look at this post please. From what Weebotech tells me you have taken over much of the development of power down and I wondered if this does in fact apply to it. RobJ and Thornwood have also mentioned it.

 

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

 

Many thanks

 

Based on the discussion in that thread, I've done a little testing, inserted a sync and pause at the end of the save_syslog function, and so far it appears to have fixed the flash drive write completion problem.  If anyone else wants to test, I've attached rc.unRAID.206a.zip.  Unzip it to your flash drive, and add the line "cp /boot/rc.unRAID.206a /etc/rc.d/rc.unRAID" to your go file (/boot/config/go), and reboot.  It's a temporary replacement for rc.unRAID from Powerdown V2.06, containing a 'sync' and a 'sleep 2' and a few more echoes.

 

If others testing goes well, confirming this fix, I'm hoping that Dan will consider adding it to Powerdown 2.07.  My testing was rather simple-minded, just look for the presence or absence of the syslog statement "FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck", in the syslog after the NEXT boot.  It's possible that this fix may help with other issues too though, where last updates to the flash drive were not completed.

 

Edit:  I don't know that the pause is strictly necessary.  I'm not that proficient with Linux, and don't know if 'sync' just starts the ball rolling and returns immediately, or doesn't return until all sync'ing is done.  If the second, then the pause is probably not needed.

Edit2:  the pause is not needed (but harmless).  Thanks WeeboTech!

Edit3:  adding a more complete set of steps to trying this mod -

Edit4:  add more steps and Check Disk note!

 

Note:  this is from a Windows user's perspective, modify accordingly for Mac or Linux.

Note2:  it's a good idea to save your current go file first, so you can restore it once this mod is no longer needed.

Note3:  run Check Disk (on a Windows machine or the analogous tool on other OS's) on your flash drive, to ensure any file system damage is fixed

1. Download the attachment rc.unRAID.206a.zip

2. Extract the contained file (rc.unRAID.206a) to the root of your flash drive, the same way you extract the bzimage and bzroot files to it.

3. Using your favorite text editor, open for editing your go file.  On the flash drive in Linux, it's /boot/config/go.  From Windows, it should be something like \\Tower\flash\config\go (change Tower to your UnRAID server name).

4. Add the exact line (letter case is important) "cp  /boot/rc.unRAID.206a  /etc/rc.d/rc.unRAID" (without the quotes) to near the bottom of your go file, save the file and exit the editor.

5. Reboot the server

6. Once the server is operational, reboot it again, so that it uses the revised Powerdown.

7. Once the server is operational again, examine the syslog for the line: FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck

rc.unRAID.206a.zip

Link to comment

Sorry I have tried it and its not working for me RobJ. Here is a Screenshot after check the go file again and the script name. I have also included my syslog.

 

Can you confirm that this syslog is after a second reboot?  That is, did you reboot a second time after installing the mod, so that you could obtain a syslog *after* it had run the revised Powerdown?

 

It's a little confusing at the moment, since I only revised one file, and the package still identifies itself as Powerdown 2.06.  I should have created a Powerdown 2.07, but wanted testing, and didn't want to 'intrude' on those currently maintaining it.  And my last instructions were not complete, as to mentioning the need after rebooting to shutdown or reboot again using the revised Powerdown 2.06a, then check the syslog.  I should also mention that it would be good to run Check Disk on the flash drive, to clear up any more serious issues with the flash drive file system.  If it were only a status indicator (a dirty bit), that should be reset by subsequent usage.  But if there was a failed write to a file, then there may be more serious issues to correct.

Link to comment

It was actually after a third reboot as a copy and paste of your go file command put two spaces where I presume from all other Linux commands should have one space. Another user suggested I should run chkdsk on the flash card after installing and rebooting. I will have to get a windows machine to do that on.

Link to comment

It was actually after a third reboot as a copy and paste of your go file command put two spaces where I presume from all other Linux commands should have one space. Another user suggested I should run chkdsk on the flash card after installing and rebooting. I will have to get a windows machine to do that on.

 

I usually put 2 spaces in commands visible in posts, when they might be typed by some instead of using cut-and-paste.  Only one space tends to be almost invisible, and more spaces don't matter.

 

Running Check Disk is a good idea (thanks dgaschk!).  If you are using a Mac, there should be an analogous tool, some sort of fsck for the FAT file system on the flash drive.

Link to comment

I have reinstalled the script RobJ, rebooted twice, shutdown, removed and repaired my Kingston Mobilite G2 with 8GB Sandisk Micro SD card in an SD adapter with Mac OS X Disk Utility and Im still getting the error. It is possible that Disk Utility is not repairing it like chkdsk does but not according to other Mac OS X users. Attached is my KVM screen after the third reboot/restart and my Syslog at this time.

Screen_Shot_2014-08-27_at_08_07.jpg.d20d40cd5c1c187a4f395e80bd240bc6.jpg

syslog.txt

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.