Powerdown package for unRAID v5 and v6 (DEPRECATED)


dlandon

Recommended Posts

  • Replies 678
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Sorry for the rudimentary question, but what are the contents of my Kxx file supposed to be to stop a VM under v6b3? Is it by replacing "vmware" with the "DomID" or the "hostname" in the following?

 

[ -x /etc/rc.d/init.d/vmware  ] && /etc/rc.d/init.d/vmware stop

 

Thanks.

 

xl shutdown -a -w

Link to comment

@dlandon, great job, thanks for the script. I discovered, that this is a very nice way to start and stop all VM's and the entire system in one single step. I saw the stop script for unRAID/XEN, so I just wanted to know if it's really that easy to define a start script:

 

S00:

xl create /mnt/cache/.VMs/ArchVM/arch.cfg 

 

S01

xl create /mnt/cache/.VMs/Debian/debcloud.cfg

 

Is anyone using it for a Windows VM as well? My experience is that it is shutting down only from Windows and not via xl shutdown windows

Link to comment
Is anyone using it for a Windows VM as well? My experience is that it is shutting down only from Windows and not via xl shutdown windows

 

if you install gplpv drivers in your windows vm you can then run the following to allow xl shutdown to work:-

 

run

"C:\Program Files\Xen PV Drivers\ShutdownMon.exe -i"

 

this will install shutdownmon as a service (in a command prompt if you want to get feedback that it succeeds).

 

hope this helps  :D

 

Link to comment
FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Looks like it didn't shut down correctly. Let the parity check finish if its still running.

Then use POWERDOWN or stop cleanly through the webGUI.

Then remove the flash, put it in your PC and

Then Run chkdsk on your flash drive. (run Disk Utility on a Mac) 

 

That should fix the flash drive's flag which wasn't cleared by a previous bad shutdown.

 

 

Link to comment

I was using the script on my second server after the great experience on my other unRAID machine (this is the server in my signature).

 

This server is always coming up with a parity check...I must have overlooked something. Syslog is attached, maybe someone can see that the issue is.

 

If you read back up this thread, you'll see that your symptoms are very similar to those I was experiencing.

 

The new Powerdown is trying to be less forceful when shutting down.  This is all well and good but it does mean that if the rest of the system doesn't cooperate you will experience unclean powerdowns.  The new Powerdown relies on using the '/etc/rc.d/rc.* stop' scripts to stop any running processes - in my case, the script didn't always succeed in stopping the process.

 

In your case, there is no evidence that any rc.* scripts are being run - either you have no plugins, or they don't provide an rc.* script.

 

However, you clearly have one, or more, open files on a user share which has files on disk1.  I suspect that it may be a VM with open file(s) on disk1, and your K00 script isn't succeeding in closing it down.

Link to comment

I was using the script on my second server after the great experience on my other unRAID machine (this is the server in my signature).

 

This server is always coming up with a parity check...I must have overlooked something. Syslog is attached, maybe someone can see that the issue is.

 

There is an issue here with the K00.sh script.

Mar 22 22:18:09 Tower rc.unRAID[23152][23153]: Processing /etc/rc.d/rc.unRAID.d/ kill scripts.
Mar 22 22:18:09 Tower rc.unRAID[23152][23157]: Running: "/etc/rc.d/rc.unRAID.d/K00.sh"
Mar 22 22:18:09 Tower rc.unRAID[23152][23160]: Waiting for 0 domains

 

It appears that you are shutting down a VM and it is not working?  What is the content of your K00.sh script?

Link to comment

The new Powerdown is trying to be less forceful when shutting down.  This is all well and good but it does mean that if the rest of the system doesn't cooperate you will experience unclean powerdowns.  The new Powerdown relies on using the '/etc/rc.d/rc.* stop' scripts to stop any running processes - in my case, the script didn't always succeed in stopping the process.

 

Powerdown expects that plugins will shut down properly with supplied .rc scripts and it will no longer force plugins to shut down.  Plugins are expected to behave.  Being forceful in the past caused hang ups when shutting down.

Link to comment

Hmmm...last lines of your syslog:

Mar 22 22:18:16 Tower rc.unRAID[23194][23247]: Active pids left on the array drives

Mar 22 22:18:16 Tower rc.unRAID[23194][23250]:                      USER        PID ACCESS COMMAND

Mar 22 22:18:16 Tower rc.unRAID[23194][23250]: /dev/md1:            root    kernel mount /mnt/disk1

Mar 22 22:18:16 Tower rc.unRAID[23194][23250]:                      root      2027 F.... shfs

