Subject: Re: newsyslog
To: Andy Doran <ad@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 07/12/2000 18:31:31
>Finally, locking. We don't want logs to get mangled, so some form of
>serialization needs to be done. So far I'm thinking create a lock like:
>
>/var/tmp/.newsyslog-lock.var.log.messages
>
>or
>
>/var/log/.lock.messages

locking?  hmm...what am i missing...?

i always figured that if you

 (1) do all the moves and creation of new (empty) log files
 (2) do all the hupping (syslogd, and others) [*]
 (3) do all the gziping (bzip2ing?)

that there would be no need for locking.  or are you trying to guard
against to instances of newsyslog running simultaneously not stepping
on each other's toes?

[*] the alias in root's .cshrc call 'hup' is not quite correct (imho).
it's currently:

   alias hup 'kill -HUP `cat /var/run/\!$.pid`'

but i feel that

   alias hup 'kill -HUP `head -1 /var/run/\!$.pid`'

would be better, since some things (sendmail, others?) store more than
just a pid in there.  unless, of course, i'm simply expected to ignore
the errors that kill gives me from that.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."