Jump to content

Running a long-running script BEFORE the array starts (sleeping until actions are done)


Recommended Posts

I'm trying to fine tune my UPS power down and power restored workflows. I run 2 DS4246 disk shelves, and they need to be powered up for a minute or two before unraid boots, to avoid panics about missing disks. I've got a switched PDU, and a UPS with an outlet group. The outlet group on the UPS powers non-critical systems that I want to come back after a power outage, but not only my unraid server, so I can't just switch that off/on based on power status. So I've been working to directly switch the PDU outlets.

Honestly, it's a long story, but the bottom line: I need to be able to power up those 2 disk shelves when unraid boots, and then tell it to wait a couple minutes for them to spin up, then continue with mounting the array.

My understanding is that the go script runs asynchronously to array booting and mounting, so that's out, and user scripts simply specifies "AT" array start, not whether it's run before or after.

What are my options here?

Link to comment
1 hour ago, drumstyx said:

My understanding is that the go script runs asynchronously to array booting and mounting, so that's out, and user scripts simply specifies "AT" array start, not whether it's run before or after.

Not quite true.    The ‘go’ file starts the emhttp server which is what starts all the services and the Unraid GUI, and that can run asynchronousky.  Sounds like you could satisfy your need by inserting the long running part to happen before starting emhttp.

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.

×
×
  • Create New...