* Jordan Brown <Jordan.Brown at Sun.COM> [2009-10-14 22:47]:
> Stephen Hahn wrote:
>>>   There's an outstanding bug on this; the fix is trivial--use
>>>   logadm(1M)'s copy-truncate option.
>>
>>     6578671 smf services keep logging to old smf logs after log
>>             rotation as well, until we restart them
>>
>>     I peeked at this bug when fixes were being discussed; a small patch
>>     to svc.startd(1M) to set stdout/stderr to O_APPEND would make for a
>>     complete fix.
>
> logadm -c isn't atomic; if somebody writes to the log after the copy and  
> before the truncate, the write will be lost.

  While we wait for the system call proposal, why wouldn't

  loop:
      stat
      copy speculatively
      mandatory lock
      stat
      if stat changed
          unlock
          goto loop # (or reinsert in work queue and break)
      endif
      truncate
      unlock
      rename speculative copy into log sequence

  be a sufficient enhancement to logadm(1M)'s current logic for -c?

  - Stephen

-- 
sch at sun.com  http://blogs.sun.com/sch/

Reply via email to