Bug 262062 - pgrep sshd do not get correct result
Summary: pgrep sshd do not get correct result
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.0-RELEASE
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-20 12:20 UTC by jimmy
Modified: 2022-05-19 11:41 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jimmy 2022-02-20 12:20:15 UTC
On 13.0R pgrep sshd get nothing while I have sshd service running:

root@fb4port:~ # pgrep sshd
root@fb4port:~ # ps auxwww | grep sshd
root   10679   0.0  0.0   20952    1368  -  Is    7Feb22     0:00.02 /usr/sbin/sshd
root   79855   0.0  0.1   21388    5964  -  Is   15:26       0:00.02 sshd: xxxx [priv] (sshd)
xxxx   80913   0.0  0.1   21392    6028  -  S    15:26       0:00.23 sshd: xxxx@pts/2,pts/8 (sshd)
root    5228   0.0  0.0   12868    2092  2  S+   20:15       0:00.00 grep sshd

tested on amd64 and arm v7,get the same result.

12.2R ruturn OK.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2022-05-18 15:53:51 UTC
Can you try on 13.1?
Comment 2 jimmy 2022-05-19 11:41:13 UTC
(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