[Bug 262062] pgrep sshd do not get correct result

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 19 May 2022 11:41:13 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262062

--- Comment #2 from jimmy <345238174@qq.com> ---
(In reply to Ed Maste from comment #1)

I try a new bhyve setuped 13.1-beta vm and pgrep works.

I find some wird and I think this problem also find on a 12.x VPS.
And only a long running pross may be Omit by pgrep, after restart the
service,pgrep works. also restart the OS, the pgrep works. I also test it on
13.0.

This is on a 12.x VPS:
root@hk:~ # pgrep sshd
root@hk:~ # ps auxwww | grep sshd
root  12354   0.0  0.1  19644  1372  -  Is   ****** 21Mar20 *******      
0:04.29 /usr/sbin/sshd   // sshd running for a year!!
root  59592   0.0  0.8  20352  8468  -  Is   19:21         0:00.02 sshd: jo
[priv] (sshd)
jo  59594   0.0  0.9  20680  8704  -  S    19:21         0:00.02 sshd: jo@pts/0
(sshd)
root  59649   0.0  0.0    524   324  0  R+   19:22         0:00.00 grep sshd
root@hk:~ # service sshd restart
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 12354.
Performing sanity check on sshd configuration.
Starting sshd.
root@hk:~ # pgrep sshd
59681
root@hk:~ # freebsd-version -ku
12.2-RELEASE
12.1-RELEASE-p10

-- 
You are receiving this mail because:
You are the assignee for the bug.