tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: /etc/rc.d/ as a bunch of symlinks



On Tue, Oct 8, 2013 at 5:51 PM, Aleksej Saushev <asau%inbox.ru@localhost> wrote:
> Paul Goyette <paul%whooppee.com@localhost> writes:
>
>> On Tue, 8 Oct 2013, Aleksej Saushev wrote:
>>
>>>>> Right now I do this:
>>>>> cp /usr/pkg/share/examples/rc.d/postfix /etc/rc.d/postfix
>>>>>
>>>>> which replacing the provided postfix.
>>>> You implicitly assume "/" and "/usr/pkg" reside on the same
>>>> filesystem.  It isn't always true in general.
>>>
>>> There's no such assumption. rcorder doesn't need anything besides the 
>>> script itself.
>>> Once the order is determined, rc has enough time to mount all necessary 
>>> file systems.
>>
>> This approach does, however, assume that any file system to
>> which any /etc/rc.d/* symlink points is available (ie, mounted)
>> at the time that rcorder runs!  rcorder needs to read the
>> various files in order to extract the REQUIRES/PROVIDES data
>> which is needed for sequencing.
>>
>> So, even if /usr/pkg/share/examples were made a "critical" file-system,
>> that would not be sufficient.  mountcritlocal doesn't run until
>> after rcorder has determined the sequence in which it (and
>> everything else) should be executed!
>
> This is true. What Matthew proposes (as I imagine it), is moving content
> of /etc/rc.d into /libexec/rc.d and populating new /etc/rc.d with symlinks
> pointing into /libexec/rc.d. Of course, it is possible, and one can do
> that easily. The remaining part is whether it gives enough advantage to
> justify the change. In my opinion, it gives very little advantage, if any.
> First, you can actually replace any base daemon by redefining variables
> in rc.conf, and if you cannot, it is a bug most probably. Second,
> if you're afraid of mixing rc scripts from various sources,
> you just introduce /etc/rc.pkg.d, /etc/rc.local.d, and so on.
> Third, if you're afraid of overwriting scripts in /etc/rc.d,
> you should learn about the content of /var/backups/etc/rc.d.
> At last, nobody stops you from doing such a change yourself.
>
> Thus it is better to stop worrying and accept the fact that the content of 
> /etc
> is not sacred and may be changed (including "services" and "protocols").
>
>
> --
> BCE HA MOPE!
>


This is roughly exactly what I had in mind.

My idea was also only linking in stuff you wanted/needed at boot, but
that breaks /etc/rc.d/foo onestart so I think the price might be too
high, even if the critical mount stuff was resolved.

I don't feel the contents of /etc are sacred, I just want something a
little more protected from upgrade mistakes while also giving a
standard-ish way to resolve the pkgsrc-missing-rc-script-installs
problem, to which I am currently devising another hack. ;)

Thanks for the feedback, I'll keep looking for solutions-
Matt


Home | Main Index | Thread Index | Old Index