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)
Sep 22 2024, 6:59 PM
Unknown Object (File)
Sep 22 2024, 12:16 AM
Unknown Object (File)
Sep 19 2024, 2:38 AM
Unknown Object (File)
Sep 18 2024, 5:06 AM
Unknown Object (File)
Sep 17 2024, 7:40 PM
Unknown Object (File)
Sep 17 2024, 11:57 AM
Unknown Object (File)
Sep 16 2024, 5:43 AM
Unknown Object (File)
Sep 14 2024, 11:35 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.