Page MenuHomeFreeBSD

sysctl: Add flags to filter jail prison and vnet variables
ClosedPublic

Authored by zlei on Mon, Oct 14, 2:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 11:30 AM
Unknown Object (File)
Mon, Oct 21, 11:17 AM
Unknown Object (File)
Sun, Oct 20, 2:41 PM
Unknown Object (File)
Sat, Oct 19, 11:38 AM
Unknown Object (File)
Sat, Oct 19, 11:38 AM
Unknown Object (File)
Sat, Oct 19, 11:38 AM
Unknown Object (File)
Sat, Oct 19, 11:26 AM
Unknown Object (File)
Tue, Oct 15, 1:31 PM

Details

Summary

So users do not have to contact the source code to tell whether a variable is a jail prison / vnet one or not.

MFC after: 1 week

Test Plan
# sysctl -aJ
kern.securelevel: -1
kern.hostname: 
kern.hostid: 34950370
kern.domainname: 
kern.hostuuid: 00000000-0000-0000-0000-50e54943d215
security.bsd.unprivileged_proc_debug: 0
security.bsd.suser_enabled: 1

# sysctl -aV net
net.inet.ip.portrange.randomized: 1
net.inet.ip.portrange.reservedhigh: 1023
net.inet.ip.portrange.hilast: 65535
net.inet.ip.portrange.hifirst: 49152
net.inet.ip.portrange.last: 65535
net.inet.ip.portrange.first: 10000
net.inet.ip.portrange.lowlast: 600
net.inet.ip.portrange.lowfirst: 1023
net.inet.ip.forwarding: 0
net.inet.ip.redirect: 1
net.inet.ip.ttl: 64
...

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

zlei requested review of this revision.Mon, Oct 14, 2:03 PM
zlei created this revision.
jlduran added inline comments.
sbin/sysctl/sysctl.8
115

VNET is generally capitalized.

Address @Jose 's comment.

zlei marked an inline comment as done.Tue, Oct 15, 4:54 AM

My personal usage is get vnet tunables via the combination of -J and -T. This has been in my local working tree for quite a long time, mainly to support working on D39638 .

@imp @emaste Any comments ?

Add network and Jails people if they have interests on this.

cy added a subscriber: cy.

LGTM

This revision is now accepted and ready to land.Thu, Oct 24, 4:15 PM
markj added inline comments.
sbin/sysctl/sysctl.c
172

Why -J and not, say, -V?

jamie added inline comments.
sbin/sysctl/sysctl.c
172

Why -J and not, say, -V?

For that matter, how about -V for CTLFLAG_VNET and -J for CTLFLAG_PRISON?

sbin/sysctl/sysctl.c
172

Why -J and not, say, -V?

Emm, I have future plan to have -j to chroot jail instance and retrieve sysctl values. That is much similar with what have done for ifconfig(8), 7e49aa86a282 ("ifconfig(8): Teach ifconfig to attach and run itself in a jail").

I choose -J short for ( filtering ) Jail vnet.

As for the -V, lots of utils use it either for the purpose version or verbose . So no favor for that unless strongly recommended.

sbin/sysctl/sysctl.c
172

Why -J and not, say, -V?

For that matter, how about -V for CTLFLAG_VNET and -J for CTLFLAG_PRISON?

Good point ! I did not realize we have CTLFLAG_PRISON -:)

sbin/sysctl/sysctl.8
115

Maybe .Xr jail 8 or just provide a bit more detail on what VNET means?

There is also VNET.9, but that is quite technical and deals with VNET internals.

sbin/sysctl/sysctl.c
172

I'd argue that -V is usually ok to use, it's just -v that conventionally means "version".

zlei retitled this revision from sysctl: Add -J flag to filter vnet variables to sysctl: Add -V flag to filter vnet variables.
zlei edited the test plan for this revision. (Show Details)

Use -V instead. Added Xr jail 8 .

This revision now requires review to proceed.Fri, Oct 25, 3:50 PM
zlei marked 3 inline comments as done.Fri, Oct 25, 3:53 PM

This change is focusing on VNET variables, but is open for -J ( CTLFLAG_PRISON ) if requested.

This change is focusing on VNET variables, but is open for -J ( CTLFLAG_PRISON ) if requested.

OK, requested :-). I think it makes sense to roll both nearly-identical changes together.

zlei retitled this revision from sysctl: Add -V flag to filter vnet variables to sysctl: Add flags to filter jail prison and vnet variables.
zlei edited the summary of this revision. (Show Details)
zlei edited the test plan for this revision. (Show Details)

Added -J flag to filter jail prison variables.

This revision is now accepted and ready to land.Mon, Oct 28, 1:13 PM