8
I have severals RoR websites running on my webserver and I need to run a ruby script at startup.
So, I puted a bash script in /etc/init.d witch call a ruby process. Unfortunatly that ruby process needs some stuff that isn't loaded yet.
I tried to add a sleep 300
at the beginning of my bash script, but it doesn't really help because it also affect the startup of stuff like ssh, apache, etc...
Also, I don't want to load all the ruby libraries at startup, because it would slow down the boot time.
1It is unstable because usually delaying operations to fix a bug indicates a concurrency problem and adding a delay will work until your system gets slower/faster. – AsTeR – 2014-08-12T10:28:20.583
Why would it be unstable, sleep even provides
5m
syntax. I agree dependencies are the way to go, although boots that take more than five minutes should probably looked at and the RoR script failing is a good way to be brought to attention (but not the right way). – Tamara Wijsman – 2012-08-13T08:47:52.880