Use the "stop" file to kill processes which prevent shutdown


Recommended Posts

Sometimes my server does not restart or shutdown and after a while I found out that still running backup scripts caused this issue. Because of that I created the "stop" file which is automatically executed by Unraid:

touch /boot/config/stop

 

and pasted the following content:

#!/bin/bash

# -------------------------------------------------
# Kill all processes which prevent shutdown
# -------------------------------------------------
while [ $(pkill -xc rsync) != "0" ]; do logger -t stop "rsync killed"; sleep 2; done
while [ $(pkill -xc rcloneorig) != "0" ]; do logger -t stop "rclone killed"; sleep 2; done

 

I use the Config File Editor Plugin to edit files:

2053215162_2021-08-1614_35_56.png.3b84ca14bef71acee96b5e8281a9828f.png

Link to comment
  • 2 years later...

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.