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.

Override/Custom Shutdown Script

Featured Replies

Is there a way for me to override the commands (or some of the commands) that Unraid runs on Stop Array/Shutdown/Reboot?

 

I have two problems I am trying to solve:

 

1. Docker container that will not SIGTERM

One of my containers for whatever reason does not respond to the stop command. I have to manually `docker kill container-name` or it blocks the shutdown forever. Even when reaching the Docker Stop Timeout it doesn't get past this. I tried a user script on stopping of array, but that event doesn't fire until after Docker is stopped.

 

2. Docker container shutdown order

Another container relies on a PGSQL container. When shutting down, it attempts to run cleanup tasks and sync information to the DB. When manually stopping docker this is not a problem. However on shutdown Unraid stops all the containers at the same time. The DB stops immediately and then the container depending on it throws errors attempting to run its own shutdown. It fails to stop and then is killed when Docker Stop Timeout has elapsed. This takes much longer than a graceful shutdown and I am concerned about what is happening to the data that it's trying to send to the DB during graceful shutdown.

 

 

If I can override the scripts that are running on shutdown (or, less ideal but still workable, run my own script before the regular shutdown script) I can resolve both of these issues by killing the one container (I'm not concerned about forced shutdown for that one) and stopping the other containers in an order of my choosing.

 

I am comfortable with bash and writing the script myself, I just need to know how I can do so.

Solved by JonathanM

  • Solution

Take a look here.

tldr: create a text file named stop in the config folder.

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...

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.