Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Powerdown package for unRAID v5 and v6 (DEPRECATED)

Featured Replies

  • Replies 678
  • Views 172.5k
  • Created
  • Last Reply

Testing 2.01:

 

After creating the archVM, and having a k00.sh script in place with 'xl shutdown -a' i enter the powerdown command.

The script hangs after the message:

 

INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
Running shutdown script /etc/rc.d/rc.0:
Saving system time to the hardware clock (UTC).
Stopping XEN domains: /etc/rc.d/rc.xendomains
Shutting down Xen domains: archVM(save)....../etc/rc.d/rc.0: line 59: 2392 Killed        /etc/rc.d/rc.local_shutdown stop
INIT: no more processes left in this runlevel

 

And then nothing... no reboot or actual powerdown. System hangs with the above text still on screen.

Can not connect anymore, no webgui. Need to do a hard reset which is not a good thing :o

  • Author

Testing 2.01:

 

After creating the archVM, and having a k00.sh script in place with 'xl shutdown -a' i enter the powerdown command.

The script hangs after the message:

 

INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
Running shutdown script /etc/rc.d/rc.0:
Saving system time to the hardware clock (UTC).
Stopping XEN domains: /etc/rc.d/rc.xendomains
Shutting down Xen domains: archVM(save)....../etc/rc.d/rc.0: line 59: 2392 Killed        /etc/rc.d/rc.local_shutdown stop
INIT: no more processes left in this runlevel

 

And then nothing... no reboot or actual powerdown. System hangs with the above text still on screen.

Can not connect anymore, no webgui. Need to do a hard reset which is not a good thing :o

 

It does not look like powerdown ran.  There are no messages from powerdown. The first message you should see is "Powerdown initiated".  Can you get a syslog?

 

Send a syslog of your system once it boots before you powerdown.

 

Run the system without plugins (except for powerdown), stop the array in the webgui, and then run powerdown.  Verify you see the "Powerdown initiated" message and a version number.  If you don't, post a syslog.

  • Author

There is a new version (2.02) of powerdown that handles your custom scripts.  Powerdown creates a directory on the flash drive (/boot/config/plugins/powerdown/custom/) where you can put your Kxx scripts.  Powerdown will manage them from there.

 

This way you don't have to add any entries in your 'go' file.

2.01 was installed. If i do NOT start a VM and run powerdown, it powers down correctly and i do see a message from powerdown 2.01...

 

btw, the script does NOT say 'powerdown initiated'. It never does.

There is 2 beeps, an empty prompt, and then some logging, about 10 lines, and after that it says 'powerdown 2.01' and the logging and shutdown continues.

 

last part of syslog.

(the array was not started, so no vm as well)

 

...
Feb 10 05:42:25 Tower rc.unRAID[1596][1597]: Powerdown V2.01
Feb 10 05:42:25 Tower rc.unRAID[1596][1598]: Stopping Plugins.
Feb 10 05:42:25 Tower rc.unRAID[1596][1606]: Stopping unRAID.
Feb 10 05:42:26 Tower rc.unRAID[1596][1626]: No active PIDS on the array
Feb 10 05:42:26 Tower rc.unRAID[1596][1632]: Specified filename /mnt/disk* does not exist.
Feb 10 05:42:26 Tower rc.unRAID[1596][1632]: Specified filename /mnt/cache does not exist.
Feb 10 05:42:26 Tower rc.unRAID[1596][1632]: Specified filename /mnt/user* does not exist.
Feb 10 05:42:26 Tower rc.unRAID[1596][1632]: Specified filename /dev/md* does not exist.
Feb 10 05:42:26 Tower rc.unRAID[1596][1633]: Umounting the drives
Feb 10 05:42:26 Tower rc.unRAID[1596][1637]: umount: /mnt/disk*: not found
Feb 10 05:42:26 Tower rc.unRAID[1596][1637]: Could not find /mnt/disk* in mtab
Feb 10 05:42:26 Tower rc.unRAID[1596][1639]: Stopping the Array
Feb 10 05:42:26 Tower kernel: mdcmd (4): stop 
Feb 10 05:42:26 Tower kernel: md: stop_array: not started

syslog.zip

After rebooting, starting the array, installpkg the powerdown 2.01, creating the vm, checking if all runs, and entering powerdown, NOTHING happens. Powerdown returns to the cmd line.

