Introduce new per-jail variable jail_<name>_flags, which allows to specify
jail(8) flags (before the change we had hardcoded "-l -U root"). Submitted by: Frank Behrens <frank@pinky.sax.de> PR: conf/80244 Approved by: re (scottl) MFC after: 1 week
This commit is contained in:
parent
c4af929fb7
commit
7db9a6fcd1
@ -515,6 +515,7 @@ jail_sysvipc_allow="NO" # Allow SystemV IPC use from within a jail
|
||||
#jail_example_mount_enable="NO" # mount/umount jail's fs
|
||||
#jail_example_devfs_ruleset="ruleset_name" # devfs ruleset to apply to jail
|
||||
#jail_example_fstab="" # fstab(5) for mount/umount
|
||||
#jail_example_flags="-l -U root" # flags for jail(8)
|
||||
|
||||
##############################################################
|
||||
### Define source_rc_confs, the mechanism used by /etc/rc.* ##
|
||||
|
@ -64,6 +64,8 @@ init_variables()
|
||||
# "/etc/fstab.${_j}" will be used for {,u}mount(8) if none is specified.
|
||||
eval jail_fstab=\"\$jail_${_j}_fstab\"
|
||||
[ -z "${jail_fstab}" ] && jail_fstab="/etc/fstab.${_j}"
|
||||
eval jail_flags=\"\$jail_${_j}_flags\"
|
||||
[ -z "${jail_flags}" ] && jail_flags="-l -U root"
|
||||
|
||||
# Debugging aid
|
||||
#
|
||||
@ -81,6 +83,7 @@ init_variables()
|
||||
debug "$_j fstab: $jail_fstab"
|
||||
debug "$_j exec start: $jail_exec_start"
|
||||
debug "$_j exec stop: $jail_exec_stop"
|
||||
debug "$_j flags: $jail_flags"
|
||||
}
|
||||
|
||||
# set_sysctl rc_knob mib msg
|
||||
@ -196,7 +199,7 @@ jail_start()
|
||||
fi
|
||||
fi
|
||||
_tmp_jail=${_tmp_dir}/jail.$$
|
||||
eval jail -l -U root -i ${jail_rootdir} ${jail_hostname} \
|
||||
eval jail ${jail_flags} -i ${jail_rootdir} ${jail_hostname} \
|
||||
${jail_ip} ${jail_exec_start} > ${_tmp_jail} 2>&1
|
||||
[ "$?" -eq 0 ] && echo -n " $jail_hostname"
|
||||
_jail_id=$(head -1 ${_tmp_jail})
|
||||
|
Loading…
Reference in New Issue
Block a user