Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question

2 Answers 2

I got it to work. I made the Broker a background process because it constantly runs until I shutdown the computer or call the script with the shutdown parameter. I also made the Consumer a background process.

Broker Init Script

su user1 -c 'qpid-server &'

Consumer Init Script

su user1 -c 'java -jar foo.jar &'
share|improve this answer

Sounds like the java command never completes, and thus the rest of the init scripts do not start. Try something like:

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

and I think that you'll find that the rest of the init startup sequence will work.

share|improve this answer
    
It did not work because I was not able to see it in the process list using: ps -ef –  Colin McQueen Jun 12 '12 at 18:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.