From owner-freebsd-questions@FreeBSD.ORG Fri Dec 5 16:53:36 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C194416A4CE for ; Fri, 5 Dec 2003 16:53:36 -0800 (PST) Received: from smtp807.mail.sc5.yahoo.com (smtp807.mail.sc5.yahoo.com [66.163.168.186]) by mx1.FreeBSD.org (Postfix) with SMTP id A647543FE1 for ; Fri, 5 Dec 2003 16:53:35 -0800 (PST) (envelope-from dcrudy@pacbell.net) Received: from adsl-67-121-155-227.dsl.pltn13.pacbell.net (HELO pacbell.net) (dcrudy@pacbell.net@67.121.155.227 with plain) by smtp-sbc-v1.mail.vip.sc5.yahoo.com with SMTP; 6 Dec 2003 00:53:35 -0000 Message-ID: <3FD12896.8040705@pacbell.net> Date: Fri, 05 Dec 2003 16:53:42 -0800 From: Daniel Rudy Organization: SBC Internet Services User-Agent: Mozilla/5.0 (X11R6; U; FreeBSD 4.9-RELEASE; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en, ja MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <3FCB1B0C.6080902@pacbell.net><007201c3b7fe$c6635280$a4b826cb@goo> <3FCBE16E.5010204@pacbell.net> <001c01c3b8ab$fce350a0$a4b826cb@goo> In-Reply-To: <001c01c3b8ab$fce350a0$a4b826cb@goo> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: Controlling init on shutdown/reboot X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dcrudy@pacbell.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2003 00:53:36 -0000 Somewhere around the time of 12/02/2003 00:12, the world stopped and listened as Rob contributed this to humanity: > I haven't used ppp(8) - I prefer pppd(8) - so I'm not familiar with > ppp.linkdown.sh. If this is a shell script, there's a couple of things that > I've seen cause strange script behaviour: lack of default environment and > lack of TTY. This usually shows up in scripts that work fine at the command > line, but fail under other circumstances (such as crontabs). > > Does it take more than 2 minutes at the command line? > > Have you tried adding > > set -x > > at the start to see where it's failing? If it's called by rc.shutdown the > output should be to the console, but I'm not sure what ppp(8) does with > script output. > The script is called by ppp on a link down event. That is a link down for ANY reason, including a shutdown. The problem is that ppp doesn't differentiate on why the link went down, just that it went down. Now, when rc.shutdown executes, it writes a stop file to /tmp that ppp.linkdown.sh checks for. If it finds that file, then I have it do something alittle different. Does it take long to execute? Nope, it runs quite fast, which may be part of the problem. Because this is called from ppp and not rc.shutdown, init is killing it before it finishes because init thinks that it is not part of the system shutdown sequence. -- Daniel Rudy