Re: [patch] etc/rc.d/jail: allow extra parameters for each jails

2012-08-17 Thread Bjoern A. Zeeb

On Thu, 16 Aug 2012, Jun Kuriyama wrote:



Hi,

Here is a patch which I'm using for years in my production
environment.

I usually changes parameters documented in jail(8) for each jails, but
current rc.d/jail has no feature to pass extra parameters at starting
jails.

I hope this patch will not prevent jamie's recent/next work for
rc.d/jail.  I'll commit this if there is no objection.


Why not just use his work?

--
Bjoern A. Zeeb You have to have visions!
 Stop bit received. Insert coin for new address family.
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to freebsd-jail-unsubscr...@freebsd.org


Re: [patch] etc/rc.d/jail: allow extra parameters for each jails

2012-08-17 Thread Jamie Gritton

On 08/17/12 04:28, Bjoern A. Zeeb wrote:

On Thu, 16 Aug 2012, Jun Kuriyama wrote:



Hi,

Here is a patch which I'm using for years in my production
environment.

I usually changes parameters documented in jail(8) for each jails, but
current rc.d/jail has no feature to pass extra parameters at starting
jails.

I hope this patch will not prevent jamie's recent/next work for
rc.d/jail. I'll commit this if there is no objection.


Why not just use his work?


Probably because it's a lot more next than recent.
Soon ... real soon now.

- Jamie
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to freebsd-jail-unsubscr...@freebsd.org


[patch] etc/rc.d/jail: allow extra parameters for each jails

2012-08-15 Thread Jun Kuriyama

Hi,

Here is a patch which I'm using for years in my production
environment.

I usually changes parameters documented in jail(8) for each jails, but
current rc.d/jail has no feature to pass extra parameters at starting
jails.

I hope this patch will not prevent jamie's recent/next work for
rc.d/jail.  I'll commit this if there is no objection.


Index: etc/defaults/rc.conf
===
--- etc/defaults/rc.conf(revision 239314)
+++ etc/defaults/rc.conf(working copy)
@@ -705,6 +705,7 @@
 #jail_example_mount_enable=NO# mount/umount jail's fs
 #jail_example_fstab= # fstab(5) for mount/umount
 #jail_example_flags=-l -U root   # flags for jail(8)
+#jail_example_parameters=allow.raw_sockets=1 # extra parameters for this jail
 
 ##
 ### Define source_rc_confs, the mechanism used by /etc/rc.* ##
Index: etc/rc.d/jail
===
--- etc/rc.d/jail   (revision 239314)
+++ etc/rc.d/jail   (working copy)
@@ -115,6 +115,8 @@
[ -z ${_flags} ]  _flags=-l -U root
eval _consolelog=\\${jail_${_j}_consolelog:-${jail_consolelog}}\
[ -z ${_consolelog} ]  _consolelog=/var/log/jail_${_j}_console.log
+   eval _parameters=\\${jail_${_j}_parameters:-${jail_parameters}}\
+   [ -z ${_parameters} ]  _parameters=
eval _fib=\\${jail_${_j}_fib:-${jail_fib}}\
 
# Debugging aid
@@ -193,6 +195,7 @@
 
debug $_j flags: $_flags
debug $_j consolelog: $_consolelog
+   debug $_j parameters: $_parameters
 
if [ -z ${_hostname} ]; then
err 3 $name: No hostname has been defined for ${_j}
@@ -484,9 +487,19 @@
esac
 
# Append address to list of addresses for the jail command.
-   case ${_addrl} in
-   ) _addrl=${_addr} ;;
-   *)  _addrl=${_addrl},${_addr} ;;
+   case ${_type} in
+   inet)
+   case ${_addrl} in
+   ) _addrl=${_addr} ;;
+   *)  _addrl=${_addrl},${_addr} ;;
+   esac
+   ;;
+   inet6)
+   case ${_addr6l} in
+   ) _addr6l=${_addr} ;;
+   *)  _addr6l=${_addr6l},${_addr} ;;
+   esac
+   ;;
esac
 
# Configure interface alias if requested by a given interface
@@ -576,6 +589,7 @@
continue;
fi
_addrl=
+   _addr6l=
jail_ips add
if [ -n ${_fib} ]; then
_setfib=setfib -F '${_fib}'
@@ -641,8 +655,8 @@
i=$((i + 1))
done
 
-   eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} 
${_hostname} \
-   \${_addrl}\ ${_exec_start}  ${_tmp_jail} 21 \
+   eval ${_setfib} jail -n ${_jail} ${_flags} -i -c 
path=${_rootdir} host.hostname=${_hostname} \
+   ip4.addr=\${_addrl}\ ip6.addr=\${_addr6l}\ 
${_parameters} command=${_exec_start}  ${_tmp_jail} 21 \
/dev/null
 
if [ $? -eq 0 ] ; then

-- 
Jun Kuriyama kuriy...@freebsd.org // FreeBSD Project
 kuriy...@s2factory.co.jp // S2 Factory, Inc.
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to freebsd-jail-unsubscr...@freebsd.org


Re: [patch] etc/rc.d/jail: allow extra parameters for each jails

2012-08-15 Thread Doug Barton
On 08/15/2012 03:19 PM, Jun Kuriyama wrote:
 
 Hi,
 
 Here is a patch which I'm using for years in my production
 environment.
 
 I usually changes parameters documented in jail(8) for each jails, but
 current rc.d/jail has no feature to pass extra parameters at starting
 jails.
 
 I hope this patch will not prevent jamie's recent/next work for
 rc.d/jail.  I'll commit this if there is no objection.
 
 
 Index: etc/defaults/rc.conf
 ===
 --- etc/defaults/rc.conf  (revision 239314)
 +++ etc/defaults/rc.conf  (working copy)
 @@ -705,6 +705,7 @@
  #jail_example_mount_enable=NO  # mount/umount jail's fs
  #jail_example_fstab=   # fstab(5) for 
 mount/umount
  #jail_example_flags=-l -U root # flags for jail(8)
 +#jail_example_parameters=allow.raw_sockets=1   # extra parameters for 
 this jail

Why not just use _flags for this?


___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to freebsd-jail-unsubscr...@freebsd.org