July 29, 20232 yr 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.
July 30, 20232 yr Community Expert In the /sbin directory, there is this command--- dated march 8, 2021: 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 July 30, 20232 yr by Frank1940
July 30, 20232 yr Community Expert And then there is this section of the manual: https://docs.unraid.net/unraid-os/manual/troubleshooting#unclean-shutdowns
July 30, 20232 yr 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.
July 30, 20232 yr 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.