A simple rc.d jail patch to enable priority



Hello,

I have written this tiny little patch to the jail rc.d script, which
allows user to set jail nice value. It doesn't change any default
behaviour.

Can that make it to the trees?
Patch attached.

--
Jan Srzednicki :: http://wrzask.pl/
"Remember, remember, the fifth of November"
-- V for Vendetta

--- /etc/rc.d/jail 2007-06-06 16:42:01.000000000 +0200
+++ /srv/home/winfried/jail.new 2008-02-24 17:26:42.000000000 +0100
@@ -69,6 +69,7 @@
[ -z "${_flags}" ] && _flags="-l -U root"
eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\"
[ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log"
+ eval _nice=\"\${jail_${_j}_nice:-${jail_nice}}\"

# Debugging aid
#
@@ -89,6 +90,7 @@
debug "$_j exec stop: $_exec_stop"
debug "$_j flags: $_flags"
debug "$_j consolelog: $_consolelog"
+ [ -n "${_nice}" ] && debug "$_j nice: $_nice"

if [ -z "${_hostname}" ]; then
err 3 "$name: No hostname has been defined for ${_j}"
@@ -322,7 +324,14 @@
fi
fi
_tmp_jail=${_tmp_dir}/jail.$$
- eval jail ${_flags} -i ${_rootdir} ${_hostname} \
+
+ if [ -z "${_nice}" ]; then
+ _nice_cmd=""
+ else
+ _nice_cmd="nice -n${_nice}"
+ fi
+
+ eval ${_nice_cmd} jail ${_flags} -i ${_rootdir} ${_hostname} \
${_ip} ${_exec_start} > ${_tmp_jail} 2>&1
if [ "$?" -eq 0 ] ; then
echo -n " $_hostname"
_______________________________________________
freebsd-security@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-security
To unsubscribe, send any mail to "freebsd-security-unsubscribe@xxxxxxxxxxx"

Relevant Pages