[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: syslog ignoring facility values on DU4.0 (ITS#240)

At 07:27 AM 7/30/99 +0000, jet35@cam.ac.uk wrote:
>Full_Name: James Talbut
>Version: 1.2.3
>OS: Digital Unix 4.0D
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (
>Summed up by Rodney McDuff in
>http://www.openldap.org/lists/openldap-bugs/9809/msg00036.html, but does not
>appear to be logged as a bug.
>OpenLDAP does not send it's syslog information to the correct facility, 
>and does
>not log the name of the slapd process.

The issue appears to involve threading library and syslog.  Here is what I 
have found in my (admittedly cursory) examinations:

openlog is called in main, then the syslog's that work incorrectly are 
called in threads created by main, or threads created by threads created by 
main, etc.

syslog calls made by main work correctly.   The syslog calls that are 
incorrect (incorrect means that they don't include process name/pid and are 
in LOG_USER rather than whatever facility was in the openlog call) behave 
exactly as syslog does (under DU) when it is called when called without a 
previous openlog call, making me think originally that openlog/syslog share 
information somewhere that doesn't work between threads.  However, it is a 
bit more complicated than that (see below).

Other information:

         1. If you compile with -DNO_THREADS, all the syslog calls work 
correctly. (no surprise here)

         2. Inserting a call to openlog at the beginning of each thread 
fixes the logging. I tried this kludge just as a test to see if it would 
work, not as a substitute for actually fixing the bug.  Specifically, I 
inserted the openlog calls at the beginning of slapd_daemon in daemon.c and 
connection_operation in connection.c.

         3. I wrote a simple program that just does an openlog, then kicks 
off a bunch of threads that each syslog a message.  Much to my surprise, 
the program worked correctly.  Thus, it is possible to call openlog in 
main, then syslog in a thread, and have it work correctly.  I haven't been 
able to figure out what openldap does differently than my little program.

                 -- - keith

Keith Piepho                    kap@uakron.edu
Technical Services              (330) 972-6130
The University of Akron