No response on remote sessions, no webgui.

 

Once i removed the usb key so i could get the logging (i had no respons and no connection, system seems to hang), the machine suddenly continues shutting down...

 

There's not more i can do, this test laptop i'm using for unraid 6 is going to be reinstalled with win7/64 tomorrow. I hope you or Limetech come up with a solid solution for powering down an unraid 6 server with al it's running vm's in an orderly fashion, initiated by user or a UPS due to power outage. Until then, i keep far away from unraid 6 if you don't mind ;)

syslog.zip

  • Author

After rebooting, starting the array, installpkg the powerdown 2.01, creating the vm, checking if all runs, and entering powerdown, NOTHING happens. Powerdown returns to the cmd line.

No response on remote sessions, no webgui.

 

Once i removed the usb key so i could get the logging (i had no respons and no connection, system seems to hang), the machine suddenly continues shutting down...

 

There's not more i can do, this test laptop i'm using for unraid 6 is going to be reinstalled with win7/64 tomorrow. I hope you or Limetech come up with a solid solution for powering down an unraid 6 server with al it's running vm's in an orderly fashion, initiated by user or a UPS due to power outage. Until then, i keep far away from unraid 6 if you don't mind ;)

 

It appears that powerdown ran through it's process and completed.

 

While I appreciate your frustration, both unRAID v6 and powerdown are Beta.  This means that there will be issues to sort out.  If you are not prepared to deal with any issues, you should wait until it is all sorted out.

Oh, i know its beta and all, and i hope my test efforts are of some use. I just dont have a machine available for testing anymore, this was the last i could do today. I appreciate your efforts, but I do hope Limetech also comes up with some integrated powerdown support including vm's for the final version.

  • Author

Oh, i know its beta and all, and i hope my test efforts are of some use. I just dont have a machine available for testing anymore, this was the last i could do today. I appreciate your efforts, but I do hope Limetech also comes up with some integrated powerdown support including vm's for the final version.

 

All feedback is greatly appreciated.  That's what Beta testing is all about.

 

Thank you.

  • Author

Version 2.02 of powerdown is available.  A directory on the flash drive is now available for your custom shutdown scripts.  The directory is /boot/config/plugins/powerdown/custom/.  Place any script files you want processed at the beginning of powerdown.  The files should be named Kxx - where xx is 00-99.

 

For those of you running VMs, you will need to provide a custom script so powerdown can shut them down before unRAID tries to stop Xen.  I know you'd rather just have powerdown do that, but powerdown is being kept generic for both v5 and v6 (plain vanilla, and Xen).  Because each user has unique needs, this is the best way to handle the situation.

Isn't the kxx file not the place for custom scripts to shut down vm's then?

  • Author

Isn't the kxx file not the place for custom scripts to shut down vm's then?

 

It is the right place.

 

This is just more convenient than having to do a copy in your 'go' file.  Put these on the flash drive in the /boot/config/powerdown/custom/ directory and powerdown will take care of putting them in the /etc/rc.d/rc.unRAID.d/ directory for you.

Ok. Had some spare time, tried 2.02, but no effect. The k00 works if i call it myself from /boot/plugins/powerdown/custom, but it doesnt seem to be called or working from inside the script.

Same effect as with 2.01, enter the powerdown command, 2 beeps, cursor returns and nothing happens... and the syslog shows it has been run. Weird.

 

If i use the 1.04 version of powerdown it all works fine. First i manually stop the vm's by calling the k00 script or 'xl shutdown -a', the vm stops. I enter 'powerdown', 2 beeps, and the system shuts down nicely... perfect.

  • Author

Ok. Had some spare time, tried 2.02, but no effect. The k00 works if i call it myself from /boot/plugins/powerdown/custom, but it doesnt seem to be called or working from inside the script.

Same effect as with 2.01, enter the powerdown command, 2 beeps, cursor returns and nothing happens... and the syslog shows it has been run. Weird.

 

If i use the 1.04 version of powerdown it all works fine. First i manually stop the vm's by calling the k00 script or 'xl shutdown -a', the vm stops. I enter 'powerdown', 2 beeps, and the system shuts down nicely... perfect.

 

Syslog please.

  • Author

Version 2.03 is now available.

 

Fixed a potential problem where the wrong powerdown would be executed.  unRAID supplies a default powerdown that stops the array and then powers off.  This gets around this powerdown package and unRAID could potentially hang..

 

