public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: setproctitle
@ 2004-08-19  1:04 Albert Cahalan
  0 siblings, 0 replies; 9+ messages in thread
From: Albert Cahalan @ 2004-08-19  1:04 UTC (permalink / raw)
  To: rwhite; +Cc: linux-kernel mailing list

> What happens to all the little ps (etc.) programs
> when I munge together a *really* *long* title?

Obviously, ps prints a *really* *long* title.
I suppose, given enough tasks and ps options that
cause sorting, you could run ps out of memory.

> I'd prefer a setthreadtitle(char * new_title) such
> that the individual threads in a process (including
> the master thread, and so setproctitle() function
> is covered) could be re-titled to declare their
> purposes.  It would make debugging and logging a
> lot easier and/or more meaningful sometimes. 8-)

You won't see this in ps output. To save memory
and avoid reading normally-redundant info, ps will
only read the cmdline data once for a process.

You can get the thread ID with "ps -efL", "ps -efT",
"ps -efLm", and so on. That's pretty good. Have it all:

ps -emostat,c,psr,rtprio,class,ppid,pid,tid,nlwp,wchan:9,args

> It would also let the system preserve the original
> invocation and args for the lifetime of the process
> to prevent masquerading.  You know, by default the
> title is the args, but the set operation would
> build the new title in a new kernel-controlled
> place and move the pointer.

Now, this I like.

Solaris stores the first 80 bytes of argv in the
kernel. Modifications do not show up. HP-UX stores
the first 64 bytes, and in recent releases can
also supply a kilobyte of (modified?) argv.



^ permalink raw reply	[flat|nested] 9+ messages in thread
* setproctitle
@ 2004-08-18  8:28 DervishD
  2004-08-18  8:58 ` setproctitle William Lee Irwin III
  0 siblings, 1 reply; 9+ messages in thread
From: DervishD @ 2004-08-18  8:28 UTC (permalink / raw)
  To: Linux-kernel

    Hi all :)

    Is there any special reason not to implement setproctitle in the
kernel? In user space is a bit difficult to implement since 'argv[0]'
cannot grow beyond the initially allocated space, better said, it can
grow but only changing the pointer to another place or eating the
space occupied by the other arguments.

    proftpd has a not-very-polite set_proc_title that misses the
final NULL, and a couple of other programs out there uses it, too.
Applications should be free to change theirs proc titles to some
pretty if they want, shouldn't they?

    In proc/base.c you can read about 'setproctitle(3)', that is, in
library space (user space), not kernel space, but AFAIK only FreeBSD
has setproctitle :?

    Thanks in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-08-20 16:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-19  1:04 setproctitle Albert Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2004-08-18  8:28 setproctitle DervishD
2004-08-18  8:58 ` setproctitle William Lee Irwin III
2004-08-18 21:21   ` setproctitle Robert White
2004-08-18 21:28     ` setproctitle William Lee Irwin III
2004-08-18 21:46     ` setproctitle Richard B. Johnson
2004-08-20 16:23     ` setproctitle 'DervishD'
2004-08-20 16:20   ` setproctitle DervishD
2004-08-20 16:33     ` setproctitle William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox