Bug#893014: systemd: journalctl -g and --grep fail (in different ways)

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Mar 15 14:39:47 GMT 2018


Package: systemd
Version: 237-4
Severity: normal

journalctl(1) says:

       -g, --grep=
           Filter output to entries where the MESSAGE= field matches the
           specified regular expression. PERL-compatible regular expressions
           are used, see pcre2pattern(3) for a detailed description of the
           syntax.

           If the pattern is all lowercase, matching is case insensitive.
           Otherwise, matching is case sensitive. This can be overridden with
           the --case-sensitive option, see below.


however:

0 dkg at alice:~$ journalctl --grep=hello
Compiled without pattern matching support
0 dkg at alice:~$ journalctl -g hello
journalctl: invalid option -- 'g'
1 dkg at alice:~$ 


note that --grep=hello returns 0 and provides a user-comprehensible
warning about why it didn't work.

but -g hello returns 1 and just gives an incomprehensible error
message that doesn't indicate why it's failing.

I think the right approach would be to return a non-zero error code in
both cases, and to print the same reasonable explanation in both
cases.

        --dkg

-- Package-specific info:

-- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (500, 'oldstable'), (200, 'unstable-debug'), (200, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages systemd depends on:
ii  adduser          3.117
ii  libacl1          2.2.52-3+b1
ii  libapparmor1     2.12-3
ii  libaudit1        1:2.8.2-1
ii  libblkid1        2.31.1-0.4
ii  libc6            2.27-1
ii  libcap2          1:2.25-1.2
ii  libcryptsetup12  2:2.0.1-1
ii  libgcrypt20      1.8.1-4
ii  libgpg-error0    1.27-6
ii  libidn11         1.33-2.1
ii  libip4tc0        1.6.2-1
ii  libkmod2         25-1
ii  liblz4-1         0.0~r131-2+b1
ii  liblzma5         5.2.2-1.3
ii  libmount1        2.31.1-0.4
ii  libpam0g         1.1.8-3.7
ii  libseccomp2      2.3.1-2.1
ii  libselinux1      2.7-2+b1
ii  libsystemd0      237-4
ii  mount            2.31.1-0.4
ii  procps           2:3.3.12-4
ii  util-linux       2.31.1-0.4

Versions of packages systemd recommends:
ii  dbus            1.12.6-2
ii  libpam-systemd  237-4

Versions of packages systemd suggests:
ii  policykit-1        0.105-18
ii  systemd-container  237-4

Versions of packages systemd is related to:
ii  dracut           047-2
pn  initramfs-tools  <none>
ii  udev             237-4

-- Configuration Files:
/etc/systemd/resolved.conf changed [not included]

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list