Graber Posted May 19, 2021 Share Posted May 19, 2021 I've got a separate machine plugged into my UPS, and I created a net rpc shutdown script (./powerout) to trigger from the powerout event within apccontrol. It works great - once. After testing (unplugging the UPS and letting everything shutdown as expected), when I restart the UNRAID server, the script is simply gone. So is the copy I placed in ~. #Confused. Any insight appreciated. Quote Link to comment
JonathanM Posted May 19, 2021 Share Posted May 19, 2021 Unraid extracts the OS from archives on the USB into RAM on every boot. If you don't store the script on a drive it won't survive a reboot. /boot is the USB flash drive, however since it's FAT32 normal linux permissions don't apply so you will need to copy it elsewhere to set execute permissions. The user scripts plugin handles this for you if you wish. Quote Link to comment
Graber Posted May 19, 2021 Author Share Posted May 19, 2021 @jonathanm To make sure understand your idea, do you mean set up a user script (via plugin) to copy my 'powerout' script from a drive to the /etc/apcupsd directory on boot? As i understand, the script has to be located there to be triggered by apccontrol. Quote Link to comment
JonathanM Posted May 19, 2021 Share Posted May 19, 2021 That, or put a line in the go file to copy the file from /boot/powerout to /etc/apcupcupsd and set permissions to execute. However you are comfortable handling it. Quote Link to comment
Graber Posted May 20, 2021 Author Share Posted May 20, 2021 Thanks for the tip - I went with a user script triggered by array start. That way if I add other steps I want to occur then, I just amend the script. Worked great. Quote Link to comment
JonathanM Posted May 20, 2021 Share Posted May 20, 2021 19 minutes ago, Graber said: That way if I add other steps I want to occur then, I just amend the script. Your call, but I prefer the granular approach, one named script per function, that way it's easy to change schedules or whatever. Or just use # to disable or enable script lines. It's not like it takes much space either way. Quote Link to comment
Graber Posted May 20, 2021 Author Share Posted May 20, 2021 Good point. Thanks. Quote Link to comment
Recommended Posts
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.