1) There is an known issue about a race condition in journald when the logging process exits. In this case the message isn't assigned to the user whose process generated the message.
2) Apparently the group of the journal files have been changed from 'adm' to 'systemd-journal' in Arch Linux around April 2013.
But still I only have been member of 'adm' as described in the journal tutorial on http://0pointer.de/blog/projects/journalctl.html. So I can only see syslog messages, which are correctly assigned to my own user account. The messages with the race condition, as mentioned above, have been invisible to me.
After joining to the new right group again:
$ sudo usermod -d G martin systemd-journal
I also see the syslog messaes just before exiting the process again :-).
]]>Meanwhile I could reproduce this behavior on 64Bit system too.
The delay needs not to be a sleep(), an incrementing loop does the same job when the counting limit is high enough.
On my system, a
for (i=0;i<1000000;i++) ;
before the exit() works.
But a limit of 100000 instead of 1000000 is not sufficient.
I have a problem with journalctl and syslog output within a C program:
When I use journalctl in follow mode:
$ journalctl -f
and I run the folowing program in another terminal
#include <stdio.h>
#include <syslog.h>
int main()
{
FILE *pf;
int i;
/* logging made in file /var/log/syslog */
openlog("martins",LOG_CONS,LOG_USER);
pf = fopen("not_here","r");
if (!pf)
syslog(LOG_ERR | LOG_USER,"oops -- %m\n");
return 0;
}
no syslog error message appears in the journal.
But, when I modify the programm by adding a 'sleep(1);' right before 'return 0;'
there is a correct error message shown in the journal.
Is this a bug in systemd? Or do I understand something wrong with systemd's journal?
I'm actually running
linux-3.10-12-1-lts
systemd 207
with a 32Bit installation
Thanks for any hints,
Martin
]]>