reboot
appears to make the root file system read-only almost immediately, causing a race condition with one of my processes which tries to write settings out to a file during its approx 1-2 second shutdown.
The result, intermittently, is an empty settings file as it's truncated but not filled back up in time.
I'm creating a workaround within the process in question itself, but I'd still like to add some sanity to the reboot
command.
Now, I thought about aliasing reboot
to reboot -d 5
for the only account on the system, so that no-one will inadvertently perform this immediate shutdown, since -d
introduces a delay:
[hostname /root]# reboot --help 2>&1 | grep Delay
-d Delay interval for rebooting
However, BusyBox v1.13.3 doesn't appear to support alias
in its sh
implementation:
[hostname /root]# alias reboot=reboot -d 5
-sh alias: not found
What are my options?