From owner-freebsd-current@FreeBSD.ORG Wed Jun 8 15:42:05 2005 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 6634B16A41C for ; Wed, 8 Jun 2005 15:42:05 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA14E43D49 for ; Wed, 8 Jun 2005 15:42:04 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j58Fg2GL089421; Wed, 8 Jun 2005 10:42:02 -0500 (CDT) (envelope-from dan) Date: Wed, 8 Jun 2005 10:42:02 -0500 From: Dan Nelson To: Jiawei Ye Message-ID: <20050608154202.GH59028@dan.emsphone.com> References: <20050608091603.GG39114@cirb503493.alcatel.com.au> <20050608152610.GG59028@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: Peter Jeremy , freebsd-current@freebsd.org Subject: Re: unkillable apache httpd process 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: Wed, 08 Jun 2005 15:42:05 -0000 In the last episode (Jun 08), Jiawei Ye said: > On 6/8/05, Dan Nelson wrote: > > If it's consuming CPU it should be killable. Tried kill -9? If it's > > really threaded, "ps lHp 3794" will print what each kernel thread is > > doing; maybe only one thread is hung. > > kill -9 solves the problem. But the apache2.sh in /usr/local/rc.d > cannot restart it properly. > > root@orion:/home/leafy# /usr/local/etc/rc.d/apache2.sh restart > Performing sanity check on apache2 configuration: > Syntax OK > Stopping apache2. > Waiting for PIDS: 5696, 5696, 5696, 5696, 5696, 5696, 5696, 5696, > 5696, 5696, 5696, 5696, 5696, 5696, 5696, 5696 > it goes on..... > Also, the unkillable has only 1 thread as shown in the top output. rc.d scripts just send a SIGTERM to the process by default. If apache has blocked that signal, there's not much the script can do. What you could do is edit apache2.sh and add a line saying "sig_stop=-KILL", which will make the shutdown action send a SIGKILL (aka -9) signal to apache. This won't be a clean shutdown, though. Better to try and debug apache and find out what it's doing. -- Dan Nelson dnelson@allantgroup.com