Powerdown package for unRAID v5 and v6 (DEPRECATED)


dlandon

Recommended Posts

Quick question: is is possible to shut down a remote unRAID server (Backup Server) by using the Powerdown package? I would like to add it to my rsync script to shut down the machine after the backup is complete. Thank you.

If you want to shut down the server at the completion of your rsync script, just add 'powerdown' to the end of the script.

 

If you meant you want to remotely shut the server down, there are tools that can open a Telnet or SSH session, and send the powerdown command.  One of the oldest is TST10 (search that), the Telnet Scripting Tool.  There are newer and more secure ways too, but I'm not familiar with them.

Link to comment
  • 4 weeks later...
  • Replies 678
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hello. I have a problem with this plugin in my unraid 6.1.6: it won't shutdown: it get stuck at INIT: no more processes left in this runlevel. I tried turning off all my apps but it still doesn't work. If I first stop the array it will turn off properly.

These are the apps and plugin that I have installed:

- CouchPotato

- Transmission

- Plex

- DDClient

- A Windows 10 VM

- Powerdown Package 2.18

- Dynamix Sys Stats, Temp, Info, Button, S3 Sleep.

 

Thanks.

(Sorry If I made any language mistake but I'm Italian)

 

Link to comment

Firstly let me apologise if this issue has been raised before already.

 

I also have unassigned devices plugin installed to access another nas through SMB. Whenever I try to powerdown the unraid server the whole shutting down process hangs. I have tried both through the gui and through the console (shutdown -now). When I unmount the remote drives there is no problem. Is this an issue with the powerdown plugin? Is there any way for powerdown to automatically unmount remote drives before going through the shutdown process? My concern is that the process hangs also when there is a power cut. The UPS plugin of unraid undestands that there is a power cut and gives the command for the server to shut down, but the process hangs.

 

Thank you very much

Link to comment

Firstly let me apologise if this issue has been raised before already.

 

I also have unassigned devices plugin installed to access another nas through SMB. Whenever I try to powerdown the unraid server the whole shutting down process hangs. I have tried both through the gui and through the console (shutdown -now). When I unmount the remote drives there is no problem. Is this an issue with the powerdown plugin? Is there any way for powerdown to automatically unmount remote drives before going through the shutdown process? My concern is that the process hangs also when there is a power cut. The UPS plugin of unraid undestands that there is a power cut and gives the command for the server to shut down, but the process hangs.

 

Thank you very much

 

It is the responsibility of unassigned devices to unmount the remote drives, not powerdown.

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

There was some discussion about capturing logs on power down over in a thread I started:

 

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

 

It seems that while my intentions were good, the majority of users that replied saw the capturing of a diagnostics file was better placed in this plugin - seemingly after the press of the Power Button.

 

If I am correct, could this be as simple as adding:

 

/usr/local/sbin/diagnostics

 

to the code which is executed when the Power Button Press event is captured?

Link to comment

There was some discussion about capturing logs on power down over in a thread I started:

 

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

 

I looked over the thread.

 

It seems that while my intentions were good, the majority of users that replied saw the capturing of a diagnostics file was better placed in this plugin - seemingly after the press of the Power Button.

 

Since powerdown captures shutdown events, it probably does make sense.

 

If I am correct, could this be as simple as adding:

 

/usr/local/sbin/diagnostics

 

to the code which is executed when the Power Button Press event is captured?

 

Yes. I just need to consider where in the process it makes sense to do this and if the diagnostics script will run if the system is hung.  I haven't worked with the diagnostics script so I am not sure how it works or its dependencies.

 

Tell me more about what you are concerned about.  I sense it is that you want diagnostics if unraid does not respond to the web interface or a telnet or ssh session cannot be started and you want the diagnostics to troubleshoot the problem.

 

Does this happen a lot?

Link to comment

There was some discussion about capturing logs on power down over in a thread I started:

 

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

 

I looked over the thread.

 

It seems that while my intentions were good, the majority of users that replied saw the capturing of a diagnostics file was better placed in this plugin - seemingly after the press of the Power Button.

 

Since powerdown captures shutdown events, it probably does make sense.

 

If I am correct, could this be as simple as adding:

 

/usr/local/sbin/diagnostics

 

to the code which is executed when the Power Button Press event is captured?

 

Yes. I just need to consider where in the process it makes sense to do this and if the diagnostics script will run if the system is hung.  I haven't worked with the diagnostics script so I am not sure how it works or its dependencies.

 

Tell me more about what you are concerned about.  I sense it is that you want diagnostics if unraid does not respond to the web interface or a telnet or ssh session cannot be started and you want the diagnostics to troubleshoot the problem.

 

Does this happen a lot?

 

Thanks buddy. Sorry an initiative of mine seems be resulting in more work for you. It wasn't my intention.

 

The concern is that with the introduction of virtualisation features in unRAID "I" feel the core system is becoming less stable under different situations. The whole concept that you can run these things on top of unRAID without impacting the core OS I don't think always rings true.

 

Anyway, irrespective of my opinion I have observed / experienced a greatly increased number of instances over the past year of crashes / resets / interface unavailability / system instability (for vaying reasons). Often the dialog with these users (following a request for support) goes like this:

 

- support request indicating issue

- request if user captured syslog before issue occurred

- response in the negative

- indication that support is difficult to impossible without something to go on

 

User at this point has no option but to do things like try and wait for the issue (eg the system to crash) and hopefully capture the logs or embark on an investigation of isolation tests etc.

 

That thread was about being proactive about capturing logs and not reactive in preparation for a failure. Anyway that is my concern - you probably wish you'd never asked.

 

The truth is unRAID experiences crashes and related issues allot more than people (including me) like to admit.

Link to comment

The concern I have is if Linux has stopped working, then the powerdown script can do nothing to capture diagnostics.  If the only way to get the server to shutdown is to hold the power button and do a hard reset, then the powerdown script will never be executed and cannot capture diagnostics.  Holding down the power button powers down the computer and Linux never sees that event.  Linux will only see a momentary press of the power button.

 

It may be helpful to include a diagnostics capture in the powerdown script, but I don't want to set an unrealistic expectation that it will work in all cases of a forced shutdown.

Link to comment

I've added diagnostics capture to the powerdown script.  Whenever a shutdown or reboot occurs a diagnostics is saved to the /boot/logs directory.  Hopefully this will help those that have issues with unraid locking up.  Caveat: it will not work if Linux has crashed.  i.e. if you have to hard reset the system, powerdown cannot capture diagnostics.

 

When unraid locks up, try a single press of the power button and a clean shutdown should occur and diagnostics will be saved.

Link to comment

I've added diagnostics capture to the powerdown script.  Whenever a shutdown or reboot occurs a diagnostics is saved to the /boot/logs directory.  Hopefully this will help those that have issues with unraid locking up.  Caveat: it will not work if Linux has crashed.  i.e. if you have to hard reset the system, powerdown cannot capture diagnostics.

 

When unraid locks up, try a single press of the power button and a clean shutdown should occur and diagnostics will be saved.

 

Nice job mate! :)

