procmail
[Top] [All Lists]

Re: [procmail] Procmail log w/root-tail

2000-01-20 21:15:54
S.Toms wrote:

<> 3. Has anyone else come across this situation before? and if so, how was
<>    it overcome if at all?
<> 
<>   Maybe a way to relink root-tail to the original logfile, or a way to
<> prevent mailstat from making the file link change when it runs.

the tail(1) open sthe file using a file handle.  When you rename the file
it does NOT change the handle, so of course you continue to see the
original file.

The relevant section of mailstat is:

  if $test .$MSkeeplogfile = .
  then $mv "$LOGFILE" "$OLDLOGFILE"; $cat $DEVNULL >>"$LOGFILE"
  else OLDLOGFILE="$LOGFILE"
  fi

Replace that with:

  if $test .$MSkeeplogfile = .
  then $cat "$LOGFILE" > "$OLDLOGFILE"; $cat $DEVNULL >>"$LOGFILE"
  else OLDLOGFILE="$LOGFILE"
  fi

Notice it's the second line that's changed; I used cat to copy the log
file rather than mv'ing it and then the second cat truncates the original
logfile.

R
-- 
R A Lichtensteiger       rali(_at_)meitca(_dot_)com -or- 
rali(_at_)world(_dot_)std(_dot_)com
                         http://www.meitca.com/ITA/People/rali
    "Yes, you're doing things right, but are you doing the right things?"
    "Nope.  I'm just doing something dumb fast."