Killing processes when Unraid takes array off-line


Recommended Posts

I have some custom applications that are installed/started in my go script. Everything starts up like I want it. The problem is if I want to restart Unraid, I go to the web interface and click Stop to take the array off-line.

 

Now unraid seems to wait forever for certain processes before it can take the array offline. I need to manually kill these processes.

 

1) The processes don't seem to be using the filesystem, so I'm not sure why unraid needs to wait for them - is there any way to see if/what the processes are using to cause this behavior?

2)Is there any way I can have these processes killed when clicking the stop array button in the web UI? Either by installing/running them in some specific manner or if there is some way to attach a script to this stop event?

 

Thanks,

Link to comment

I think you just need to Telnet in to UnRAID and kill them with Linux commands.  I don't think the Web GUI has any option to automatically run additional shutdown scripts -- although if you're running UnMenu with the CleanPowerDown script that may be modifiable to include your applications.

 

Link to comment

I think you just need to Telnet in to UnRAID and kill them with Linux commands.  I don't think the Web GUI has any option to automatically run additional shutdown scripts -- although if you're running UnMenu with the CleanPowerDown script that may be modifiable to include your applications.

What version of unRAID are you using?  If the 5.0-rc series, then unRAID DOES have event hooks to start processes AFTER the array is online, and to kill them BEFORE the array is stopped.  See here on how you might use them:

http://lime-technology.com/forum/index.php?topic=26201.msg228957;topicseen#msg228957

 

 

In the 4.6/4.7 series you can use a unraid_addon_control.sh script similar to the one I described (and attached) in this post:

http://lime-technology.com/forum/index.php?topic=5686.msg53271#msg53271

 

I've been using unraid_addon_control.sh for a number of years now and it works perfectly.  (It would work on the 5.X series too, but the built in events are easier for plugin users to utilize.)  I use it to start a number of add-ons after the array is started, and to properly stop them prior to the array when the array is being stopped.

 

Here is an example of somebody using the unraid_addon_control.sh script:

http://lime-technology.com/forum/index.php?topic=10978.msg199652#msg199652

 

Joe L.

Link to comment

I think you just need to Telnet in to UnRAID and kill them with Linux commands.  I don't think the Web GUI has any option to automatically run additional shutdown scripts -- although if you're running UnMenu with the CleanPowerDown script that may be modifiable to include your applications.

What version of unRAID are you using?  If the 5.0-rc series, then unRAID DOES have event hooks to start processes AFTER the array is online, and to kill them BEFORE the array is stopped.  See here on how you might use them:

http://lime-technology.com/forum/index.php?topic=26201.msg228957;topicseen#msg228957

 

 

In the 4.6/4.7 series you can use a unraid_addon_control.sh script similar to the one I described (and attached) in this post:

http://lime-technology.com/forum/index.php?topic=5686.msg53271#msg53271

 

I've been using unraid_addon_control.sh for a number of years now and it works perfectly.  (It would work on the 5.X series too, but the built in events are easier for plugin users to utilize.)  I use it to start a number of add-ons after the array is started, and to properly stop them prior to the array when the array is being stopped.

 

Here is an example of somebody using the unraid_addon_control.sh script:

http://lime-technology.com/forum/index.php?topic=10978.msg199652#msg199652

 

Joe L.

 

I am indeed using 5.0 rc3 so I will look into the event hooks. Exactly what I was looking for, thanks!

Link to comment

I had a quick go at this, but no success. The events don't seem to be triggering.

 

I just had a look in the /usr/local/emhttp/plugins and I see some other applications placed event scripts there as well, however they seem to use unmounting_disks and not stopping_services, I will try with that name instead.

 

Edit: This event is not triggered on my installation of Unraid 5-rc3:

/usr/local/emhttp/plugins/<myappname>/event/stopping_services

 

Instead I use the following, which is working great:

/usr/local/emhttp/plugins/<myappname>/event/unmounting_disks

Link to comment

I had a quick go at this, but no success. The events don't seem to be triggering.

 

I just had a look in the /usr/local/emhttp/plugins and I see some other applications placed event scripts there as well, however they seem to use unmounting_disks and not stopping_services, I will try with that name instead.

 

Edit: This event is not triggered on my installation of Unraid 5-rc3:

/usr/local/emhttp/plugins/<myappname>/event/stopping_services

 

OOps... my example in that other post had "stopping_services" but the correct event name is "stopping_svcs"   I'll bet that name would work properly.  (I fixed the other post I had linked to, so hopefully it will be a better example for others)

Instead I use the following, which is working great:

/usr/local/emhttp/plugins/<myappname>/event/unmounting_disks

 

Glad it is working for you.

 

Joe L.

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.