protonscr

/usr/bin/pgrep: invalid option -- 'q'

steamclosed reviewed
ValveSoftware/steam-for-linux#4658 · opened 2016-10-13 by ChristophHaag · updated 2019-10-18 · 4 comments · github
CChristophHaag 2016-10-13 github

Starting steam in a terminal, it always prints

/usr/bin/pgrep: invalid option -- 'q'

Usage:
 pgrep [options] <pattern>

Options:
 -d, --delimiter <string>  specify output delimiter
 -l, --list-name           list PID and process name
 -a, --list-full           list PID and full command line
 -v, --inverse             negates the matching
 -w, --lightweight         list all TID
 -c, --count               count of matching processes
 -f, --full                use full process name to match
 -g, --pgroup <PGID,...>   match listed process group IDs
 -G, --group <GID,...>     match real group IDs
 -i, --ignore-case         match case insensitively
 -n, --newest              select most recently started
 -o, --oldest              select least recently started
 -P, --parent <PPID,...>   match only child processes of the given parent
 -s, --session <SID,...>   match session IDs
 -t, --terminal <tty,...>  match by controlling terminal
 -u, --euid <ID,...>       match by effective IDs
 -U, --uid <ID,...>        match by real IDs
 -x, --exact               match exactly with the command name
 -F, --pidfile <file>      read PIDs from file
 -L, --logpidfile          fail if PID file is not locked
 --ns <PID>                match the processes that belong to the same
                           namespace as <pid>
 --nslist <ns,...>         list which namespaces will be considered for
                           the --ns option.
                           Available namespaces: ipc, mnt, net, pid, user, uts

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see pgrep(1).

... twice.

It's not fatal - steam still starts and runs, but it's annoying. There's already issue #4548, but that was more about an unrelated issue, so I made one only about this.

A short google search shows that gnu grep doesn't know -q, but BSD grep does. Should be relatively trivial to just remove -q and maybe replace it with > /dev/null 2> /dev/null or so.

Tthwarted 2016-11-20 github

GNU grep knows about -q, but pgrep (process grep, part of procps) doesn't.

This is annoying enough that I've had to replace /usr/bin/pgrep with a wrapper that detects that the first argument is -q, does exec >/dev/null 2>&1, shifts off the first argument, and then execs the original pgrep.

Unfortunately, a binary program (.local/share/Steam/ubuntu12_32/steam) is running pgrep, not a shell script, requiring that this be worked around with a wrapper like this.

Kkisak-valve maintainer 2019-09-14 github

Hello @ChristophHaag, @thwarted, are either of you still seeing this issue on an up to date system?

OOlliC 2019-09-17 github

I had this issue some time ago. Have not seen it for a while. This is on up to date Fedora 30.

Kkisak-valve maintainer 2019-10-18 github

Closing presumed fixed some time ago.

Nothing extracted yet.