The boot partition gets completely overwritten each update, that's a byproduct of how SCALE is deployed and run.
There's no way to change that so the answer is don't put data you want to persist on boot, put it in one of your pools. You can use pre/post init tasks to script minor things like checking to see if symlinks exist and re-creating them if not.
I run a modified fan script that keys off CPU and hdd temps and adjusts the fan speeds (via ipmitool) as needed. It runs out of a directory in one of my pools and logs to a different directory in same. I don't need to mess with the boot/root partition at all this way. I launch it at boot with a simple post-init script.
A quick look at the script you linked to shows you can do basically the same thing - the script can be run from anywhere, you can change the log file path in the script to a directory under your control in one of your pools, and the tools it uses like ipmitool already exist in SCALE.
If you really want it to be controlled via a Systemd service like the page you linked outlines you can do that with a post init script too - a simple bash script that checks to see if
/etc/systemd/system/ipmi.service
exists, and if not copies a pre-existing ipmi.service file from your pool and re-enables the service.
Something like this would work:
Back out of any previous instance of the script running
systemctl stop ipmi.service
&&
systemctl disable ipmi.service
Create a directory on one of your pools to hold your scripts. Can be just about anything, in this example we'll use tank/scripts where tank is the pool name.
Put your fan control script
ipmiservice.sh
in this directory. You can also have it log here if you want.
Also copy the
/etc/systemd/system/ipmi.service
file you (presumably) created earlier in this directory. Make sure to adjust the paths in it to point to the new location of your
ipmiservice.sh
script!
Make sure it works with the new locations first - after adjusting the paths, copy ipmi.service back to
/etc/systemd/system/
, re-enable, and start it. Make sure the fans are being controlled like you want and that its logging to the new path.
Next, create a new script in the same directory called "check-ipmi.service.sh" with the following
Code:
#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if cmp -s "${SCRIPT_DIR}/ipmi.service" /etc/systemd/system/ipmi.service
then
echo "all good IPMI Service already enabled"
else
echo "Updating IPMI Service..."
cp "${SCRIPT_DIR}/ipmi.service" /etc/systemd/system/ipmi.service
echo "Re-enabling IPMI Service"
systemctl enable ipmi.service
sleep 2
systemctl start ipmi.service
fi
Make that script executable
chmod +x check-ipmi.service.sh
.
It's a good idea to test manually before setting up a post init task.
./check-ipmi.service.sh
- when you run that, assuming your copied/renabled the service earlier, it should output "all good IPMI Service already enabled".
Now stop and disable the service again via the same commands I listed above. If the
/etc/systemd/system/ipmi.service
still exists, delete it.
Now run the script again
chmod +x check-ipmi.service.sh
.
It should see the file no longer exists (or changed), copy it over, and re-enable/re-start the service.
Once this works from the command line add a post-init task to start
check-ipmi.service.sh
and you're set.