RFC: Alternate patch to have true new-style rc.d scripts inports (without touching localpkg)

Oliver Eikemeier eikemeier at fillmore-labs.com
Sat Jul 31 02:53:04 PDT 2004


Rob MacGregor wrote:

>> -----Original Message-----
>> From: owner-freebsd-current at freebsd.org
>> [mailto:owner-freebsd-current at freebsd.org] On Behalf Of
>> Oliver Eikemeier
>>
>> I don't think so. The patch is completely backwards compatible, which
>> means everything will run as it did before. Why should anyone be
>> confused by that?
>
> However, everybody who's used to disabling scripts by changing the name 
> such
> that it doesn't end in .sh is going to be badly bitten by this.  
> Suddenly all
> those "disabled" startup scripts will run.

Nope, only two kinds of scripts will be run: old-style scripts with a 
`.sh' extension, and new-style rc.d scripts without extension. So you 
should not run into an trouble with scripts renamed to `.old' or 
`.disabled', except when you got into the habit to *remove* the 
extension to disable the scripts. As stated before: localpkg will not be 
touched and continue to work as before.

>> As stated above: everything users did before will continue to work.
>
> Except of course, disabling scripts by renaming them :)

See above.

>> Besides, the patch finally unifies /etc/rc.d and
>> /usr/local/etc/rc.d in
>> the most important aspect: participating in rcorder(8). A new-style
>> script will do the same, no matter whether put in /etc/rc.d or
>> /usr/local/etc/rc.d.
>
> Which is one thing I would like to see.

Especially since we can start some ports early in the startup process.

>>> Additionally,
>>> if ports rc.d scripts are going to participate in the boot
>> rcorder(8)ing
>>> then they need to behave like the base system rc.d script.
>>
>> Jup, that is the purpose of this patch.
>
> Why not simply (yeah, I know, it'll be far from simple to implement) 
> treat any
> .sh scripts that have the FreeBSD keyword as being new style, and 
> others as
> being old style?

This is simple, but wrong IMHO. Recent experience showed us that only 
because a .sh script has a FreeBSD keyword, it does not qualify as a new 
style script. Basically all current scripts rely on the documented 
behaviour in rc(8). To qualify as a new style script they have to be 
rewritten to work with the new semantics, and installed without an 
extension. Blindly changing documented behaviour will cause a major 
breakage.

-Oliver



More information about the freebsd-rc mailing list