Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 12887

Summary: rc scripts excution order
Product: Gentoo Linux Reporter: Zhen Lin <lowzl>
Component: [OLD] Core systemAssignee: Martin Schlemmer (RETIRED) <azarah>
Status: RESOLVED FIXED    
Severity: minor CC: vapier
Priority: High    
Version: 1.4_rc1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: rc script
rc script that is misbehaving
/sbin/runscript.sh

Description Zhen Lin 2002-12-29 01:41:19 UTC
rc scripts are started and stopped in alphabetical order, with deviations caused
by need, use, after and before. I believe that rc scripts should be stopped in
reverse alphabetical order, instead of in alphabetical order for a proper
mirrored start/stop order.

Also, I have noticed that one of my rc scripts that 'needs net' is stopped after
one of net services has stopped. In particular, the service in question is named
'noip' and the net service is named 'net.adsl' (net.adsl is 'after net.eth0')
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-29 04:41:06 UTC
If they have a before or after, that is reversed.  If there are no relationship,
I do not see the point.

Send me a tarball of your /mnt/.init.d/

The 'noip' and 'net.*' services .. in what runlevel ?   If all in default,
please go out of X for instance, and run:

 # rc boot

Then send me the output.  Also send me a second tarball of /mnt/.init.d/
when in the boot runlevel.

To restore default runlevel, run:

 # rc default


Thanks.
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-29 19:12:53 UTC
Ok, two things:

1)  The depend() stuff in noip is wrong.  All the needs should be on one line.

2)  Please send me the noip script as well, thanks.
Comment 3 Zhen Lin 2002-12-30 19:36:59 UTC
Created attachment 6856 [details]
rc script

This is the net script in question
Comment 4 Zhen Lin 2002-12-30 19:44:08 UTC
Created attachment 6857 [details]
rc script that is misbehaving

This is the rc script that is misbehaving
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-31 17:56:07 UTC
Ok, I think I know what the problem is .. looks to be related to my last
RC_NET_STRICT_CHECKING related changes.  Will fix and send you a test version
in the next day or two.
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-02 19:09:32 UTC
Created attachment 6915 [details]
/sbin/runscript.sh

Copy this to /sbin, and let me know if it fixes the problem, thanks.
Comment 7 Zhen Lin 2003-01-02 19:19:38 UTC
Thanks, but it seems to have cleared up by itself suddenly, although the diffs
are interesting to look at... Perhaps I should shange net.adsl to net.ppp0.
Comment 8 Zhen Lin 2003-01-02 19:22:17 UTC
Oh, what are these changes for?

597c597
< 		cp ${svcdir}/started/* ${svcdir}/snapshot/
---
> 		cp -a ${svcdir}/started/* ${svcdir}/snapshot/
601c601
< 		if [ -n "$(egrep 'restart()' /etc/init.d/${myservice})" ]
---
> 		if [ -n "$(egrep '^[[:space:]]*restart[[:space:]]*()'
/etc/init.d/${myservice})" ]

I can understand cp -a, why wasn't it there in the first place? And what about
the other change?
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-02 19:39:57 UTC
Err, forgot the -a first time =)  The grep changes is for the new bind that
trigger that wrongly.

Anyhow, It was really a bug in the scripts, they should not expect 
net\..*[[:digit:]], but work with any net.* ...
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-27 12:09:16 UTC
This should be fixed in latest unstable baselayouts.  Reopen and let me know
what/how it is breaking if not.
Comment 11 Zhen Lin 2003-04-28 04:40:15 UTC
The problem seems to have been fixed... But some programs that depend on net are still stopping after my ADSL has shut down. Squid, for instance. net I believe is still being shut down in two stages... I'll have to check. 

I'll test the new baselayout... Which one is it?
Comment 12 Zhen Lin 2003-04-28 08:55:54 UTC
Sorry, silly mistake. It's working fine now.