May 19, 20215 yr 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.
May 19, 20215 yr 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.
May 19, 20215 yr Author @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.
May 19, 20215 yr 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.
May 20, 20215 yr Author 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.
May 20, 20215 yr 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.
Archived
This topic is now archived and is closed to further replies.