git: c4bca1f88302 - main - New version of jng (9.2)
Devin Teske <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.src |
|---|---|
| Message-ID | <6a873d86.441d6.607c9a7b__39759.2892100633$1787248024$gmane$org@gitrepo.freebsd.org> |
The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=c4bca1f8830223766105af486ae70e78d67ae78a commit c4bca1f8830223766105af486ae70e78d67ae78a Author: Devin Teske <[email protected]> AuthorDate: 2026-08-20 17:44:55 +0000 Commit: Devin Teske <[email protected]> CommitDate: 2026-08-20 17:44:55 +0000 New version of jng (9.2) Use jail.conf(5) $name in the jail.conf examples so the jail name need only be set on the stanza. Keep host.hostname as xxx.yyy; a jail name is not a DNS label. Leave the rc.conf excerpt as xxx. Suggested by: jlduran MFC after: 1 week Reviewed by: kfv, jlduran Differential Revision: https://reviews.freebsd.org/D59032 --- share/examples/jails/jail.xxx.conf | 20 ++++++++++---------- share/examples/jails/jng | 28 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/share/examples/jails/jail.xxx.conf b/share/examples/jails/jail.xxx.conf index a007ba51c87d..9e36238096f3 100644 --- a/share/examples/jails/jail.xxx.conf +++ b/share/examples/jails/jail.xxx.conf @@ -1,7 +1,7 @@ xxx { host.hostname = "xxx.yyy"; # hostname - path = "/vm/xxx"; # root directory + path = "/vm/$name"; # root directory exec.clean; exec.system_user = "root"; @@ -12,24 +12,24 @@ xxx { # vnet; # netgraph - vnet.interface = "ng0_xxx"; # vnet interface(s) - exec.prestart += "jng bridge xxx em0"; # bridge interface(s) - exec.prestop += "ifconfig ng0_xxx -vnet xxx"; # return ifnet(s) - exec.poststop += "jng shutdown xxx"; # destroy interface(s) + vnet.interface = "ng0_$name"; # vnet interface(s) + exec.prestart += "jng bridge $name em0"; # bridge interface(s) + exec.prestop += "ifconfig ng0_$name -vnet $name"; # return ifnet(s) + exec.poststop += "jng shutdown $name"; # destroy interface(s) # if_bridge - #vnet.interface = "e0b_xxx"; # vnet interface(s) - #exec.prestart += "jib addm xxx em0"; # bridge interface(s) - #exec.poststop += "jib destroy xxx"; # destroy interface(s) + #vnet.interface = "e0b_$name"; # vnet interface(s) + #exec.prestart += "jib addm $name em0"; # bridge interface(s) + #exec.poststop += "jib destroy $name"; # destroy interface(s) # Standard recipe exec.start += "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown jail"; - exec.consolelog = "/var/log/jail_xxx_console.log"; + exec.consolelog = "/var/log/jail_${name}_console.log"; mount.devfs; # mount devfs # Optional (default off) #devfs_ruleset = "11"; # rule to unhide bpf for DHCP - #allow.mount; # mount /etc/fstab.xxx + #allow.mount; # mount /etc/fstab.$name #allow.set_hostname = 1; # Allow hostname to change #allow.sysvipc = 1; # Allow SysV Interprocess Comm. } diff --git a/share/examples/jails/jng b/share/examples/jails/jng index 0d997588369a..e8d24f3d00ab 100755 --- a/share/examples/jails/jng +++ b/share/examples/jails/jng @@ -7,7 +7,7 @@ ############################################################ IDENT(1) # # $Title: netgraph(4) management script for vnet jails $ -# $Version: 9.1 $ +# $Version: 9.2 $ # ############################################################ INFORMATION # @@ -22,15 +22,15 @@ # # xxx { # host.hostname = "xxx.yyy"; -# path = "/vm/xxx"; +# path = "/vm/$name"; # # # # # NB: Below 2-lines required -# # NB: The number of ngN_xxx interfaces should match the number of -# # arguments given to `jng bridge xxx' in exec.prestart value. +# # NB: The number of ngN_$name interfaces should match the number of +# # arguments given to `jng bridge $name' in exec.prestart value. # # # vnet; -# vnet.interface = ng0_xxx, ng1_xxx, ...; +# vnet.interface = ng0_$name, ng1_$name, ...; # # exec.clean; # exec.system_user = "root"; @@ -38,20 +38,20 @@ # # # # # NB: Below lines required -# # NB: The number of arguments after `jng bridge xxx' should match -# # the number of ngN_xxx arguments in vnet.interface value. -# # NB: Return each ngN_xxx to the host in prestop so the kernel does +# # NB: The number of arguments after `jng bridge $name' should match +# # the number of ngN_$name arguments in vnet.interface value. +# # NB: Return each ngN_$name to the host in prestop so the kernel does # # not move it during jail removal (BPF race). Destroy in poststop. # # -# exec.prestart += "jng bridge xxx em0 em1 ..."; -# exec.prestop += "ifconfig ng0_xxx -vnet xxx"; -# exec.prestop += "ifconfig ng1_xxx -vnet xxx"; -# exec.poststop += "jng shutdown xxx"; +# exec.prestart += "jng bridge $name em0 em1 ..."; +# exec.prestop += "ifconfig ng0_$name -vnet $name"; +# exec.prestop += "ifconfig ng1_$name -vnet $name"; +# exec.poststop += "jng shutdown $name"; # # # Standard recipe # exec.start += "/bin/sh /etc/rc"; # exec.stop = "/bin/sh /etc/rc.shutdown jail"; -# exec.consolelog = "/var/log/jail_xxx_console.log"; +# exec.consolelog = "/var/log/jail_${name}_console.log"; # mount.devfs; # # # Optional (default off) @@ -138,7 +138,7 @@ NG_BRIDGE_MAX_STALENESS=4294967295 ############################################################ GLOBALS -VERSION='$Version: 9.1 $' +VERSION='$Version: 9.2 $' pgm="${0##*/}" # Program basename