Startup script on Ubuntu 12.04 not getting executed. Dependencies / load order.

Posted by user861181 on Super User See other posts from Super User or by user861181
Published on 2012-07-27T19:03:55Z Indexed on 2012/11/13 23:09 UTC
Read the original article Hit count: 309

Filed under:
|
|

I want to create a simple startup script on Ubuntu 12.04:

myscript.sh

#!/bin/sh
sudo /etc/init.d/nginx start
cd ~/app/current
god -c config/resque.god
sudo /etc/init.d/redis-server start
echo "SCRIPT RUN"

I have it at /etc/init.d/myscript.sh

When I do

sudo chkconfig --level 2345 myscript.sh

I get myscript.sh 2345

When I do

 sudo chkconfig --add myscript.sh

I get

insserv: warning: script 'K01myscript.sh' missing LSB tags and overrides
insserv: warning: script 'myscript.sh' missing LSB tags and overrides
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'dbus' missing LSB tags and overrides
....
myscript.sh               0:off  1:off  2:on   3:on   4:on   5:on   6:off

** EDIT::

I checked the boot.log and it turns out that the script is run, but the problem is that god is not loaded yet when the script is executed. Apparently I want to load this script as the very last thing at startup (or somehow check if god is loaded and then start the script).

© Super User or respective owner

Related posts about ubuntu

Related posts about startup