Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionMichal Sekletar
2017-04-27 10:20:53 UTC
Description of problem:
$subject
Version-Release number of selected component (if applicable):
systemd-219-30.el7_3.8
How reproducible:
deterministic
Steps to Reproduce:
1. Compile following C program
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <systemd/sd-journal.h>
/* gcc journal-process-test.c -l systemd */
int main(void) {
int r;
sd_journal *j;
r = sd_journal_open(&j, SD_JOURNAL_CURRENT_USER|SD_JOURNAL_LOCAL_ONLY);
if (r < 0) {
fprintf(stderr, "Failed to open system journal: %m");
return EXIT_FAILURE;
}
/* seek to last message in journal */
sd_journal_get_fd(j);
sd_journal_seek_tail(j);
sd_journal_previous(j);
/* write to syslog and wait a bit for journal to append the message */
openlog("sd-journal-process-test", LOG_NDELAY|LOG_PID, LOG_USER);
syslog(LOG_DAEMON|LOG_ERR, "test message");
sleep(1);
r = sd_journal_process(j);
switch (r) {
case SD_JOURNAL_NOP:
puts("nop");
break;
case SD_JOURNAL_APPEND:
puts("append");
break;
case SD_JOURNAL_INVALIDATE:
puts("invalidate");
break;
default:
fprintf(stderr, "Failed to process journal events: %m");
return EXIT_FAILURE;
}
return 0;
}
2. Login as root user
3. Run ./a.out
Actual results:
Program output is "invalidate"
Expected results:
Program should be "append"
Additional info:
Note that on otherwise idle system it is very unlikely for actual journal invalidation to take place right after we append to journal via syslog(). Hence in 99.99999999% of cases program should really print "append" once the bug is fixed. Ideally we would detect possible invalidation and retry the test case instead of producing false-negative, but possibility of that happening so low that I don't bother.
Upstream fix,
https://github.com/systemd/systemd/pull/5580
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2017:2297
Description of problem: $subject Version-Release number of selected component (if applicable): systemd-219-30.el7_3.8 How reproducible: deterministic Steps to Reproduce: 1. Compile following C program #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <systemd/sd-journal.h> /* gcc journal-process-test.c -l systemd */ int main(void) { int r; sd_journal *j; r = sd_journal_open(&j, SD_JOURNAL_CURRENT_USER|SD_JOURNAL_LOCAL_ONLY); if (r < 0) { fprintf(stderr, "Failed to open system journal: %m"); return EXIT_FAILURE; } /* seek to last message in journal */ sd_journal_get_fd(j); sd_journal_seek_tail(j); sd_journal_previous(j); /* write to syslog and wait a bit for journal to append the message */ openlog("sd-journal-process-test", LOG_NDELAY|LOG_PID, LOG_USER); syslog(LOG_DAEMON|LOG_ERR, "test message"); sleep(1); r = sd_journal_process(j); switch (r) { case SD_JOURNAL_NOP: puts("nop"); break; case SD_JOURNAL_APPEND: puts("append"); break; case SD_JOURNAL_INVALIDATE: puts("invalidate"); break; default: fprintf(stderr, "Failed to process journal events: %m"); return EXIT_FAILURE; } return 0; } 2. Login as root user 3. Run ./a.out Actual results: Program output is "invalidate" Expected results: Program should be "append" Additional info: Note that on otherwise idle system it is very unlikely for actual journal invalidation to take place right after we append to journal via syslog(). Hence in 99.99999999% of cases program should really print "append" once the bug is fixed. Ideally we would detect possible invalidation and retry the test case instead of producing false-negative, but possibility of that happening so low that I don't bother. Upstream fix, https://github.com/systemd/systemd/pull/5580