cancel
Showing results for 
Search instead for 
Did you mean: 
Create a Post

Best Method To Run A Script On Gateway Boot?

Jump to solution

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.

Thanks!

Dan

Tags (3)
1 Solution

Accepted Solutions
Danny
Pearl

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

The -Best- method to have GAiA running a script at system boot in my mind is using it's built-in functionality for this:

9 Replies

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

Hi Daniel,

you can use the following script:

/etc/rc.local

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:

/etc/rc3.d/Sxx_myscript

xx is the position of the start script.

Regards

Heiko

0 Kudos

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

Excellent! Thank you!

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

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.

0 Kudos
JozkoMrkvicka
Platinum

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

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.

Kind regards,
Jozko Mrkvicka
0 Kudos
JozkoMrkvicka
Platinum

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

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...

Kind regards,
Jozko Mrkvicka
0 Kudos
Danny
Pearl

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

The -Best- method to have GAiA running a script at system boot in my mind is using it's built-in functionality for this:

Admin
Admin

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

While I don't think we're deprecating rc.local anytime soon, this is definitely the more supported approach.

0 Kudos
Highlighted

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

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!

0 Kudos
Admin
Admin

Re: Best Method To Run A Script On Gateway Boot?

Jump to solution

It's also more likely to get backed up through the standard backup methods Smiley Happy