View previous topic :: View next topic |
Author |
Message |
overkll Veteran
Joined: 21 Sep 2004 Posts: 1249 Location: Austin, Texas
|
Posted: Fri Oct 12, 2007 2:40 pm Post subject: init script order: How to determine order WITHOUT rebooting? |
|
|
Anyone know how to list/determine the order of execution of the initscripts without rebooting?
rc-update can show what will be started, but not the order. Kind of a pain in the ass to try and figure it out by looking at the "depends" function in every init script. I know about the /etc/init.d/<service> (ineed|iuse|needsme|usesme) capability, but again, one needs to look at every script and try to order it up manually.
There should be something simple like "rc-update show order" or "/sbin/rc --pretend". Anyone out there with the answer? Inquiring minds want to know. |
|
Back to top |
|
|
overkll Veteran
Joined: 21 Sep 2004 Posts: 1249 Location: Austin, Texas
|
Posted: Sat Oct 13, 2007 2:08 pm Post subject: |
|
|
-bump-
Nobody? |
|
Back to top |
|
|
overkll Veteran
Joined: 21 Sep 2004 Posts: 1249 Location: Austin, Texas
|
Posted: Mon Oct 15, 2007 2:26 pm Post subject: |
|
|
Well, since I didn't think this feature existed, I filed a bug report. Looks like the feature will be added to baselayout-2.0.0_rc6. |
|
Back to top |
|
|
nordic bro Guru
Joined: 25 Oct 2003 Posts: 585
|
Posted: Mon Oct 15, 2007 4:33 pm Post subject: |
|
|
Sweet. I'm glad nobody answered your post |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Mon Oct 15, 2007 6:19 pm Post subject: |
|
|
Actually, I did answer, but I quickly deleted my post when I discovered it wasn't 100% accurate.
I recommended this: Code: | source /lib/rcscripts/sh/rc-services.sh
list=""
for x in /var/lib/init.d/softscripts/*; do list="${list} ${x##*/}"; done
trace_dependencies $list |
Near as I could tell from reading the source, that's how /sbin/rc determines the script order when changing runlevels. Yet it doesn't match my boot order (e.g., local is listed somewhere in the middle) so I must have overlooked something. I'd be interested to know what.... _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
overkll Veteran
Joined: 21 Sep 2004 Posts: 1249 Location: Austin, Texas
|
Posted: Mon Oct 15, 2007 6:37 pm Post subject: |
|
|
When I was digging around for an answer, I came across /var/lib/init.d/deptree. AFAIK, this is where the order is stored. I didn't feel like trying to decifer it at the time. |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Mon Oct 15, 2007 7:08 pm Post subject: |
|
|
Yes, that is the dependency tree. It's essentially the depends information from the init scripts (need, before, after, etc.) recast as a collection of bash arrays. The trace_dependencies function from /lib/rcscripts/sh/rc-services.sh uses that structure to determine the ordered dependencies of any given script. The section of /sbin/rc that starts services is little different from what I posted above, yet the order comes out different...puzzling. _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
|