If you are using the apcupsd plugin, remove the following lines:

#Finish Clean Powerdown Install
[ -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

 

These lines don't cause powerdown to not work properly, but powerdown takes care of this on its own.

Powerdown 2.03 is doing a better job:

root@Tower:/# powerdown
Powerdown initiated
Powerdown V2.03

Broadcast message from root@Tower (pts/0) (Mon Feb 10 10:19:45 2014):

The system is going down for system halt NOW!
root@Tower:/# Connection closed by foreign host.
root@UNRAID:~#

 

But... the console shows the same logs as before and is NOT rebooted:

INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
Running shutdown script /etc/rc.d/rc.0:
Saving system time to the hardware clock (UTC).
Stopping XEN domains: /etc/rc.d/rc.xendomains
Shutting down Xen domains: archVM(save)....../etc/rc.d/rc.0: line 59: 2392 Killed        /etc/rc.d/rc.local_shutdown stop
INIT: no more processes left in this runlevel

 

system seems to halt with above message, nothing is responding. Need a hard reset to reboot.

syslog.zip

  • Author

Powerdown 2.03 is doing a better job:

root@Tower:/# powerdown
Powerdown initiated
Powerdown V2.03

Broadcast message from root@Tower (pts/0) (Mon Feb 10 10:19:45 2014):

The system is going down for system halt NOW!
root@Tower:/# Connection closed by foreign host.
root@UNRAID:~#

 

But... the console shows the same logs as before and is NOT rebooted:

INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
Running shutdown script /etc/rc.d/rc.0:
Saving system time to the hardware clock (UTC).
Stopping XEN domains: /etc/rc.d/rc.xendomains
Shutting down Xen domains: archVM(save)....../etc/rc.d/rc.0: line 59: 2392 Killed        /etc/rc.d/rc.local_shutdown stop
INIT: no more processes left in this runlevel

 

system seems to halt with above message, nothing is responding. Need a hard reset to reboot.

 

I don't see in this log where the powerdown package is being installed.  How are you installing the powerdown package?  How are you doing a powerdown?

 

What I do see in the log is an older powerdown running.

 

Reboot your system and send me the syslog without trying to shutdown.

It just doesnt show up in syslog? The console says powerdown 2.03 as you can see, after i enter 'powerdown'.

i install the 2.03 after each reboot by hand, using installpkg powerdown-2.03.etc.etc.etc from the packages folder.

 

*edit*

for some reason the /flash/logs folder is empty and stays empty after rebooting... no more syslogs? Is there another place where those are stored?

  • Author

It just doesnt show up in syslog? The console says powerdown 2.03 as you can see, after i enter 'powerdown'.

i install the 2.03 after each reboot by hand, using installpkg powerdown-2.03.etc.etc.etc from the packages folder.

 

*edit*

for some reason the /flash/logs folder is empty and stays empty after rebooting... no more syslogs? Is there another place where those are stored?

 

Powerdown is in multiple pieces and it appears you have some of the new and some of the old.  The version I see in the log is the one that was causing this hang up.

 

I don't think the package install was successful.  It's best to use the plugin to do it for you.

 

The reason you are not getting logs is that powerdown is hanging just before the syslog is saved.

 

Lets do this:

Clear your system temporarily of all plugins and packages.

- make a backup of your flash.

- Delete plugin files in /boot/plugins

- Delete plugin files in /boot/config/plugins

- Delete any files in /boot/packahes

- Delete any files in /boot/extra

- Put the attached powerdown plugin in /boot/config/plugins

- Reboot.

- Check your log for the following:

+==============================================================================
Feb 10 12:09:54 MediaServer logger: | Installing new package /boot/packages/powerdown-2.03-noarch-unRAID.tgz
Feb 10 12:09:54 MediaServer logger: +==============================================================================
Feb 10 12:09:54 MediaServer logger: 
Feb 10 12:09:54 MediaServer logger: Verifying package powerdown-2.03-noarch-unRAID.tgz.
Feb 10 12:09:54 MediaServer logger: Installing package powerdown-2.03-noarch-unRAID.tgz:
Feb 10 12:09:54 MediaServer logger: PACKAGE DESCRIPTION:
Feb 10 12:09:54 MediaServer logger: # powerdown  Control scripts for the unRAID server Environment.
Feb 10 12:09:54 MediaServer logger: #
Feb 10 12:09:54 MediaServer logger: # Adds /sbin/powerdown script to assist with quick unRAID poweroff
Feb 10 12:09:54 MediaServer logger: #
Feb 10 12:09:54 MediaServer logger: # Install Variable options:
Feb 10 12:09:54 MediaServer logger: # CTRLALTDEL=yes set ctrl-alt-del to do powerdown instead of reboot
Feb 10 12:09:54 MediaServer logger: # SYSLOG=YES     do initial syslog saving upon installation
Feb 10 12:09:54 MediaServer logger: # STATUS=YES     Show status upon installation
Feb 10 12:09:54 MediaServer logger: # START=YES      do initial start upon installation
Feb 10 12:09:54 MediaServer logger: # 
Feb 10 12:09:54 MediaServer logger: # Install with VAR's as defined above like:
Feb 10 12:09:54 MediaServer logger: # VAR=YES OTHERVAR=YES installpkg powerdown-2.03-noarch-unRAID.tgz
Feb 10 12:09:54 MediaServer logger: # Like Like: 
Feb 10 12:09:54 MediaServer logger: # CTRLALTDEL=yes installpkg powerdown-2.03-noarch-unRAID.tgz
Feb 10 12:09:54 MediaServer logger: # 
Feb 10 12:09:54 MediaServer logger: # /etc/rc.d/rc.unRAID script has basic pre-power down functions
Feb 10 12:09:54 MediaServer logger: # Hooks are placed in /etc/rc.d/rc.local_shutdown
Feb 10 12:09:54 MediaServer logger: # to allow normal poweroff/shutdown commands do a graceful shutdown
Feb 10 12:09:54 MediaServer logger: # 
Feb 10 12:09:54 MediaServer logger: # Diagnostic mode for quick syslog dump/save to /boot/logs
Feb 10 12:09:54 MediaServer logger: # call as /etc/rc.d/ec.unRAID diag
Feb 10 12:09:54 MediaServer logger: # call as /etc/rc.d/rc.unRAID syslog 
Feb 10 12:09:54 MediaServer logger: Executing install script for powerdown-2.03-noarch-unRAID.tgz.
Feb 10 12:09:54 MediaServer init: Re-reading inittab
Feb 10 12:09:54 MediaServer logger: kernel.poweroff_cmd = /sbin/powerdown
Feb 10 12:09:54 MediaServer logger: Package powerdown-2.03-noarch-unRAID.tgz installed.
Feb 10 12:09:54 MediaServer logger: 

 

If you see that, then do a powerdown and verify that your system shuts down.  Send me a syslog.

 

Then start adding plugins and VMs one at a time and verify powerdown is still working.

powerdown.plg.txt

Did everything above. For some reason there is no syslog generated anymore in /logs, but i can view it in the webgui.

This is the interesting part:

Feb 10 12:25:56 Tower logger: Installing user plugins
Feb 10 12:25:56 Tower logger: installing plugin: powerdown
Feb 10 12:25:56 Tower logger:  file /tmp/powerdown-prepare: successfully wrote INLINE file contents
Feb 10 12:26:10 Tower kernel: br0: port 1(eth0) entered learning state
Feb 10 12:26:25 Tower kernel: br0: topology change detected, propagating
Feb 10 12:26:25 Tower kernel: br0: port 1(eth0) entered forwarding state
Feb 10 12:26:25 Tower dhcpcd[1096]: br0: carrier acquired
Feb 10 12:26:25 Tower dhcpcd[1096]: br0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: using ClientID ff:62:72:30:00:00:01:00:01:1a:8b:f2:72:d0:67:e5:43:ca:e8
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: soliciting a DHCP lease
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: sending DISCOVER (xid 0xcd444764), next in 3.05 seconds
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: offered 192.168.1.28 from 192.168.1.1
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: sending REQUEST (xid 0xcd444764), next in 4.21 seconds
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: acknowledged 192.168.1.28 from 192.168.1.1
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: checking for 192.168.1.28
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: sending ARP probe (1 of 3), next in 1.05 seconds
Feb 10 12:26:27 Tower logger:   /bin/bash /tmp/powerdown-prepare ... No network communication !!!
Feb 10 12:26:27 Tower logger: success
Feb 10 12:26:27 Tower logger:  file /boot/packages/powerdown-2.03-noarch-unRAID.tgz: downloading from --no-check-certificate https://github.com/dlandon/unraid-snap/raw/master/powerdown-2.03-noarch-unRAID.tgz ... bad download, deleting
Feb 10 12:26:27 Tower logger: Starting go script

So the plugin is trying to download the script but failes.

I've downloaded the 2.03 powerdown by hand and rebooted. This time the startup sequence installed it, see syslog.

(I've copied this syslog from the webgui)

syslog_fresh.zip

  • Author

Did everything above. For some reason there is no syslog generated anymore in /logs, but i can view it in the webgui.

This is the interesting part:

Feb 10 12:25:56 Tower logger: Installing user plugins
Feb 10 12:25:56 Tower logger: installing plugin: powerdown
Feb 10 12:25:56 Tower logger:  file /tmp/powerdown-prepare: successfully wrote INLINE file contents
Feb 10 12:26:10 Tower kernel: br0: port 1(eth0) entered learning state
Feb 10 12:26:25 Tower kernel: br0: topology change detected, propagating
Feb 10 12:26:25 Tower kernel: br0: port 1(eth0) entered forwarding state
Feb 10 12:26:25 Tower dhcpcd[1096]: br0: carrier acquired
Feb 10 12:26:25 Tower dhcpcd[1096]: br0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: using ClientID ff:62:72:30:00:00:01:00:01:1a:8b:f2:72:d0:67:e5:43:ca:e8
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: soliciting a DHCP lease
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: sending DISCOVER (xid 0xcd444764), next in 3.05 seconds
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: offered 192.168.1.28 from 192.168.1.1
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: sending REQUEST (xid 0xcd444764), next in 4.21 seconds
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: acknowledged 192.168.1.28 from 192.168.1.1
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: checking for 192.168.1.28
Feb 10 12:26:26 Tower dhcpcd[1096]: br0: sending ARP probe (1 of 3), next in 1.05 seconds
Feb 10 12:26:27 Tower logger:   /bin/bash /tmp/powerdown-prepare ... No network communication !!!
Feb 10 12:26:27 Tower logger: success
Feb 10 12:26:27 Tower logger:  file /boot/packages/powerdown-2.03-noarch-unRAID.tgz: downloading from --no-check-certificate https://github.com/dlandon/unraid-snap/raw/master/powerdown-2.03-noarch-unRAID.tgz ... bad download, deleting
Feb 10 12:26:27 Tower logger: Starting go script

So the plugin is trying to download the script but failes.

 

It says the download of powerdown was bad.  There is an issue in v6 with plugins starting before the network (Internet) is available.  That's the message "No network communication !!!".

 

The plugin I wrote tries to take care of this by waiting for the network, but the message indicates it timed out and still did not have network access.

After re-booting and starting the vm, and after entering powerdown, powerdown hangs again.

The vm is stopped so powerdown is running my k00 script (which contains xl shutdown -a).

 

System hangs with: INIT: no more processes left in this runlevel. See samples i gave before.

Must give hard reset. I give up. I'll see if it created a syslog.

  • Author

I've downloaded the 2.03 powerdown by hand and rebooted. This time the startup sequence installed it, see syslog.

(I've copied this syslog from the webgui)

 

Eccellent!  Now you can see that the powerdown package is installed.

 

Move on to the next steps, and see if anything you add back in causes a problem.  If you add in the apcupsd plugin, you will have to make a change to the apcups plugin and remove the powerdown plugin.  You can leave the powerdown package in the /packages directory.  I would leave apcupsd out for the time being.

 

The best way to test powerdown and minimize issues if it gets hung, is to stop the array first with the webgui.  That way the array is stopped and having to push the power button shouldn't be a problem.

 

Let me see the syslog from the flash /logs after you power down.  Attach the one in the zipped directory.  That will be the last one saved.

 

You're getting there!

  • Author

After re-booting and starting the vm, and after entering powerdown, powerdown hangs again.

The vm is stopped so powerdown is running my k00 script (which contains xl shutdown -a).

 

System hangs with: INIT: no more processes left in this runlevel. See samples i gave before.

Must give hard reset. I give up. I'll see if it created a syslog.

 

Ok.  I'd like to see the log if you can get it.  Was anything else installed on the system?

Archived

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.