Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2001 00:16:14 -0700
From:      "Crist J. Clark" <cristjc@earthlink.net>
To:        Dmitry Morozovsky <marck@rinet.ru>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/29966: cleanup of ppp server socket on unclean startup
Message-ID:  <20010823001614.F78008@blossom.cjclark.org>
In-Reply-To: <200108222330.f7MNUWJ88632@freefall.freebsd.org>; from marck@rinet.ru on Wed, Aug 22, 2001 at 04:30:32PM -0700
References:  <200108222330.f7MNUWJ88632@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010823001614.F78008>