Subject: misc/17328: rc.local and rcorder(8)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <xavier@xavhome.fr.eu.org>
List: netbsd-bugs
Date: 06/19/2002 23:42:50
>Number:         17328
>Category:       misc
>Synopsis:       rc.local is called in alphabetical order, not at the (nearly) end of rc process
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 19 14:44:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Xavier HUMBERT
>Release:        NetBSD 1.6B (06/19/2002 21:00 GMT)
>Organization:
>Environment:
System: NetBSD arnor.xavhome.fr.eu.org 1.6B NetBSD 1.6B (XAVIER) #12: Wed Jun 19 22:00:17 CEST 2002 root@arnor.xavhome.fr.eu.org:/usr/src/sys/arch/i386/compile/XAVIER i386
Architecture: i386
Machine: i386
>Description:
rc.local claims to be "(nearly) the last thing invoked by /etc/rc".

This is not true.

Actually, rc.local is invoked in alphabetical order, this means on a
typical server after `dhcpd`, _but before_ `named` and other important
daemons. This is really annoying, especially for the blatant case of
named, when you call wrappers for those daemons in rc.local.

This is obvious when looking at the dependancies in /etc/rc.d/local :
>How-To-Repeat:
>Fix:
I think this can be solved in two ways :

- add a new keyword to rcorder(8), like does startup mechanism in Darwin :
#ORDER {EARLY|NORMAL|LATE}
Which rcorder should use as a primary key in crunch_file()
This is not a trivial change, but should help for other startup files.

- the (ahem) Linux way: remove /etc/rc.d/local which is imho useless
with so weak dependancies, and add `sh /etc/rc.local` at the very end
of /etc/rc. Ditto in rc.shutdown, call /etc/rc.shutdown.local _before_
rc.d files

>Release-Note:
>Audit-Trail:
>Unformatted:
 ># REQUIRE: DAEMON
 ># PROVIDE: local
 ># BEFORE:  LOGIN