From owner-freebsd-current@FreeBSD.ORG Fri Oct 13 07:00:15 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26BAD16A417; Fri, 13 Oct 2006 07:00:15 +0000 (UTC) (envelope-from llevier@argosnet.com) Received: from mx.levier.org (ns.argosnet.com [213.251.139.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5BC343D53; Fri, 13 Oct 2006 07:00:00 +0000 (GMT) (envelope-from llevier@argosnet.com) Received: from localhost (ns [213.251.139.26]) by mx.levier.org (Postfix) with ESMTP id 0B8BA14D8F0; Fri, 13 Oct 2006 08:59:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at argosnet.com Received: from mx.levier.org ([213.251.139.26]) by localhost (ns.levier.org [213.251.139.26]) (amavisd-new, port 10024) with ESMTP id 37Qaf-X9y6Qp; Fri, 13 Oct 2006 08:59:46 +0200 (CEST) Received: from osgiliath.argosnet.com (tirion.argosnet.com [82.224.1.141]) by mx.levier.org (Postfix) with ESMTP id B30E814D8EE; Fri, 13 Oct 2006 08:59:45 +0200 (CEST) Message-Id: <7.0.1.0.2.20061013085800.01e91dc0@argosnet.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Fri, 13 Oct 2006 08:59:44 +0200 To: Cheng-Lung Sung ,bug-followup@FreeBSD.org From: Laurent LEVIER In-Reply-To: <20061013033408.GA30695@FreeBSD.csie.nctu.edu.tw> References: <20061013033408.GA30695@FreeBSD.csie.nctu.edu.tw> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Mailman-Approved-At: Fri, 13 Oct 2006 11:38:34 +0000 Cc: freebsd-current@freebsd.org, freebsd-rc@FreeBSD.org Subject: Re: conf/102913: /etc/rc.d/named killall in jailed OS X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2006 07:00:15 -0000 Hi Cheng-Lung Sung At 05:34 13/10/2006, Cheng-Lung Sung wrote: >try this patch? thanks, I already patched my script. Now it kills pid, then if it fails, gets all named out of jail (J flag) and kill these. The bug report was just so you are aware of this and can take corrective action for next release ;-) And between you & me, this bug is nothing comparing to the other one I submitted months ago about IDE driver bug. Thanks!! Brgrds >Index: etc/rc.d/named >=================================================================== >RCS file: /home/ncvs/src/etc/rc.d/named,v >retrieving revision 1.26 >diff -u -r1.26 named >--- etc/rc.d/named 20 Apr 2006 12:30:12 -0000 1.26 >+++ etc/rc.d/named 13 Oct 2006 03:30:41 -0000 >@@ -91,9 +91,28 @@ > if rndc stop 2>/dev/null; then > echo . > else >- echo -n ": rndc failed, trying killall: " >- if killall named; then >- echo . >+ echo -n ": rndc failed, trying " >+ # If we are not inside a jail, killall will kill named in jail >+ # If we are inside a jail, killall is safe >+ # >+ if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then >+ echo -n "killall: " >+ if killall named; then >+ echo . >+ fi >+ else >+ # If we're not in a jail, try to kill named >from pidfile >+ # Otherwise see if we can get from ps >+ echo -n "kill pid: " >+ if [ -f ${pidfile} ]; then >+ kill -TERM `cat ${pidfile}` >+ echo . >+ else >+ for i in `ps -axo command,pid,jid | >awk '/^[^ ]+named/{if ($NF == 0) {print $(NF-1)}}'`; do >+ kill -TERM ${i} >+ echo . >+ done >+ fi > fi > fi > } > >-- >Cheng-Lung Sung - clsung@ Laurent LEVIER Systems & Networks Security Expert, CISSP CISM