From owner-freebsd-bugs Thu Aug 23 0:16:33 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from swan.mail.pas.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id EE0D937B40E for ; Thu, 23 Aug 2001 00:16:29 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from blossom.cjclark.org (dialup-209.247.137.194.Dial1.SanJose1.Level3.net [209.247.137.194]) by swan.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id AAA11426; Thu, 23 Aug 2001 00:16:27 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.4/8.11.3) id f7N7GQg80366; Thu, 23 Aug 2001 00:16:26 -0700 (PDT) (envelope-from cjc) Date: Thu, 23 Aug 2001 00:16:14 -0700 From: "Crist J. Clark" To: Dmitry Morozovsky Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/29966: cleanup of ppp server socket on unclean startup Message-ID: <20010823001614.F78008@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200108222330.f7MNUWJ88632@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200108222330.f7MNUWJ88632@freefall.freebsd.org>; from marck@rinet.ru on Wed, Aug 22, 2001 at 04:30:32PM -0700 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, Aug 22, 2001 at 04:30:32PM -0700, Dmitry Morozovsky wrote: > On Wed, 22 Aug 2001, Crist J. Clark wrote: > > CJC> > After unclean shutdown (e.g, crash) ppp server socket > CJC> > remains on file system. Then, if ppp started automatically > CJC> > during startup, it cannot bind to that socket > > [snip] > > CJC> Actually, a much easier fix is to put your server socket above > CJC> /var/run. Everything above /var/run is already cleaned during the boot > CJC> process. > > Unfortunately, it's not such easy now. I use my socket in /var/run/ppp and > it is not cleaned. AFAICC, the only files that are now cleaned from > /var/run is pid files -- and it's not "The Right Thing (tm)" for me to > name socket ending with .pid ;-) > > Or did I miss some serious changes with purgedir()? Right now, purgedir() looks like, purgedir() { local dir file if [ $# -eq 0 ]; then purgedir . else for dir do ( cd "$dir" && for file in .* * do [ ."$file" = .. -o ."$file" = ... ] && continue if [ -d "$file" -a ! -L "$file" ] then purgedir "$file" else rm -f -- "$file" fi done ) done fi } Which sure looks like it should get _everything_ in /var/run, not just '.pid' files. You listed 4.3-STABLE as your OS. Going to 4.3-RELEASE, there are some cosmetic changes, but purgedir() has the same functionality. Does your purgedir() not look like this? -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message