Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Asked
Modified today
Viewed 211 times
3

I have this integrated in a bash-script on an outdated Debian 10.

ps -axo "%p ;;; %a"

Works well, output is like

10161 ;;; [kworker/0:1-cgroup_destroy]
12173 ;;; [kworker/2:0-events]
12379 ;;; [kworker/u8:0-events_unbound]
12464 ;;; [kworker/u8:1-flush-254:2]

The custom separator ;;; between proc-id and proc-name is what I want!

Now I update to current Debian 13.

It is not working anymore.

Without my custom separator its still ok.

ps -axo "%p %a"

4180 [kworker/0:1-ata_sff]      
4181 [kworker/3:1-ata_sff]      
4292 [kworker/2:2-ata_sff] 

ps -axo "%p ;;; %a"

Error: must set personality to get -x option

Do not know when it broke on the way from Debian 10 to 13. Any idea how to get my custom separator back??

Version is

ps -V

ps from procps-ng 4.0.4
3
  • 1
    Didn't you ask exactly this question when you were migrating to Debian 12? unix.stackexchange.com/q/758665/116858
    Kusalananda
    –  Kusalananda
    2025-10-13 08:53:02 +00:00
    Commented yesterday
  • Please add the output of ps -V to your question. I can't reproduce this on ps from procps-ng 4.0.5-dirty.
    terdon
    –  terdon
    2025-10-13 08:53:09 +00:00
    Commented yesterday
  • ps from procps-ng 4.0.4
    chris01
    –  chris01
    2025-10-13 08:56:44 +00:00
    Commented yesterday

2 Answers 2

4

The documentation suggests that this feature isn’t supposed to work, and that belief is shared, so its loss in version 4.0.3 didn’t cause much reaction (the behaviour change was due to an obscure, and I think incomplete, fix for %cpu handling). However it seems that “AIX free-format” really is supposed to work, and it’s been restored recently; unfortunately the fix is only available in version 4.0.5 of procps, which isn’t available in Debian at all yet, let alone in Debian 13.

I’m not aware of a workaround in your situation, using the version of ps currently in Debian 13; you could build a newer version of ps, and perhaps file an issue in Debian (reportbug procps) pointing to the upstream fix. This is unlikely to qualify for a stable fix though; I think the best you can hope for in Debian itself is for a backport of 4.0.5 once it lands in testing.

You can of course keep the Debian 10, or better, 11, version of ps somewhere and use that; if you don’t have it handy, you can download it and extract it (on amd64) as follows:

$ wget http://deb.debian.org/debian/pool/main/p/procps/libprocps8_3.3.17-5_amd64.deb http://deb.debian.org/debian/pool/main/p/procps/procps_3.3.17-5_amd64.deb
$ sudo apt install ./libprocps8_3.3.17-5_amd64.deb
$ dpkg-deb -x procps_3.3.17-5_amd64.deb myps

Copy myps/bin/ps somewhere else on your PATH, renaming it to myps, and then you’ll be able to run

$ myps -axo "%p ;;; %a"

and get the result you expect. Vulnerabilities are occasionally found in ps, so it’s probably not a great idea to rely on a very old version for general usage.

4

A complete working workaround using a container to serve a specific version of procps, here 4.0.5 (latest working version from @Stephen Kit answer), without messing with apt and your system (isolation by design):

lib requirements/dependencies for 4.O.5 version:
$ ldd /usr/bin/ps
    linux-vdso.so.1 (0x00007fff88d94000)
    libproc2.so.1 => /lib64/libproc2.so.1 (0x00007f8bfa136000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f8bf9f3c000)
    libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007f8bf9e28000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f8bfa1b4000)
    libcap.so.2 => /lib64/libcap.so.2 (0x00007f8bf9e1a000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f8bf9d32000)
Solution to copy/paste in a terminal:
Prerequisite (Debian here)
# apt install docker.io
# systemctl enable --now docker.service
Install/config
cat>Dockerfile<<EOF
FROM opensuse/leap:16.0
RUN zypper -n refresh && zypper -n install procps
ENTRYPOINT ["ps"]
EOF
docker build -t ps:latest .
Usage
docker run \
    --rm \
    --pid=host \
    -v /etc:/host-etc:ro \
    -v /proc:/host-proc:ro \
     ps -axo "%p ;;; %a"

Et voilà...

You can even create a shell alias if you need to simplify this long command.

Note

This is not specific to procps, when you need a specific version of an app (even outdated, like PhpLdapAdmin) in a restricted/private network (I mean, a service not exposed to the whole internet), then, this is your best choice.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.