A simple rc.d jail patch to enable priority

看板FB_security作者時間18年前 (2008/02/25 01:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
--r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --r5Pyd7+fXNt84Ff3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="jail.diff" --- /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" --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ freebsd-security@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-security To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org" --r5Pyd7+fXNt84Ff3--
文章代碼(AID): #17mQBg00 (FB_security)
文章代碼(AID): #17mQBg00 (FB_security)