Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 621752 - sys-apps/systemd-233-r1 systemd-journal-remote does not support documented example usage
Summary: sys-apps/systemd-233-r1 systemd-journal-remote does not support documented ex...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-14 15:44 UTC by Joe Harvell
Modified: 2017-06-14 23:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output of emerge --info (einfo.txt,6.54 KB, text/plain)
2017-06-14 15:45 UTC, Joe Harvell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Harvell 2017-06-14 15:44:25 UTC
From the man page for systemd-journal-remote:

EXAMPLES
       Copy local journal events to a different journal directory:

           journalctl -o export | systemd-journal-remote -o /tmp/dir -

Results below:

jharvell@wolfhound tmp$ mkdir testdir
jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o testdir -
For SplitMode=none, output must be a file.
jharvell@wolfhound tmp$ ls -l testfile
-rw-r--r-- 1 jharvell cta 0 Jun 14 09:31 testfile
jharvell@wolfhound tmp$ rm testfile
jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o testfile -
Failed to open output journal testfile: Invalid argument
Failed to get writer for source stdin: Invalid argument
Failed to create source for fd:0 (stdin): Invalid argument
jharvell@wolfhound tmp$ ls -l testfile
ls: cannot access 'testfile': No such file or directory
jharvell@wolfhound tmp$ touch testfile
jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o testfile -
Failed to open output journal testfile: Invalid argument
Failed to get writer for source stdin: Invalid argument
Failed to create source for fd:0 (stdin): Invalid argument
jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote --split-mode=host -o testdir -
For SplitMode=none, output must be a file.


Actually, what I am trying to do is export a subset of logs (from a time range) and save them back in the original journal file format so I can use journalctl on that filtered subset of logs.  So my case differs from the example only in that I would have filtering options on the journalctl command and would want to output to a single file instead of a directory.  But in any case, systemd-journal-remote seems to be broken wrt to reading a stream from stdin.

I also have some feedback about the Gentoo packaging of this tool:

* I had to use trial and error to figure out that it is the http use flag than causes systemd-journal-remote to be installed. This is not obvious and should be documented.
* For the use case documented in the man page, this program would be executed from a shell.  So it should be in my PATH (e.g., /usr/bin) instead of /usr/lib/systemd/systemd-journal-remote
Comment 1 Joe Harvell 2017-06-14 15:45:01 UTC
Created attachment 476336 [details]
output of emerge --info
Comment 2 Mike Gilbert gentoo-dev 2017-06-14 23:29:41 UTC
Please report the problem upstream; this is nothing Gentoo-related.

> I had to use trial and error to figure out that it is the http use flag than causes systemd-journal-remote to be installed. This is not obvious and should be documented.

Upstream is pretty terrible at naming/documenting their configure flags as well. If you can provide a suggested change for metadata.xml, I'm happy to commit it.

> For the use case documented in the man page, this program would be executed from a shell.  So it should be in my PATH (e.g., /usr/bin) instead of /usr/lib/systemd/systemd-journal-remote

Also an upstream issue.