Powerdown package for unRAID v5 and v6 (DEPRECATED)


dlandon

Recommended Posts

Well I think it was the cat.

You are not the first to have this happen, and you will not be the last. Cats love sleeping on warm electronics.

 

Servers should not have exposed power or reset buttons. They need covers, like missile or gun controls on war planes.

I had a better idea. I unplugged the power and reset button headers on the mobo lol. I use the ipmi web gui to turn on and off

Link to comment
  • Replies 678
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Well I think it was the cat. I was on my computer next to my unRaid, he jumps onto the tower and unRaid starts to shutdown as you can hear all the disks spinning up. Wasn't the first of the month and wasn't 3 in the morning, then off it goes.

 

I've covered the power switch to stop him from hitting it. I had uninstalled the power down script and it was still happening.

 

Thanks for the simple but easily missed checks.

I have had more than one occasion to link this post.
Link to comment
  • 2 months later...

Wondering if someone can help me with a behaviour I noticed after setting up a K and S script to mount remote SSHFS shares for my automation setup. I have attached my system log, let

 

Before finding out I could use the powerdown plugin to run script files when the array starts/stops I was manually mounting my remote SSHFS shares each time I started the machine. The SSHFS shares would stay up without issues for weeks until I manually removed them. Now that I have setup a K00 and S00 script I have begun noticing that I randomly seem to be losing some of my SSHFS shares. On Saturday I noticed my automation setup was no longer finding recent downloads and upon checking what was mounted all three of my SSHFS mounts were gone. Then again this afternoon (8/28) I noticed Sonarr wasn't pulling in my downloads and it had just been working about four or five hours ago so I checked mount and sure enough my remote SSHFS share for tv downloads was missing.

 

Now I have no definitive proof that this is being caused by the powerdown plugin, I only have circumstantial guess work based on never having this issue until I created a K00 and S00 script and added them to the powerdown plugin following your instructions. For more information on SSHFS commands I am using check out my post over here: https://lime-technology.com/forum/index.php?topic=50974.msg489503#msg489503

 

I looked through the system log for today and I didn't see the powerdown script initiating the scripts like you normally see, for example:

Aug 25 16:04:26 Node rc.unRAID[13532][13537]: Processing /etc/rc.d/rc.unRAID.d/ start scripts.

Aug 25 16:04:26 Node rc.unRAID[13532][13541]: Running: "/etc/rc.d/rc.unRAID.d/S00.sh"

 

The only odd thing I noticed in the logs from today was apcupsd restarting around 4AM:

Aug 28 04:40:01 Node apcupsd[11573]: apcupsd exiting, signal 15

Aug 28 04:40:01 Node apcupsd[11573]: apcupsd shutdown succeeded

Aug 28 04:40:04 Node apcupsd[3015]: apcupsd 3.14.13 (02 February 2015) slackware startup succeeded

 

but I was using Sonarr long after that and it was all working fine.

 

Here is my K00 script:

#! /bin/bash
umount /mnt/cache/.watch/tv-remote
umount /mnt/cache/.watch/movies
umount /mnt/cache/.watch/music-remote

 

and my S00 script:

#! /bin/bash
sshfs [email protected]:private/deluge/data/couchpotato/ /mnt/cache/.watch/movies/ -o StrictHostKeyChecking=no -o allow_other -o Ciphers=arcfour -o Compression=no -o IdentityFile=/mnt/cache/.watch/PolyphemusAutomationSetup
sshfs [email protected]:private/deluge/data/sonarr/ /mnt/cache/.watch/tv-remote/ -o StrictHostKeyChecking=no -o allow_other -o Ciphers=arcfour -o Compression=no -o IdentityFile=/mnt/cache/.watch/PolyphemusAutomationSetup
sshfs [email protected]:private/deluge/data/headphones/ /mnt/cache/.watch/music-remote/ -o StrictHostKeyChecking=no -o allow_other -o Ciphers=arcfour -o Compression=no -o IdentityFile=/mnt/cache/.watch/PolyphemusAutomationSetup

 

If anyone has any ideas on why this might have started all of a sudden I am all ears.

 

EDIT: Just lost another share about three minutes ago, going to test if my theory is correct by removing the K00 script and seeing if the shares then stay mounted. I renamed K00.sh to KXX.sh and ran the update script command so now to wait and see if my shares stay in place.

 

EDIT2: Alright six days since I removed the K00 script and not a single remote mount has been lost.

node-diagnostics-20160828-1548.zip

Link to comment
  • 2 weeks later...

Powerdown v2.23 is available

 

