[Bug 299402] ps -J <num> doesn't work as documented.

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 14 Oct 2026 20:31:50 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299402

            Bug ID: 299402
           Summary: ps -J <num> doesn't work as documented.
           Product: Base System
           Version: 15.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: dave@daveg.ca

ps -J should:

     -J      Display information about processes which match the specified
             jail IDs.  This may be either the jid or name of the jail.  Use
             -J 0 to request display of host processes.  Implies -x by
             default.

so on a 15.1 system, I

[1:4:304]root@vr:~> ps -axJ 1 | head -40
  PID TT  STAT         TIME COMMAND
    0  -  DLs    1375:53.80 [kernel]
    1  -  ILs       0:00.42 /sbin/init
    2  -  WL        1:11.39 [clock]
    3  -  DL        0:00.00 [crypto]
    4  -  DL       49:41.85 [cam]
    5  -  DL        0:00.00 [busdma]
    6  -  DL      170:55.55 [zfskern]
    7  -  DL        0:39.81 [rand_harvestq]
    8  -  DL       52:56.18 [pagedaemon]
    9  -  DL        0:00.00 [vmdaemon]
   10  -  DL        0:00.00 [audit]
   11  -  RNL  811294:35.51 [idle]
   12  -  WL       25:37.14 [intr]
   13  -  DL        0:00.17 [geom]
   14  -  DL        1:32.86 [usb]
   15  -  DL        0:14.38 [bufdaemon]
   16  -  DL        0:02.61 [vnlru]
   17  -  DL        0:11.95 [syncer]
   18  -  DL        0:09.49 [enc_daemon0]
   19  -  DL        0:08.94 [enc_daemon1]
  237  -  Is        0:00.00 adjkerntz -i
 1060  -  SJ        0:00.84 /usr/local/bin/uwsgi-3.8 --master --uid uwsgi --gid
uwsgi --pidfile /var/run/uwsgi.pid -d /var/log/uwsgi.l
 1221  -  Ss        1:30.76 /sbin/devd
 1414  -  SCs       0:16.40 /usr/sbin/syslogd -s
 1417  -  I         0:00.09 syslogd: syslogd.casper (syslogd)
 1418  -  Is        0:00.00 syslogd: system.net (syslogd)
 1539  -  Is        0:00.00 nfsuserd: master (nfsuserd)
 1540  -  I         0:00.69 nfsuserd: server (nfsuserd)
 1541  -  I         0:00.69 nfsuserd: server (nfsuserd)
 1542  -  S         0:00.68 nfsuserd: server (nfsuserd)
 1543  -  S         0:00.69 nfsuserd: server (nfsuserd)
 1596  -  Ss        0:00.55 /usr/sbin/rpcbind
 1806  -  Is        0:00.40 /usr/sbin/rpc.statd
 1839  -  Ss        0:00.81 /usr/sbin/rpc.lockd
 1906  -  Ss        0:34.09 /usr/sbin/ntpd -p /var/db/ntp/ntpd.pid -c
/etc/ntp.conf -f /var/db/ntp/ntpd.drift
 1923  -  Is        0:00.91 /usr/sbin/rwhod
 1925  -  IC        0:01.54 /usr/sbin/rwhod
 1982  -  Ss        0:27.12 /usr/sbin/mountd -r -S /etc/exports
/etc/zfs/exports
 1990  -  Ss        0:13.92 /usr/local/bin/postgres -D /var/db/postgres/data15
[1:5:305]root@vr:~> 

... clearly lots on non JAIL processes ... by lack of J's.  This list is
truncated.  But the following list is not:

[1:5:305]root@vr:~> jexec 1 ps -ax
  PID TT  STAT    TIME COMMAND
 2300  -  IsJ  0:01.65 /usr/sbin/syslogd -s
 2359  -  IsJ  0:02.71 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups
(sshd)
 2362  -  IsJ  0:02.18 /usr/sbin/cron -s
74653  7  R+J  0:00.00 ps -ax

... that is all the processes running in jail #1.

[1:6:306]root@vr:~> uname -a
FreeBSD vr.home.dclg.ca 15.1-RELEASE-p4 FreeBSD 15.1-RELEASE-p4
releng/15.1-n283627-e38a7085f3a8 GENERIC amd64
[1:7:307]root@vr:~>

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