What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

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

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