Page MenuHomeFreeBSD

Add support for sysctl.conf.d
ClosedPublic

Authored by antranigv_freebsd.am on Sep 24 2021, 11:36 PM.
Tags
Referenced Files
Unknown Object (File)
Feb 13 2024, 10:55 PM
Unknown Object (File)
Jan 13 2024, 6:31 AM
Unknown Object (File)
Jan 1 2024, 1:23 PM
Unknown Object (File)
Dec 20 2023, 6:42 AM
Unknown Object (File)
Dec 10 2023, 8:20 PM
Unknown Object (File)
Oct 30 2023, 11:09 AM
Unknown Object (File)
Oct 30 2023, 11:09 AM
Unknown Object (File)
Oct 30 2023, 11:09 AM

Details

Reviewers
kevans
Group Reviewers
manpages

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41744
Build 38633: arc lint + arc unit

Event Timeline

0mp added inline comments.
libexec/rc/rc.d/sysctl
30

Is there any guarantee about the order of globbing here? I took a quick look at the sh manual page but i couldn't find anything relevant right away.

libexec/rc/rc.d/sysctl
30

Apologies, I don't understand what order of globbing means. Can you elaborate?

libexec/rc/rc.d/sysctl
30

Sure! So when you run a command like echo * you are going to echo all the file names in the directory to stdout. That's something we all know. Now, I wonder if the list of matching filenames is always sorted. Usually, it is, but I'm not sure if that's a guarantee.

Side note: I'd expect this to be described in subsection "Pathname Expansion (File Name Generation)" in the manual for sh(1) but it isn't.

In the end, I wonder if you can control the order your /etc/sysctl.conf.d/*.conf are sourced.

libexec/rc/rc.d/sysctl
30

Oh, I see now!

I ran this in FreeBSD, looks like they are string sorted.

$ for _f in ./*.conf; do
echo ${_f}
done
./01-foo.conf
./02-bar.conf
./1-baz.conf
./10-z.conf
./12-bar.conf
./2-baz.conf
./bar.conf
./foo.conf
./z.conf
jilles added inline comments.
libexec/rc/rc.d/sysctl
30

POSIX requires pathname generation to sort according to the current locale's collating sequence, and FreeBSD sh and other shells implement this (although older implementations might sort by character code).

This piece of information is indeed missing from the sh(1) manual page.

bcr added a subscriber: bcr.

OK from manpages.
Would be good to see some progress on this.

This revision is now accepted and ready to land.Jul 15 2023, 1:01 PM

Follow-up to discussion in IRC,

This has landed …

I think, what landed there made it easier to progress things (not necessarily close off) here.