NetBSD Problem Report #17328
Received: (qmail 27389 invoked by uid 605); 19 Jun 2002 21:43:34 -0000
Message-Id: <20020619214250.3DA02ECE46@arnor.xavhome.fr.eu.org>
Date: Wed, 19 Jun 2002 23:42:50 +0200 (CEST)
From: xavier@xavhome.fr.eu.org
Sender: gnats-bugs-owner@netbsd.org
Reply-To: xavier@xavhome.fr.eu.org
To: gnats-bugs@gnats.netbsd.org
Subject: rc.local and rcorder(8)
X-Send-Pr-Version: 3.95
>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: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed Jun 19 21:44:00 +0000 2002
>Closed-Date: Fri Jun 17 05:02:31 +0000 2022
>Last-Modified: Fri Jun 17 05:02:31 +0000 2022
>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:
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: xavier@xavhome.fr.eu.org
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: misc/17328: rc.local and rcorder(8)
Date: Thu, 20 Jun 2002 19:37:24 +0200
On Wed, Jun 19, 2002 at 11:42:50PM +0200, xavier@xavhome.fr.eu.org wrote:
>
> >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
I think the proper way of solving this is to add the right REQUIREs
to local, as this is really was we want: we need it to start after
some other daemons, as these other daemons may be needed for local.
The linux way is too restrictive: there are situations were we want some
custom rc.d scripts to start after local (so just make them REQUIRE
local).
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--
From: xavier@xavhome.fr.eu.org (Xavier HUMBERT)
To: Manuel Bouyer <bouyer@antioche.lip6.fr>, <gnats-bugs@gnats.netbsd.org>
Cc:
Subject: Re: misc/17328: rc.local and rcorder(8)
Date: Thu, 20 Jun 2002 20:33:56 +0200
In message <20020620193724.A23898@antioche.lip6.fr>,
Manuel Bouyer wrote:
>I think the proper way of solving this is to add the right REQUIREs
>to local, as this is really was we want: we need it to start after
>some other daemons, as these other daemons may be needed for local.
>The linux way is too restrictive: there are situations were we want some
>custom rc.d scripts to start after local (so just make them REQUIRE
>local).
That was my first thought. Add a dummy dependancy like DAEMON, NETWORK,
etc. I found it too simple, and inelegant.
Oh, inelegant because I didn't intend to modify every rc.d file in order
to include a #BEFORE LOCAL keyword.
But, if the team thinks it is something acceptable, I should try to do
it and check the modif, then submit the diff files via send-pr.
Regards,
--
Xav
http://www.freetibet.org
http://www.tibet.fr/
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Xavier HUMBERT <xavier@xavhome.fr.eu.org>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: misc/17328: rc.local and rcorder(8)
Date: Thu, 20 Jun 2002 21:11:10 +0200
On Thu, Jun 20, 2002 at 08:33:56PM +0200, Xavier HUMBERT wrote:
> In message <20020620193724.A23898@antioche.lip6.fr>,
> Manuel Bouyer wrote:
>
> >I think the proper way of solving this is to add the right REQUIREs
> >to local, as this is really was we want: we need it to start after
> >some other daemons, as these other daemons may be needed for local.
> >The linux way is too restrictive: there are situations were we want some
> >custom rc.d scripts to start after local (so just make them REQUIRE
> >local).
>
> That was my first thought. Add a dummy dependancy like DAEMON, NETWORK,
> etc. I found it too simple, and inelegant.
>
> Oh, inelegant because I didn't intend to modify every rc.d file in order
> to include a #BEFORE LOCAL keyword.
You could make it depend on LOGIN instead of daemon, at last. This would make
it start in the same group as sshd,sendmail, inetd, etc ... This looks
good enouth for me ...
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
State-Changed-From-To: open->closed
State-Changed-By: kre@NetBSD.org
State-Changed-When: Fri, 17 Jun 2022 05:02:31 +0000
State-Changed-Why:
Closing this 20 year old PR, there is no good solution to deciding
when rc.local should be run - ordering depends upon what is being
done, and by its very definition, rc.local does site-dependent things.
When those should be run cannot possibly be centrally planned.
My personal opinion is that rc.local is a waste of time - though it is
trivial to use - and that sites should simply make, and install,
suitable rc.d scripts for anything they want to have run at startup
time, in which case they can be placed into the ordering scheme in
whatever place is appropriate (which isn't necessarily the same for
all local startups - someone might have custom hardware which needs
firmware loaded very early in the boot sequence for example - the same
site might want to enable some features of that hardware operationally
only after logins are enabled - rc.local cannot do both).
This PR was clearly going nowhere. It is now done.
>Unformatted:
># REQUIRE: DAEMON
># PROVIDE: local
># BEFORE: LOGIN
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.