Bug 89111

Summary: journalctl exits with nonzero exit status if no messages in time span
Product: systemd Reporter: Michael Herold <quabla>
Component: generalAssignee: systemd-bugs
Status: NEW --- QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: net147
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
i915 platform: i915 features:

Description Michael Herold 2015-02-12 22:35:08 UTC
The following command as daily cron can sometimes serve as a simple logwatch replacement:

journalctl --no-pager -q -p err -u my.service --until now --since -24h

However, if there are no warnings in the last 24h journalctl exits with nonzero exit status and prints "Failed to determine timestamp: Cannot assign requested address" to stderr.

First, it would be nice if (at least with -q) there is no output in this case and the exit status is 0. Second, I do not understand the error message.

There is a similar bug #71548, however the exit status in this case is a bit more reasonable, while the error message there is also very confusing.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.