What's new

Run my script as a daemon ?

miljbee

New Around Here
Hello,

I have written a script which should run permanently. Could you give me some advices on how to set my AC68U to start it up at boot ?

Ideally, I would like to be able to manage it with something like
service myscript start/stop/restart.

Thanks for your help.
 
One way is to install Entware (which is good to have by itself anyway).

Then make good use of init.d in Entware. Look at /opt/etc/init.d. Depends on your scripts, most likely you'll need helpers (which available from Entware as well). I've been doing this for years...happily.
 
One way is to install Entware (which is good to have by itself anyway).

Then make good use of init.d in Entware. Look at /opt/etc/init.d. Depends on your scripts, most likely you'll need helpers (which available from Entware as well). I've been doing this for years...happily.

Could you tell me which helpers I should consider ?
 
Could you tell me which helpers I should consider ?

You can start with "daemonize" - a package available from Entware. "daemonize myscript.sh" as command line to run your script as daemon. For the init.d script, simply copy from an existing one. Then rename and adapt..
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top