What is the best way to have a custom script launch when a Gateway boots up? I'd preferably want it to happen pretty late in the start-up process... at least once all the network interfaces have come up.
The -Best- method to have GAiA running a script at system boot in my mind is using it's built-in functionality for this:
you can use the following script:
This script will be executed *after* all the other init scripts. You can put your own initialization stuff in here if you don't want to do the full Sys V style init stuff.
Or use a "/etc/rc3.d" start script:
xx is the position of the start script.
Excellent! Thank you!
On Gaia would add an entry to /etc/rc.local. One example use case is from Keld Norman: iPhone Real-time Push notification on SmartEvent.
On Gaia embedded check out sk11818: How to make kernel parameters survive reboot on SMB appliances.
I am using /etc/rc.local to issue "ethtool -r eth1-01" because in some special cases FIBER ports didnt came up after reboot (or set off/on). Maybe issue on the switch, maybe SFP, dont know, but this is workaround working in case of unexpected reboot happened.
Or maybe using @reboot in crontab ? Will it work to execute some script after reboot ? Someone tried ? What in case system was halted ? just thinking loud...
While I don't think we're deprecating rc.local anytime soon, this is definitely the more supported approach.
I didn't realize "At Startup" was an option in GAiA's scheduler. In my opinion that's even better than modifying rc.local just in case that gets deprecated at some point. Thanks!
It's also more likely to get backed up through the standard backup methods
Retrieving data ...