[systemd-bugs] [Bug 69934] syslog()-calls just before a program exit are not be recorded in the journal DB

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Sep 29 12:01:16 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=69934

--- Comment #2 from Martin <martin at thesofty.de> ---
Yes I think so. I wrote a small test program. When I write the syslog() without
an delay before the exit of the program, the message will not be logged.
With an sleep(1); statement before the program exit, the message is logged.

I watched the journal with 
  $ journal -f
while running the test-program.

My simple test program looks like this:

#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>

int main()
{
    FILE *pf;

    /* logging made in file /var/log/syslog */ 
    openlog("martins",LOG_CONS,LOG_USER);

    pf = fopen("not_here","r");
    if (!pf)
        syslog(LOG_CRIT | LOG_USER,"oops -- %m\n");
    //sleep(1);
    //closelog();
    //int i;
    //for (i=0;i<1000000;i++) ;
    exit(EXIT_FAILURE);
    return 0;
}

As you can see, I also experimented with some alternatives of the sleep(1),
etc.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130929/4cd1d8ee/attachment.html>


More information about the systemd-bugs mailing list