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.

Safe/clean shutdown and system restart from the command line

Featured Replies

Is there a way to do this?

 

I'd like to perform some actions before shutdown/restart using bash scripts. Is there a way that I can hook into the existing shutdown/restart to do this? Failing that I guess I'd like to make my own shutdown script that calls the safe shutdown somehow so that I don't need a parity check on reboot.

  • Community Expert

In the   /sbin   directory, there is this command--- dated march 8, 2021:

 

image.png.fa5189cfaf9f2a25b799023c124093f4.png

 

And in the forum, there is this suggestions:

 

https://forums.unraid.net/topic/50490-solved-commands-to-start-and-stop-array/#comment-496967

 

The problem (as my memory serves me) is making sure that the array, Dockers and VM's are all stopped properly and that 'ArrayStopped' flag is properly written to the flash drive to achieve a 'clean' shutdown.   (There are situations where the GUI buttons don't always succeed in meeting all of these requirements!)

 

 

Edited by Frank1940

  • Community Expert

The ‘shutdown’ command from the CLI does exactly what pressing the Shutdown button in the GUI does.

 

The section on troubleshooting unclean shutdowns applies regardless of how the shutdown process is initiated.

 

  • Author

So it took a little digging and another post on here, but it seems like the 'powerdown' command itself calls a script which then calls the 'stop' file which doesn't exist by default but can be created. It runs very early in the process so it should fit this use case nicely.

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.