zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
595 stars 65 forks source link

How to check reboot order #47

Open haxecoder opened 8 years ago

haxecoder commented 8 years ago

I wonder if somehow i can moderate forever-script loading order. Some of my node scripts depends on mongodb, which has loading delay. So, after system reboot i have some scripts started, but not working. Is there an ability to moderate loading order?

arvind-agarwal commented 8 years ago

@AlexFrost47rus although it can be done, my advise would be to make your application such a way that it can wait for resources to come up and/or reconnect. Since even if service starts, some times it may not mean your specific db has started (For e.g. it could be recovering). Also what if your database service restarts..?

haxecoder commented 8 years ago

All the scripts are saved with K20/S20 prefix at rcN.d So, im not very strong linux user, but if there is a way to set this prefix manually to prevent lower order of installed script on reboot. My scripts are reconnecting on error, so sometimes there are pretty fat error logs on reboot. They all work in the end, but i just want to exclude that scenario :)

haxecoder commented 8 years ago

Oh, yeah. Found it. update-rc.d script-base-name defaults 99, so default value will be 99