Re: init-config has incorrect path for /etc/rc.d/rc [FIX]

Bruce Jerrick via Cygwin <[email protected]>
Newsgroups gmane.os.cygwin
Message-ID <[email protected]>
On 1/13/26 22:09, matthew patton wrote:

> or is it a case someone broke/removed the symlink from /etc/rc to /etc/rc.d/rc? Or more correctly /etc/rc -> /etc/init.d/rc.Removed, I believe, not broke.  See below re executables in /etc .

> /etc/rc dates back to SunOS v4 at least. Similarly /etc/init and /sbin/init.
Long before any SunOS or BSD.  It was probably in Version 6 Unix .
Way back then (as they say), /etc contained "system" executables, as 
well as config files.
The executables were eventually moved to /sbin .  I don't remember if 
that happened in BSD or SunOS.  It was /sbin, then, not /usr/sbin, 
because they had to be available before /usr was mounted (SunOS commonly 
got a read-only /usr via NFS).

> /etc/rc.d (and children like /etc/rc[0-6].d) is more of a "expression of state" directory.
Agreed, but only in regard to /etc/rc.d/rc[0-6].d .
(A better name for /etc/rc.d (or /etc/init.d) would be /etc/init, since 
a ".d" suffix usually implies optional contents.)

> The actual scripts are supposed to live in /etc/init.d/.
See my "ideal" fix below.
'rc' and rc.sysinit are special cases -- they're called via
/etc/inittab, and don't have to be added to the rc[0-6].d dirs.
rc.local is also a special case -- it's source'd rc.sysinit .

> Your local /etc/inittab should be FULL of references to /etc/init.d/rc like so:
> ...
> # System initialization
> si::sysinit:/etc/init.d/rcS
> 
> # Runlevel scriptsI woul
> l0:0:wait:/etc/init.d/rc 0
> l1:1:wait:/etc/init.d/rc 1
> l2:2:wait:/etc/init.d/rc 2
> l3:3:wait:/etc/init.d/rc 3
> l4:4:wait:/etc/init.d/rc 4
> l5:5:wait:/etc/init.d/rc 5
> l6:6:wait:/etc/init.d/rc 6
Not so in /etc/defaults/etc/inittab -- those subdirs are all "rc.d", not 
init.d .  See my comments above re 'rc' being a special case.


In any case, the patches I suggested are a minimal fix to a broken
init-config (I'm not being argumentative, just pragmatic :).

I would regard the "ideal" fix to be:
   Rename /etc/rc.d/ to be /etc/init/ .
   Retain rc, rc.sysinit, and rc.local in /etc/init/ .
   Move /etc/rc.d/init.d/functions to /etc/init/ .
   Reserve /etc/init/init.d/ for locally-added scripts.
   (And, of course, tweak all the affected paths everywhere.
    Unfortunately, that includes /usr/sbin/chkconfig.exe .)

-- Bruce Jerrick

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.