I took some time to look over the powerdown script on v6.2RC5 in preparation for the release of 6.2 final.  I found that there were several issues that were causing an unclean shutdown.  In 6.1, there were docker and VM events to shutdown Dockers and VMs.  Those events have been removed and the powerdown script has to explicitly shut them down.  The docker.img and libvirt.img image files have to be unmounted.  I also found some issues with the processing of K and S scripts that was a bit messy.  The diagnostics collection and saving to the flash drive was not happening if you used the "reboot" command.

 

Those of you using any pre-release version of 6.2 could have been having issues with the powerdown script because VMs and Dockers were not being shutdown.  I had been having issues with my server not shutting down unless I stopped my VMs first.  I blew past it because I just haven't had any time to devote to unRAID stuff.

 

What happens with a Windows VM when it is not shutdown properly is when the VM is restarted, Windows will log a unexpected shutdown error.  The best way to handle this is to do a check on your disk drive and let Windows repair any issues it finds.  You should then be good to go.

 

I don't know enough about Dockers to know what happens to them when they are not shutdown properly, but my ownCloud Docker would not restart on reboot and I had to start it manually.  It seemed to be just fine after that.

 

If anyone is having issues with the 6.2RC releases, update the powerdown plugin and see if it doesn't help with your issues.  I would go through a reboot cycle after you update just to be sure that the shutdown and reboot comes up clean and Dockers and VMs start properly.

 

Let me know of any shutdown issues you find before 6.2 final is released.

 

This version is compatible with 6.1.9.

Link to comment

Powerdown v2.23 is available

 

I took some time to look over the powerdown script on v6.2RC5 in preparation for the release of 6.2 final.  I found that there were several issues that were causing an unclean shutdown.  In 6.1, there were docker and VM events to shutdown Dockers and VMs.  Those events have been removed and the powerdown script has to explicitly shut them down.  The docker.img and libvirt.img image files have to be unmounted.  I also found some issues with the processing of K and S scripts that was a bit messy.  The diagnostics collection and saving to the flash drive was not happening if you used the "reboot" command.

 

Those of you using any pre-release version of 6.2 could have been having issues with the powerdown script because VMs and Dockers were not being shutdown.  I had been having issues with my server not shutting down unless I stopped my VMs first.  I blew past it because I just haven't had any time to devote to unRAID stuff.

 

What happens with a Windows VM when it is not shutdown properly is when the VM is restarted, Windows will log a unexpected shutdown error.  The best way to handle this is to do a check on your disk drive and let Windows repair any issues it finds.  You should then be good to go.

 

I don't know enough about Dockers to know what happens to them when they are not shutdown properly, but my ownCloud Docker would not restart on reboot and I had to start it manually.  It seemed to be just fine after that.

 

If anyone is having issues with the 6.2RC releases, update the powerdown plugin and see if it doesn't help with your issues.  I would go through a reboot cycle after you update just to be sure that the shutdown and reboot comes up clean and Dockers and VMs start properly.

 

Let me know of any shutdown issues you find before 6.2 final is released.

 

This version is compatible with 6.1.9.

Could the K & S script processing issues you cleaned up solve the issue I posted here (the post right above yours)? I had to disable my K script because it seemed to be arbitrarily removing my sshfs mounts.

 

If you aren't sure I will try the new version on my test box first and see how it behaves. I have added the remote mounts on my test box and enabled my K00.sh and S00.sh scripts, now we wait.

Link to comment

In light of your plans to deprecate the powerdown plugin, I just wanted to comment on one feature, apparently minor to most but has long been one of my favorite and most used features of powerdown - the hooking of the CtlAltDel key combo to initiate powerdown.  I've used it a long long time, as often the easiest way to shut the server down quickly, perhaps because of nearby lightning.  It's not quite as important now that we have the System Buttons plugin, a one button shut down, but I still use it often when I don't have an unRAID screen up anywhere.

 

I suppose one alternative to consider would be moving the 2 lines that hook the key combo to the Tips and Tweaks plugin?  Does that sound like something you might be interested in doing?  Otherwise, I think I could do it in my go file.

 

A question, is the current Powerdown the function that is limiting how many diagnostics zip files are being saved, or is that something that unRAID is doing on shut down?  I'd like to adjust the number saved to a somewhat higher number.  Looks like it is only keeping the last 3, and I'd prefer 10.

Link to comment

