From owner-freebsd-stable@FreeBSD.ORG Tue Jul 23 18:52:59 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8BA763C5 for ; Tue, 23 Jul 2013 18:52:59 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-vc0-x230.google.com (mail-vc0-x230.google.com [IPv6:2607:f8b0:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7312EC1 for ; Tue, 23 Jul 2013 18:52:59 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id ha11so540787vcb.35 for ; Tue, 23 Jul 2013 11:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=R5rJZNZdb/yxStbCSG+EdpVfB8tu1KXKuD7sgmIb/wQ=; b=VhepD5dMYS1GrD06s9yGqpgEWbu082A+tcB4PgRadMFFCFKZWtQN6vDs7HhbcOvHDX HyBlMYly3X4xAfpt82T1ctBIgtHgKj5V/Bxzxxcw/Dkd+3eD7atb9Gxt9XncZ95FaUll 5Yr7SiHq6oKC+vHOYE1sI/xoakQ4cmHyTr0pW9gLP5R52wmUqOfMbv6iOIcOFb55hNqu Ry59CjzBcL+SN+pKq9uq4tjRM0bIze9k8XwMumAWkKl5TSYa+V3iOIWENJIW8jVG7HPg 2bZMf8WnBn2eQqhwjIpAyZylrvYCPwavxdDJZ+RGDgyVhEBX3RsV9KrQ75dJP2LW3XSn 4LzA== MIME-Version: 1.0 X-Received: by 10.220.201.138 with SMTP id fa10mr12463093vcb.18.1374605578217; Tue, 23 Jul 2013 11:52:58 -0700 (PDT) Sender: artemb@gmail.com Received: by 10.221.41.6 with HTTP; Tue, 23 Jul 2013 11:52:58 -0700 (PDT) In-Reply-To: <51EEC0A4.7010508@bsdforen.de> References: <51ED0060.2050502@bsdforen.de> <51EEC0A4.7010508@bsdforen.de> Date: Tue, 23 Jul 2013 11:52:58 -0700 X-Google-Sender-Auth: _lXpd3XUTRaa8Qqiy6XXwJjJ5Uc Message-ID: Subject: Re: stopping amd causes a freeze From: Artem Belevich To: Dominic Fandrey Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 18:52:59 -0000 On Tue, Jul 23, 2013 at 10:43 AM, Dominic Fandrey wrote: > > Don't use KILL or make sure that nobody tries to use amd mountpoints > until > > new instance starts. Manually unmounting them before killing amd may > help. > > Why not let amd do it itself with "/etc/rc.d/amd stop" ? > > That was a typo, I'm using SIGTERM. Sorry about that. > > On SIGTERM amd will attempt to unmount its mountpoints. If someone is using them, unmount may not succeed. I've no clue what amd does in such case. The point is that you should treat amd restart as reboot of an NFS server. amd map reload does not really require amd restart. In some cases you may have to manually unmount some automounted filesystem if underlying map had changed, but that's the only case I can think of off the top of my head. In most of the cases "amq -f" worked well enough for me. By the way, are you absolutely sure that your script that restarts amd is guaranteed not to touch anything mounted with amd? Otherwise you're risking a deadlock. For example, if PATH contains amd-mounted directory then when it's time to execute next command your script may attempt to touch such path and may hang waiting for amd to respond which will never happen because the script can't start it. Now, back to debugging your problem. One way to check what's going on would be to figure out where do the processes get stuck. Start with "ps -axl" and see STAT field. CHances are that stuck processes will be in uninterruptible sleep state 'D'. Check MWCHAN field for those. Hitting '^T' which normally sends SIGINFO should also produce a message that includes process' wait channel and is convenient to use when you have console where you've started the app that is hung. Dig further into the sleeping process with "procstat -kk PID" -- it will give you in-kernel stack trace for process' threads which should whos what's going on. You may want to do it from a root login with local host directory and minimalistic PATH so it does not touch any amd mount points. --Artem