On 2026-02-06, Thomas Kupper <[email protected]> wrote:
> 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?

You would need to save it before calling setproctitle (depending on
exactly what you want this for, you could possibly change the
setproctitle call to add the contents of argv)


Reply via email to