|Summary:||journalctl exits with nonzero exit status if no messages in time span|
|Product:||systemd||Reporter:||Michael Herold <quabla>|
|Status:||NEW ---||QA Contact:||systemd-bugs|
|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.