I use foreman to run my node.js applications on the production servers (ubuntu server 12). Foreman has a great tool to create scripts for upstart.
The problem is that when I reboot a server, my application (managed by foreman) is launched before redis-server and I've to build some tricks in order to wait for a valid connection.
The ideal solution will be to start redis-server earlier, and hen the node application when all is started.
Boot configuration :
- redis-server is launched by /etc/init.d/redis-server and is /etc/rc2.d/S20redis-server
- my node application is started with /etc/init/stocks-streamer*.conf files
My question is : how would you change the boot order of my node application? I want to wait for redis-server before my application starts but when I do this, it doesn't start :
start on (started redis-server)
I imagine that it's because no events are sent from init.d scripts to upstart but perhaps there is a way I don't know ?
Thanks by advance for your help !