Link to comment

I've added diagnostics capture to the powerdown script.  Whenever a shutdown or reboot occurs a diagnostics is saved to the /boot/logs directory.  Hopefully this will help those that have issues with unraid locking up.  Caveat: it will not work if Linux has crashed.  i.e. if you have to hard reset the system, powerdown cannot capture diagnostics.

 

When unraid locks up, try a single press of the power button and a clean shutdown should occur and diagnostics will be saved.

 

Nice job mate! :)

 

+1

Link to comment
  • 2 weeks later...

I don't seem to be able to install the Powerdown plugin. unRAID and Dynamix are both on the latest versions. I attached the log I get when I try to download from github to this post. Any ideas?

Try settings static DNS addresses of 8.8.8.8 and 8.8.4.4 in Settings Network Settings
Link to comment
  • 1 month later...
  • 2 weeks later...

I've been finding my unRAID server off randomly recently.

 

I thought I was running into a hardware issue, but upon each boot I found that a parity check wasn't running.

 

Checking logs, the powerdown script is causing the shutdowns. Thankful nothing more harmful isn't happening, but still want to find the cause.

 

Started on the 27th here:

syslog-20160527-144522.txt:May 27 14:43:45 Tower powerdown[28631]: Powerdown initiated
syslog-20160529-130606.txt:May 29 13:04:32 Tower powerdown[28291]: Powerdown initiated
syslog-20160529-192940.txt:May 29 19:28:29 Tower powerdown[22133]: Powerdown initiated
syslog-20160530-142415.txt:May 30 14:22:42 Tower powerdown[15032]: Powerdown initiated
syslog-20160531-081411.txt:May 31 08:12:56 Tower powerdown[15053]: Powerdown initiated

 

We haven't had any power outages, at least ones long enough to mess with the microwave/stove clock. I disabled the APC daemon as a test and the power down script shut the server down again today. Looking at the log I only see a start of the APC daemon, not a stop. Checked settings and it was definitely off today during the 8am shutdown.

 

I've attached a syslog from the last time it happened. I could be missing something, but I don't see anywhere that says what is calling the powerdown script. Anything I can add to try and capture what is calling it?

 

Let me know if there is anything more I can provide to assist.

syslog-20160531-081411.txt

Link to comment

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.

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.