On Tue, Jan 20, 2009 at 02:20:08PM -0800, Kohsuke Kawaguchi wrote:
> Stephen Hahn wrote:
> > * Kohsuke Kawaguchi <Kohsuke.Kawaguchi at sun.com> [2009-01-20 19:44]:
> >> Liane Praza wrote:
> >>> Kohsuke Kawaguchi wrote:
> >>>> According to the FAQ 
> >>>> http://www.opensolaris.org/os/community/smf/faq/#toc12 ,
> >>>> I don't need to do anything to get logs rotated because it's already 
> >>>> done by
> >>>> logadm.
> >>>>
> >>>> But here's the question. SMF appears to redirect stdout/stderr of 
> >>>> services
> >>>> straight to these log files. So that means these log files are kept open 
> >>>> all
> >>>> the time, which in turn means log rotation won't work correctly --- the
> >>>> services will just keep writing to the old file, after it's renamed to
> >>>> something.0
> >>>>
> >>>> How does people work around this problem? Is't this broken? Shouldn't 
> >>>> SMF sit
> >>>> in the middle so that logadm can send a signal to reopen log files, or
> >>>> something like that?
> >>>
> >>> Yes, sorry, it is broken.  It's the subject of:
> >>>    6578671 smf services keep logging to old smf logs after log rotation 
> >>> as 
> >>> well, until we restart them.
> >>
> >> Thank you for a pointer to the bug report.
> >>
> >> I guess I was coming from a slightly different angle --- that is, instead 
> >> of changing every daemon, isn't it better if SMF sits between daemons and 
> >> log files to handle signals and so on, like rotatelogs from Apache and 
> >> DJB's multilog does?
> >>
> >> In that way, all daemon logs show up in /var/svc/log with predictable 
> >> names 
> >> (which is really nice), and also simplifies logadm.conf substantially.
> > 
> >   Is the proposed workaround not sufficient as a fix?  That is, couldn't
> >   the smf_logs rule be
> > 
> >   smf_logs -c -C 8 -s 1m /var/svc/log/*.log
> > 
> >   or do we have examples of bizarre program that seek on stdout/stderr?
> >   (Trying it on a machine now...)
> 
> Does this mean I can expect this change in Solaris somewhere down the 
> road? If so, that's great!
> 
> 
> 
> Speaking of logadm, it would be nice if logadm can read configuration 
> from not just one file but from /etc/logadm.d/*
> 
> When I package my daemon for Solaris via pkg(5), I can't currently 
> auto-configure logadm, because I have to modify logadm.conf.

Isn't that what "logadm -w" is for?

Ceri
-- 
That must be wonderful!  I don't understand it at all.
                                                  -- Moliere
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20090121/8634c869/attachment.bin>

Reply via email to