In light of your plans to deprecate the powerdown plugin, I just wanted to comment on one feature, apparently minor to most but has long been one of my favorite and most used features of powerdown - the hooking of the CtlAltDel key combo to initiate powerdown.  I've used it a long long time, as often the easiest way to shut the server down quickly, perhaps because of nearby lightning.  It's not quite as important now that we have the System Buttons plugin, a one button shut down, but I still use it often when I don't have an unRAID screen up anywhere.

 

I suppose one alternative to consider would be moving the 2 lines that hook the key combo to the Tips and Tweaks plugin?  Does that sound like something you might be interested in doing?  Otherwise, I think I could do it in my go file.

 

A question, is the current Powerdown the function that is limiting how many diagnostics zip files are being saved, or is that something that unRAID is doing on shut down?  I'd like to adjust the number saved to a somewhat higher number.  Looks like it is only keeping the last 3, and I'd prefer 10.

 

I will collect some ideas from users and will consider adding some things like the CtrlAltDel from the powerdown plugin to the Tips and Tweaks plugin.

 

The log archive saving was in powerdown.  unRAID saves one log on the flash drive.

Link to comment

Hi just chasing some confirmation, I justed updated to v6.2 and the powerdown plugin failed. Went to install again and it says it is not need for v6.2 and above.

 

Is this correct? If so, can I still shutdown unRaid the same way as the powerdown plugin would?

 

Thanks

 

The best way to shutdown, reboot, etc is through the webgui.

 

cli

- 'reboot' - to reboot the server.

- 'powerdown' - shutdown the server completely.

 

Press power button quickly.

Link to comment

Hi just chasing some confirmation, I justed updated to v6.2 and the powerdown plugin failed. Went to install again and it says it is not need for v6.2 and above.

Yes its all correct.

 

And within CA's installed apps it will show as being Incompatible, and will not get offered up if not installed to 6.2 users

 

FCP if installed will also send out an error notification if its still installed under 6.2, and will only suggest that it should be installed under 6.1.x

Link to comment

Thanks for the info.

 

It's nice to see this stuff finally being baked in to Unraid.

Now what about unassigned devices next?? ;)

 

It's not that the powerdown plugin functionality has been baked in, it's just that LT has improved the shutdown process and it should not hang as in previous versions.

 

I don't see UD going away anytime soon.

Link to comment

Thanks for the info.

 

It's nice to see this stuff finally being baked in to Unraid.

Now what about unassigned devices next?? ;)

 

It's not that the powerdown plugin functionality has been baked in, it's just that LT has improved the shutdown process and it should not hang as in previous versions.

 

I don't see UD going away anytime soon.

 

Thanks for your hard work maintaining these plugins mate.

Link to comment

... I've used it a long long time, as often the easiest way to shut the server down quickly...

 

... It's not quite as important now that we have the System Buttons plugin, a one button shut down, but I still use it often when I don't have an unRAID screen up anywhere.

 

There's a very easy way to have a simple desktop icon that you can double-click to shut down your server ...

 

(a)  Download Plink (a command line version of Putty) and put it in a convenient folder [e.g. D:\Downloads\Putty]

The download is available here:  http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

 

(b)  Create a folder for the appropriate command file.  I have a "Utilities" folder in Program Files (x86), but any location will do.

 

©  Create a "Shut Down Server X" .CMD file  [e.g. ShutDownUnRAIDX.cmd] and put it in that folder.

The contents should be the following (assuming the password for root is rootpw, and the server name is UnRAIDX -- clearly you should change these to your actual password and server name):

 

D:\Downloads\Putty\Plink.exe -ssh -pw rootpw root@UnRAIDX powerdown

 

(d)  Now simply create a shortcut on your desktop to the command file ... e.g. "Turn off UnRAIDX" that points to the actual command file:  "C:\Program Files (x86)\Utilities\ShutDownUnRAIDX.cmd"    You can set the properties of this to run minimized, and you will barely notice it -- an icon will appear for a couple seconds on the taskbar and then disappear ... and your server will shut down.

 

Link to comment

Powerdown will not install on v6.2 any more.  I've added the <MaxVer> tag to 6.1 so CA will no longer show it as a plugin to install.

 

It is no longer necessary.

 

I have to admit I'm very troubled by this, and I suspect it was a rushed decision, not enough time to think it through.  I'm positive you didn't intend this, but the effect is that since you no longer need the powerdown plugin, and may no longer have the time or interest in maintaining it, you have decided that no one else needs it either or its other functionality, and will block everyone from using it!  I don't mean any disrespect here, just asking you to reconsider, reconsider blocking all further usage.  I don't understand why it has to be blocked.

 

A little history -