Mar 22 22:18:16 Tower rc.unRAID[23194][23251]: Stopping the Array

Mar 22 22:18:16 Tower rc.unRAID[23194][23257]: /root/mdcmd: line 11: echo: write error: Device or resource busy

Mar 22 22:18:16 Tower kernel: mdcmd (107): stop

Mar 22 22:18:16 Tower kernel: md: 2 devices still in use.

Your disk1 is JUST TimeMachine? Do your other share definitions EXCLUDE disk1?

 

I don't understand XEN, but could the answer be in your (EdgarWallace's) Post #206 above?  ...something about a -u flag being needed?

Link to comment

I'm convinced that, with powerdown v1.02, issuing the 'shutdown -P now' command would execute the powerdown script and then power the machine off - in the same way that a short push on the power button would do (and still does).

 

However, I have just tried to use 'shutdown -P now' and the machine shut down but failed to power down.  Is this something that can be easily fixed?

 

I've also discovered that if powerdown is invoked soon after the machine has booted up, an unclean powerdown can result, with a seemingly random drive failing to umount.  In my world of frequent powercuts, this is a very real problem - it has happened twice in the last month or so.  I suspect that it is associated with cache_dirs performing its initial scan - the active PID is a 'find' command.  I guess that the cache_dirs plugin requires some attention to the way rc.cache_dirs responds to the 'stop'.  I suspect that a "killall -9 find" is in order!

Link to comment

I'm convinced that, with powerdown v1.02, issuing the 'shutdown -P now' command would execute the powerdown script and then power the machine off - in the same way that a short push on the power button would do (and still does).

 

However, I have just tried to use 'shutdown -P now' and the machine shut down but failed to power down.  Is this something that can be easily fixed?

 

The 'shutdown -P now' should operate the same.  Run the command and post a log so I can take a look.

Link to comment

I'm convinced that, with powerdown v1.02, issuing the 'shutdown -P now' command would execute the powerdown script and then power the machine off - in the same way that a short push on the power button would do (and still does).

 

However, I have just tried to use 'shutdown -P now' and the machine shut down but failed to power down.  Is this something that can be easily fixed?

 

I've also discovered that if powerdown is invoked soon after the machine has booted up, an unclean powerdown can result, with a seemingly random drive failing to umount.  In my world of frequent powercuts, this is a very real problem - it has happened twice in the last month or so.  I suspect that it is associated with cache_dirs performing its initial scan - the active PID is a 'find' command.  I guess that the cache_dirs plugin requires some attention to the way rc.cache_dirs responds to the 'stop'.  I suspect that a "killall -9 find" is in order!

 

'shutdown -P now' is a maintenance mode and switches to a single user mode.  It won't shut off the computer.  Are you sure this is the command you used in the past?

Link to comment

'shutdown -P now' is a maintenance mode and switches to a single user mode.  It won't shut off the computer.  Are you sure this is the command you used in the past?

 

root@Tower:~# shutdown
Usage:	  shutdown [-akrhHPfnc] [-t secs] time [warning message]
	  -a:      use /etc/shutdown.allow
	  -k:      don't really shutdown, only warn.
	  -r:      reboot after shutdown.
	  -h:      halt after shutdown.
	  -P:      halt action is to turn off power.
	  -H:      halt action is to just halt.
	  -f:      do a 'fast' reboot (skip fsck).
	  -F:      Force fsck on reboot.
	  -n:      do not go through "init" but go down real fast.
	  -c:      cancel a running shutdown.
	  -t secs: delay between warning and kill signal.
	  ** the "time" argument is mandatory! (try "now") **
root@Tower:~#

 

Pretty sure, yes.

Link to comment

Not sure if this is something I have to edit in Dynamix or Powerdown but I set up K00.sh / S00.sh scripts which worked fine when I hit "start array" or "stop array" with the standard webGUI. However after I installed the Dynamix enhanced webGUI the K00.sh / S00.sh scripts stopped being executed when I hit start/stop array on the Dynamix webGUI.

Link to comment

Not sure if this is something I have to edit in Dynamix or Powerdown but I set up K00.sh / S00.sh scripts which worked fine when I hit "start array" or "stop array" with the standard webGUI. However after I installed the Dynamix enhanced webGUI the K00.sh / S00.sh scripts stopped being executed when I hit start/stop array on the Dynamix webGUI.

 

Make sure you have the latest version of Dynamix.  Also look at your log and check which version of powerdown is installed.  An older version of Dynamix will install powerdown 1.02 that does not support the K and S scripts.

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.