Can't run init script on boot after another init script

Posted by Colin McQueen on Ask Ubuntu See other posts from Ask Ubuntu or by Colin McQueen
Published on 2012-06-12T15:32:42Z Indexed on 2012/06/13 10:48 UTC
Read the original article Hit count: 618

Filed under:
|
|

I have three init scripts and the Broker init script runs fine, but when I try to run the Consumer init script and then the Data Collector init script, the only process that is running is the Broker.

I added the symbolic links to the run levels using update-rc.d for each script and I also changed the number prefixes in the symbolic links to try and run the scripts in the proper order but that did not work.

I am able to run the scripts from the terminal and they work fine but they need to all be started on boot.

Any ideas as to why my other scripts are not running?

Also inside my Consumer and Data Collector I am running:

su user1 -c 'java -jar foo.jar'

to start the services.

Also the Consumer Java class sits and waits for a message from the queue, so the Java code does not stop until I specify the stop argument for the init script. The Broker has to start first, then the Consumer, then the Data Collector.

Adding the symbolic links for the runlevels:

sudo update-rc.d Broker defaults 10 90
sudo update-rc.d Consumer defaults 15 85
sudo update-rc.d DataCollector defaults 20 80

© Ask Ubuntu or respective owner

Related posts about scripts

Related posts about init.d