[systemd-devel] [RFC PATCH 1/3] journal: add sd_journal_add_file

Lennart Poettering lennart at poettering.net
Tue Mar 19 07:59:53 PDT 2013

On Mon, 18.03.13 21:29, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> ---
> A serie composed of three patches:                                                        
> 1. this one: make sd_journal_add_file available to the wide public                        
> 2. second one: allow opening of the journal in "stub" mode, without                       
>    any files                                                                              
> 3. third one: journalctl --file path.journal can be used to look                          
>    at just one file.                                                                      

I am very conservative about this. I mean, this is a change that will
pull a tonload of further changes after it I fear. If we make
sd_journal_add_file() available then we really should also add
sd_journal_remove_file()... and then, you need to think about
identifiers to use for this so that the calls can match the same
files. And then, we'd need to teach people how to properly recognize
journal files in the fs, and how to subscribe to them, and so on, which
becomes extra messy with NFS and suchlike. For these reasons I'd really
like to leave the dynamic handling of journal files to our own library.

I am mostly concernced about this dynamic bit of the API. I'd be open to
adding a more "static" API for this however,
i.e. sd_journal_open_files(sd_journal **ret, char **files, int flags) or
so, which takes a string list of file names, and doesn't allow dynamic
addition (or removal) of files to interleave...


Lennart Poettering - Red Hat, Inc.

More information about the systemd-devel mailing list