* 'Once upon a time', 2007 or 2008 I think, Joe L created some code for safely stopping the array when you couldn't get to the management screen, and in further conversations, we discussed making a more complete script for shutting down the array, and called it powerdown.

* WeeboTech created a nice script, and I suggested also saving the syslog.  WeeboTech then added options for saving dated syslogs to optional locations, and made the script more robust, blocking recursive calls, handling more edge cases, killing obstructing PID's, hooking the power button (we didn't used to have that), and hooking the CtlAltDel key combo.  I took that and modified the date handling to my own preference and used it for many years, before finally cleaning out my go file and switching to the plugin.

* Over time, WeeboTech and possibly others tweaked it as needed, and transformed it into a plugin.

* Then it languished for quite awhile I believe, did the job well, and didn't need any help.  It was considered a community plugin.

* As I recall, the v6 betas required some changes though, and finally you Dan stepped up and made the needed changes!  And we all really appreciate the work you've done!

* Since then you have continued tweaking as necessary, and added a few features too.  But at least in the syslog, it still looks much like it always did as a community plugin.

 

And now you want to shut it down!  Including blocking all of the other functionality included in powerdown.  I'm positive you didn't intend to be mean in this, just made a snap decision without thinking.  What everyone would have completely understood is a statement something like -

  "Now that the built in powerdown function has all the functionality I need, and because I no longer have the time and interest to continue this effort, I'm stepping away from it.  If anyone else would like to take it over, please do."  And then leave it intact as is, for a smooth transition (*especially* right now during the 6.2 upgrade!  Your timing is really bad!).

 

I completely understand feeling like that, and fully respect it, and while I would be disappointed, I would hope someone else volunteers to carry it on, *and* we would still have it running just as it is.  I want to run the best powerdown function possible, and right now, it still is the best!  I personally never needed the "won't hang on emhttp" part that you and others needed, and as far as I know have never used it.  I use powerdown for other things, among them CtlAltDel and diagnostics archiving.  I do understand that some day, all of its functionality will be baked in or available elsewhere, but it isn't there yet.

 

You yourself have said:

The powerdown plugin offers some advantages such as K and S script processing on shutdown and start up ..., more extensive shutdown logging, and archiving of logs.

Plus some other features (admittedly some of which are rarely used).  Is there any reason why it can't continue as it is, without you?  Or could you have cut out the duplicated parts and just called the built in for them, but left the plugin with the rest of its functionality?  (Or leave that for another person.)

Link to comment

Definitely agree with Rob's comments.

 

In thinking about this, the nice little shortcuts I have that shut down my servers (described in my post just above Robs) that use PLinki call Powerdown to work.

 

PowerDown certainly seems to work perfectly in 6.2 => at least it shuts down my server with no problem.  But if I understand what you're saying, it will no longer install if I was to reload UnRAID.    This is VERY unfortunate ... it's a VERY nice feature.

 

The two things I use are (a) primarily the direct shutdown via PLink that I outlined above; and (b) until I had those shortcuts, the power button.

 

Like Rob, I can understand if you simply don't have the time/inclination to support this anymore; but I see no reason to halt it from being installed for those who do want to use it.    Please reconsider that.

 

Link to comment

... a couple of questions to be sure I understand just what might be lost without this script.  If running v6.2 without PowerDown:

 

(a)  Is the power button still "hooked" to the shutdown process?  i.e. will pressing the power button result in a clean shutdown of UnRAID ?

 

(b)  Is the built-in script also named "Powerdown" ??  i.e. would my PLink command still shut down the server ?

 

If the answers to both of those are Yes, then at least from my perspective I'd agree PowerDown is no longer required => but I still don't see any reason to preclude its installation.

 

One more question:  Will the script still install in v5 and v6.1.9 ?

 

Link to comment

There's a very easy way to have a simple desktop icon that you can double-click to shut down your server ...

 

(a)  Download Plink (a command line version of Putty) and put it in a convenient folder [e.g. D:\Downloads\Putty]

The download is available here:  http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

 

(b)  Create a folder for the appropriate command file.  I have a "Utilities" folder in Program Files (x86), but any location will do.

 

©  Create a "Shut Down Server X" .CMD file  [e.g. ShutDownUnRAIDX.cmd] and put it in that folder.

The contents should be the following (assuming the password for root is rootpw, and the server name is UnRAIDX -- clearly you should change these to your actual password and server name):

 

D:\Downloads\Putty\Plink.exe -ssh -pw rootpw root@UnRAIDX powerdown

 

