help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Syslog facility


From: Chip Seraphine
Subject: Syslog facility
Date: Wed, 12 May 2004 12:13:45 -0500
User-agent: KMail/1.5.4

I've noticed that a significant chunk of the syslog output generated by 
cfagent goes to LOG_USER, not what I designate with SyslogFacility.  I'm not 
sure, but I suspect that this results from calls to syslog(3) being made 
before CfOpenLog() is being called.

CfOpenLog calls openlog(3), which causes future syslog calls to default to a 
specified facility (whatever is designated by SyslogFacility).  However, 
syslog() can be called before openlog() and works just fine; it will simply 
default to LOG_USER for want of a better idea.

I tested this by adding a syslog() line at the end of CfOpenLog, and observed 
that all cfengine-related stuff that was syslogged went to LOG_USER until 
this line appeared, at which point everything went to LOG_LOCAL1.  The stuff 
that went to LOG_USER included all the chmodding, chowning, and chgrping of 
files and directories (which is sometimes quite a lot of noise).

So, I guess our options are to either have CfOpenLog be called earlier in the 
run (before files: and directories: operations happen, at least) or to have 
calls to CfLog be buffered somewhere until CfOpenLog is called, then dump the 
buffer all at once.  The second option is kind of a hack, but the first one 
is outside of my programming comfort-zone (I find the scheduling stuff a 
little hairy).  Anybody have any ideas?

In the meantime, I am hacking around it by having  the syslog() calls in log.c 
explicitly ask for LOG_LOCAL1 (ugly!).

-- 

Chip Seraphine
Unix Administrator
TradeLink, LLC
312-264-2048
chip@trdlnk.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]