Bug 1409527

Summary: sd_journal_has_{runtime,persistent}_files APIs are not usable by applications
Product: Red Hat Enterprise Linux 7 Reporter: Michal Sekletar <msekleta>
Component: systemdAssignee: Michal Sekletar <msekleta>
Status: CLOSED ERRATA QA Contact: Branislav Blaškovič <bblaskov>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: bblaskov, fsumsal, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-219-31.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 09:12:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1088021, 1383699    

Description Michal Sekletar 2017-01-02 12:17:47 UTC
Description of problem:
In commit https://github.com/lnykryn/systemd-rhel/commit/5ec508cc5c13d831c93ce98d84b1d9cedb0117a7 we have added two new APIs. These APIs are now used internally from journalctl. Despite being marked as _public_, we do not export them because they've never been added to respective .sym file. There are applications that would like to make use of them, e.g. rsyslog's imjournal module.

Version-Release number of selected component (if applicable):
systemd-219-30.el7_3.6

How reproducible:
always

Steps to Reproduce:
1. yum install -y systemd-devel
2. cat > /tmp/sd-journal-has-persistent-files.c << EOF
#include <stdio.h>
#include <systemd/sd-journal.h>

int main() {
        int r;
        sd_journal *j;
        
        sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
        
        r = sd_journal_has_persistent_files(j);
        
        sd_journal_close(j);
        
        return r;
}
EOF
3. gcc /tmp/sd-journal-has-persistent-files.c -lsystemd
4. ./a.out
5. echo $?

Actual results:
Compilation (step 3) returns following error,
/tmp/cco975MF.o: In function `main':
sd-journal-has-persistent.c:(.text+0x21): undefined reference to `sd_journal_has_persistent_files'
collect2: error: ld returned 1 exit status

Expected results:
Compilation and execution are successful

Additional info:
We need to backport https://github.com/systemd/systemd/commit/9a07f779bbeacc3358d405f6cf583506aaf655ae or came up with similar patch due to different versioning between upstream and RHEL7.

Comment 1 Michal Sekletar 2017-01-05 08:35:59 UTC
https://github.com/lnykryn/systemd-rhel/pull/75

Comment 2 Lukáš Nykrýn 2017-01-12 09:54:59 UTC
fix merged to upstream staging branch ->
https://github.com/lnykryn/systemd-rhel/commit/0bf93125d4833bcdb7d187543581e4a6c14de159
-> post

Comment 5 errata-xmlrpc 2017-08-01 09:12:22 UTC
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