LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to auto-start the processes one after another is started? (http://www.linuxquestions.org/questions/linux-software-2/how-to-auto-start-the-processes-one-after-another-is-started-895484/)

thomas2004ch 08-04-2011 03:45 AM

How to auto-start the processes one after another is started?
 
I have two script under /etc/init.d/ 'jboss' and 'client'. By machine-reboot these two scripts will be run.

But what I want now is: The 'client' can only be run after the 'jboss' is successfully up.

How to do?

Regards

Thomas

minnarky 08-04-2011 06:24 AM

rename the client script to zzclient (or any letter that comes after j), I believe they are processed in alphabetical order.

thomas2004ch 08-04-2011 09:07 AM

Quote:

Originally Posted by minnarky (Post 4433489)
rename the client script to zzclient (or any letter that comes after j), I believe they are processed in alphabetical order.

are U sure?

tredegar 08-04-2011 04:35 PM

Quote:

are U sure?
Why did you not you try, or test this out, for yourself, instead of reposting?
And you appear to be lazy when you type "U" instead of "you". Please spell your words properly.

But bash has the && operator:
Code:

#!/bin/bash
script1 && script2

means that script2 will only execute if script1 ran without errors.

So maybe use that.

ntubski 08-05-2011 10:05 AM

Quote:

Originally Posted by minnarky (Post 4433489)
rename the client script to zzclient (or any letter that comes after j), I believe they are processed in alphabetical order.

No, for sysVinit the order is determined by the symlinks in /etc/rc.d/rcX.d (where X is the runlevel). See SysVinit explained. Bsd style init (used by Slackware) has a different system.


All times are GMT -5. The time now is 06:07 AM.