News for hackers. Stuff that matters.
Re:rc.d belongs in libexec, not etc by waheoo on Tuesday August 25, 2020 @12:31AM (#24268135)
> August 24, 2020

Unexpected to say the least.

Good read though, mostly agree.

> My main gripe is that the files under /etc/rc.d/ are immutable scripts.

Are they though? A lot of, well at least old software, lacked configuration files, their command line flags and unit scripts were for all intensive purposes, their config files.

Whether this actually makes upgrade harder (the next point made), is kind of debatable no?

Arch does fine with pacsave and pacnew files.

Making changes or tracking changes to these files is going to be required regardless from a systems upgrade point of view - because people want control over their system units.

And for what its worth, I'd rather find out about a breaking update via pacsave/new than figure it out months later when my copied but now outdated and untracked unit starts failing.

Re:rc.d belongs in libexec, not etc by krastanov on Tuesday August 25, 2020 @12:35AM (#24268147)
Just a minor grammar point that does not detract from your argument: It is "for all intents and purposes", not "intensive purposes" https://www.dictionary.com/e/for-all-intents-and-purposes-vs...
Re:rc.d belongs in libexec, not etc by adzm on Tuesday August 25, 2020 @01:07AM (#24268268)
These kinds of substitutions are called eggcorns (like acorns) https://en.wikipedia.org/wiki/Eggcorn
Re:rc.d belongs in libexec, not etc by Zamicol on Tuesday August 25, 2020 @01:09AM (#24268274)
My household has started calling them "Bone Apple Teas".

https://old.reddit.com/r/BoneAppleTea/

My favorite being a friend called a cul-de-sac a "culture sack". Years later we still laugh about this one.

Re:rc.d belongs in libexec, not etc by jacobush on Tuesday August 25, 2020 @01:12AM (#24268289)
It’s also true
Re:rc.d belongs in libexec, not etc by eindiran on Tuesday August 25, 2020 @01:15AM (#24268300)
Geoffrey Pullum, who came up with the term "eggcorn", also came up with "snowclone" [0]. He has had a lot of very interesting posts on Language Log [1].

[0] https://en.wikipedia.org/wiki/Snowclone

[1] http://www.lel.ed.ac.uk/~gpullum/langlog-posts.html

Re:rc.d belongs in libexec, not etc by m0xte on Tuesday August 25, 2020 @02:31AM (#24268629)
Language Log is brilliant. Perfect morning reading with my coffee. “Orca emits speech-like sound; reporters go insane“ says more about our culture and media than anything I’ve read for years. Thanks for posting the link.
Re:rc.d belongs in libexec, not etc by waheoo on Tuesday August 25, 2020 @03:32AM (#24268924)
Til, but I don't even know if I'll change, intents and purposes sounds wrong. :|
Re:rc.d belongs in libexec, not etc by krastanov on Tuesday August 25, 2020 @12:09PM (#24272801)
"Intents and purposes" has a meaning on its own word-by-word. Not so much with the eggcorn. What is "intensive" about the "purpose" in "intensive purposes"?
Re:rc.d belongs in libexec, not etc by masklinn on Tuesday August 25, 2020 @03:32AM (#24268922)
> Are they though? A lot of, well at least old software, lacked configuration files, their command line flags and unit scripts were for all intensive purposes, their config files.

Most of the article is dedicated to explaining how modern BSDs changed from these origin and how system owners are very much expected not to edit these scripts so… yes, they are?

> Whether this actually makes upgrade harder (the next point made), is kind of debatable no?

Not it’s not? The article explains exactly how: BSD upgrade process diffs and merged every config file, which includes core rc scripts which the system owner would or should not have edited. So said system owner finds themselves spammed with every upstream update to scripts they never touched, none of which would be relevant to them.

If you argue that this is a good thing, then surely they should also be spammed with upstream updates to every binary, utility or script these use?

> Arch does fine with pacsave and pacnew files.

The article is not about arch?

> Making changes or tracking changes to these files is going to be required

No.

> And for what its worth, I'd rather find out about a breaking update via pacsave/new than figure it out months later when my copied but now outdated and untracked unit starts failing.

Does pacsave/pacnew force you to review every built-in systemd unit?

Re:rc.d belongs in libexec, not etc by geofft on Tuesday August 25, 2020 @03:41AM (#24268979)
The claim is that the Arch pacman mechanism (and the dpkg one, and the rpm one, and ...) only prompts you when there is an actual merge, and when it does that, it's actually fine and preferable for the package manager to leave old and new versions on disk and ask the sysadmin to resolve the merge by hand, and this works in practice. It does not ask you to review every change to /etc. This is why Arch is mentioned, as an example of a system where this situation works fine. (Debian and Fedora are also good examples.)

If the BSDs' upgrade procedure cannot distinguish between changes to /etc where the local sysadmin has also modified the file and changes to /etc where the file is unmodified, and they prompt you to review every single change to /etc, that seems like an easily fixable missing feature.

Do the BSDs really prompt you to accept every change to /etc on upgrade for files you didn't modify, such as sshd.conf or services?

Re:rc.d belongs in libexec, not etc by zaarn on Tuesday August 25, 2020 @03:02AM (#24268768)
I would argue that /etc/rc.d should be moved to /lib/exec and then use /etc/defaults files to load command line flags from environment variables. This separates the core of the service file you are unlikely to touch ever from the parts you want to touch and makes upgrades easier. It would also avoid or atleast minimize pacnew/pacsave files.
Re:rc.d belongs in libexec, not etc by JdeBP on Tuesday August 25, 2020 @05:43AM (#24269592)
The headlined article is not about Arch, and already pointed out the existence of /etc/rc.conf (albeit that there are actually a couple of other files) containing the variable settings that configure the scripts, as documented on the rc.conf manual page.
Re:rc.d belongs in libexec, not etc by zaarn on Tuesday August 25, 2020 @06:07AM (#24269732)
pacsave/pacnew is how arch deals with some of these problems, but i wasn't talking about anything arch specific
Re:rc.d belongs in libexec, not etc by JdeBP on Tuesday August 25, 2020 @06:44AM (#24269933)
Yes you were. You were talking about pacsave/pacnew. There are no such things on the operating systems discussed in the headlined article.
Re:rc.d belongs in libexec, not etc by zaarn on Tuesday August 25, 2020 @06:55AM (#24270003)
Okay, to elaborate, a solution like the one proposed in the article, if implemented on ArchLinux, would prevent or minimize pacnew/pacsave. That doesn't make the rest of the comment irrelevant because pacnew/pacsave are specific to arch, hence that very sentence being only specific to arch. I mentioned them mostly because the top comment in this thread also mentioned them briefly.

I hope that ELI5 was sufficient for you.

Re:rc.d belongs in libexec, not etc by waheoo on Tuesday August 25, 2020 @03:35AM (#24268945)
It has the same problem of separating concerns (for what?) but losing important context making things harder to reason about.

Normal form isn't always the best answer, sometimes a flat cludge is the better solution.

Re:rc.d belongs in libexec, not etc by zaarn on Tuesday August 25, 2020 @03:38AM (#24268965)
Why shouldn't this be separated?

All files that the distributor ships as configured ought to be put into /lib or /usr. Any system specific configuration belongs to /etc, but ONLY that configuration.

On a fresh install of BSD/Linux I'd love to see an empty /etc directory sans any necessary overrides to make it boot.

Makes backing up that directory a lot easier too.

Re:rc.d belongs in libexec, not etc by jlg23 on Tuesday August 25, 2020 @04:12AM (#24269151)
> On a fresh install of BSD/Linux I'd love to see an empty /etc directory sans any necessary overrides to make it boot.

And I rather have a full set of configuration files that specifies the defaults at the time of the installation so my system even boots after an update in which some program changed its hardcoded defaults.

> Makes backing up that directory a lot easier too.

I don't really understand what the problem with backing up 0.1 or 1.0MB is.

Re:rc.d belongs in libexec, not etc by zaarn on Tuesday August 25, 2020 @04:26AM (#24269232)
Well, the specified defaults are in a folder in /lib or /usr. You can find them there and copy them to /etc or just write what you change.

The issue is not how much is backed up but what.

If /etc only represents changes to system defaults, then the backup represents a list of my changes and it's always easily visible from each full snapshot what changes were active in the system at that time.

If /etc contains all configuration, then from a single backup snapshot, you cannot determine what changes where made to the system.

This would be an issue if you're trying to recover the backup to a freshly installed system, for example, because you cannot tell what changes you have made vs what changes occured in the backup due to updates or upstream due to updates since the backup.

It's a semantic difference that can make restoring backups easier and replicable across different systems.

Re:rc.d belongs in libexec, not etc by jlg23 on Tuesday August 25, 2020 @05:27AM (#24269511)
a) Not all programs can read multiple configuration files. It's either in the one configuration file or a hardcoded default.

b) Not all settings done in defaults can be simply undone later on (e.g.: apache's httpd.conf, IIRC the same for nginx - good luck getting this default listener down again)

c) If you want to infer which changes were made by you or by the system's update procedures, explicitly creating snapshots before every manual or automatic modifications would be the way to go. Preferably one after each as well, so you have something to verify the integrity of a system against in case of security issues.

Re:rc.d belongs in libexec, not etc by zaarn on Tuesday August 25, 2020 @06:27AM (#24269834)
a) and b) are just issues with common software being idiotic about configuration and insisting one a "one truth" central config file.

c) As mentioned above, inferring changes requires two snapshots, if /etc only contains changes a single snapshot allows me to infer changes. And I can verify the integrity just as well using an "after" snapshot. Just means one less snapshot is involved, which is reduced complexity.

Re:rc.d belongs in libexec, not etc by waheoo on Tuesday August 25, 2020 @11:25AM (#24272290)
Sadly, I have to deal with idiotic software, so where does that leave me?
Re:rc.d belongs in libexec, not etc by zaarn on Wednesday August 26, 2020 @08:15AM (#24281694)
Fork it?