setproctitle()
Timo Sirainen
tss@iki.fi
Wed Sep 30 23:53:00 GMT 2009
On Sep 30, 2009, at 7:29 PM, KOSAKI Motohiro wrote:
> PR_SET_NAME (since Linux 2.6.9)
> Set the process name for the calling process, using
> the value in
> the location pointed to by (char *) arg2. The name can
> be up to 16
> bytes long, and should be null terminated if it
> contains fewer
> bytes.
>
> but it isn't correct.
> PR_SET_NAME change thread name, but process name.
>
> More unfortunately, it only change task->comm. not change arg[0].
> Thus, some command display wrong name...
> (ps can display both, switched by command line option)
>
> So, we shouldn't use it.
16 bytes is also way too little.
> Perhapls, I can make new syscall (or new prctl type). but I don't know
> why the user want to change process title.
> Do you have the any information?
Several programs already change it to display the current state of the
process. I know sendmail and openssh at least do it already. I was
also hoping to change my IMAP server to display some useful state,
such as what IMAP command it's currently executing, or proxying
processes could show how many connections they're proxying, etc. Then
if system seems slow you could easily check with "ps" what the
processes are doing.
More information about the Libc-alpha
mailing list