(d)  Now simply create a shortcut on your desktop to the command file ... e.g. "Turn off UnRAIDX" that points to the actual command file:  "C:\Program Files (x86)\Utilities\ShutDownUnRAIDX.cmd"    You can set the properties of this to run minimized, and you will barely notice it -- an icon will appear for a couple seconds on the taskbar and then disappear ... and your server will shut down.

 

That's great advice, and I used to have something comparable on my Windows desktop.  Yours is greatly modernized of course.  I used a tiny Windows tool tst10.exe (short for Telnet Scripting Tool) and created a shortcut calling it with a tiny script that logged in and ran 'powerdown'.  I believe it was written up in some of our oldest wiki pages.  I or you should probably write yours up, as a HowTo, because as you noted, it's still the easiest method in certain situations.

 

For me now, it's just so easy to lean to the right a little bit, reach over, and click the Ctrl, Alt, and Del keys, that I don't even bother with any other choice but the System Buttons.

Link to comment

... For me now, it's just so easy to lean to the right a little bit, reach over, and click the Ctrl, Alt, and Del keys, that I don't even bother with any other choice but the System Buttons.

 

Understand.  In my case, 3 of my 4 servers are in another room, and all share a single keyboard and display (via KVM), so it's not nearly as convenient to do that => MUCH simpler to just double-click an icon on my desktop.  My 4th server is indeed in my office, but it's 6-ft away => so again it's simpler to just double-click an icon  :)

 

I've also got the one-line shutdown script embedded in a few scheduled tasks => i.e. once/week a script turns on my two primary servers and the backup server; runs a backup script (using SyncBack) to back everything up; and then turns off the servers.

 

Do you by chance know the answer to question (b) above?

Link to comment

In light of your plans to deprecate the powerdown plugin, I just wanted to comment on one feature, apparently minor to most but has long been one of my favorite and most used features of powerdown - the hooking of the CtlAltDel key combo to initiate powerdown.  I've used it a long long time, as often the easiest way to shut the server down quickly, perhaps because of nearby lightning.  It's not quite as important now that we have the System Buttons plugin, a one button shut down, but I still use it often when I don't have an unRAID screen up anywhere.

 

I suppose one alternative to consider would be moving the 2 lines that hook the key combo to the Tips and Tweaks plugin?  Does that sound like something you might be interested in doing?  Otherwise, I think I could do it in my go file.

 

A question, is the current Powerdown the function that is limiting how many diagnostics zip files are being saved, or is that something that unRAID is doing on shut down?  I'd like to adjust the number saved to a somewhat higher number.  Looks like it is only keeping the last 3, and I'd prefer 10.

 

I will collect some ideas from users and will consider adding some things like the CtrlAltDel from the powerdown plugin to the Tips and Tweaks plugin.

 

The log archive saving was in powerdown.  unRAID saves one log on the flash drive.

 

I've added an option in the Tips and Tweaks plugin to save a diagnostics and archive logs on shutdown.  It also adds back the Ctrl-Alt-Del shutdown functionality.

Link to comment

... a couple of questions to be sure I understand just what might be lost without this script.  If running v6.2 without PowerDown:

 

(a)  Is the power button still "hooked" to the shutdown process?  i.e. will pressing the power button result in a clean shutdown of UnRAID ?

Sorry, forgot about this!  The power button is supposed to call whichever powerdown is currently present.  It's my understanding that that has worked for quite a few versions, but I can't personally vouch for it.  I wouldn't expect that to have changed though.

 

(b)  Is the built-in script also named "Powerdown" ??  i.e. would my PLink command still shut down the server ?

The command for both Powerdowns is powerdown (all lowercase), so it's supposed to be almost interchangeable.  Again, I can't personally vouch for it.

Link to comment

... a couple of questions to be sure I understand just what might be lost without this script.  If running v6.2 without PowerDown:

 

(a)  Is the power button still "hooked" to the shutdown process?  i.e. will pressing the power button result in a clean shutdown of UnRAID ?

Sorry, forgot about this!  The power button is supposed to call whichever powerdown is currently present.  It's my understanding that that has worked for quite a few versions, but I can't personally vouch for it.  I wouldn't expect that to have changed though.

 

(b)  Is the built-in script also named "Powerdown" ??  i.e. would my PLink command still shut down the server ?

The command for both Powerdowns is powerdown (all lowercase), so it's supposed to be almost interchangeable.  Again, I can't personally vouch for it.

 

Thanks.  That's good to know.  I'll test that to confirm my little PLink utility still works okay with the plugin removed.    As long as that's the case, I really don't have an issue with the lack of availability of the plugin -- but I do hate to see a "trusted old friend" no longer available  :)

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.