[Date Prev][Date Next]
Re: syslog ignoring facility values on DU4.0 (ITS#240)
At 07:27 AM 7/30/99 +0000, email@example.com wrote:
>Full_Name: James Talbut
>OS: Digital Unix 4.0D
>Submission from: (NULL) (22.214.171.124)
>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,
>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
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).
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 firstname.lastname@example.org
Technical Services (330) 972-6130
The University of Akron