Solved How to ensure service scripts executed in specific order?

We have a couple of service scripts - one is dependent on the other. I've read up on rcorder and using BEFORE - but there's no examples, no idea what I can put after the BEFORE, i.e.
Code:
#!/bin/sh

# PROVIDE: eidsapi
# REQUIRE: DAEMON 
# KEYWORD: shutdown 
# BEFORE: ??
I saw one example actually, and apparently you can put LOGIN to start services before logins. But nowhere is there a list. I tried putting the other service there like
#BEFORE: myotherservice

No luck.

So how stupid am I? Somebody tell me! LOL
 
All the start/stop scripts are named in /etc/rc.d. That IS the list.

Scripts named in upper case like DAEMON are dummy (compound) services that apply to a generic concept that may involve a group of several separate services. The dummies exist as files, and have dependencies but nothing else, so they just impact on the order of a bunch of other things.

Dependencies in lower case refer to individual services that need to be started and stopped.

You can look in the files in /etc/rc.d to see their dependencies and what they do.

What goes after BEFORE: is the name of one or more services (i.e. file names that exist in /etc/rc.d).
 
hmmm, thanks. That's what I tried once, perhaps it's a typo or other odd thing. But, good to know I'm on the right track, I'll keep trying that.
If at first you don't succeed...welp, so much for skydiving!
 
We have a couple of service scripts - one is dependent on the other. I've read up on rcorder and using BEFORE - but there's no examples, no idea what I can put after the BEFORE, i.e.
Code:
#!/bin/sh

# PROVIDE: eidsapi
# REQUIRE: DAEMON
# KEYWORD: shutdown
# BEFORE: ??
I saw one example actually, and apparently you can put LOGIN to start services before logins. But nowhere is there a list. I tried putting the other service there like
#BEFORE: myotherservice

No luck.

So how stupid am I? Somebody tell me! LOL

Setting
Code:
# BEFORE: LOGIN
would only require that this script be executed BEFORE that placeholder. To see the execution order of these scripts, use /sbin/rcorder /etc/rc.d/* /usr/local/etc/rc.d/* 2>>/dev/null | /usr/bin/less. Then, once you make your changes to this script, re-check the order using the same command above (rcorder). Repeat this until you find the placement you're looking for.

In the future, make sure you read through these manpages as they contain your answer(s):
rc(8)
rcorder(8)
 
running the rcorder command greatly helped. Turns out if was another dependency (cassandra) that took yet another BEFORE on the other service file. But got er done! Thanks guys! Marking as solved.
 
Back
Top