Unfortunately, systemd in Bionic and Disco was built without the pcre2
library, and that's what journalctl uses to implement --grep.  So before
Eoan, journalctl --grep will fail with:

"Compiled without pattern matching support"

Since adding this support now would pull in an additional dependency to
the systemd package, fixing this bug would mean breaking automatic
updates for everyone using systemd (on Bionic or Disco) but without
libpcre2 installed, since a package won't be automatically updated if it
requires new dependencies that aren't currently installed.

Also unfortunately, the journalctl -g option was left out of the options
string, so it prints "invalid option" as you mentioned; that is trivial
to fix, but won't actually make journalctl grep work, since it would
just change from "invalid option" to "compile without pattern matching
support".  So while the -g error message for journalctl in Bionic is a
bit confusing, I don't think it's worth a patch just to slightly improve
the error message without actually getting --grep working.

Please note that --grep (and -g) works starting in Eoan.

Also, I'll mention that you can still simply pipe journalctl output into
the 'grep' tool; it's a bit less efficient but should still work.

Sorry.


** Changed in: systemd (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1856330

Title:
  journalctl missing grep

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1856330/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to