Friday, February 06, 2026

How to get process command line?

Hi,

I'm playing around with Chrony and used setproctitle() to set the title
of the involved process (main, helper and NTS helper).

And I can't figure out how to receive the command line the application
was started with after using setproctitle().

E.g. running 'ps -o command' outputs before setproctitle():

$ ps -auxo command | fgrep chronyd
_chrony 43240 <snip> chronyd -F 0 -u _chrony -d -f /etc/chrony.conf
_chrony 77494 <snip> chronyd -F 0 -u _chrony -d -f /etc/chrony.conf
root 18016 <snip> chronyd -F 0 -u _chrony -d -f /etc/chrony.conf

running 'ps -o command' outputs after setproctitle():

$ ps -auxo command | fgrep chronyd
_chrony 47331 <snip> chronyd: server (chronyd)
_chrony 64136 <snip> chronyd: NTS helper (chronyd)
root 56489 <snip> chronyd: PRV helper (chronyd)

What tool would show the calling command line? Would someone be able to
nudge me into the right direction?


/Thomas

No comments:

Post a Comment