Hi list,

I run FreeBSD 8.2-STABLE on most of my systems. Some processes like to 
use setproctitle(3) to let us sysadmins know what's going on. sendmail 
does this, as does ftpd.

The stock top program in FreeBSD has no problems coping with changing 
process titles, but htop does, at least on FreeBSD 8.x.

I have tried htop 0.8.3, compiled through FreeBSD ports hierarchy, and 
I have tried htop 0.9, compiled by myself after downloading the trunk 
subdirectory from the svn repo.

Neither version of htop are able to catch the changing process titles.

What's the status on this issue for other systems, e.g. GNU/Linux, 
from which htop originates?

I used the small test program below to compare the behaviour of htop 
and the stock top in FreeBSD 8.x. The code below will need to be 
tweaked to run on systems other than *BSD.

=== cut ===
// $Ximalas: sleep-setproctitle/sleep-setproctitle.c 10 2011-03-14 14:14:16Z 
trond $

#include <sys/param.h>
#include <sys/types.h>

#include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>
#include <unistd.h>

int main(int argc, char **argv)
{
  int sleeptime;

  setproctitle("starting");

  if (argc < 2) {
    setproctitle("invalid usage");

    fprintf(stderr, "Usage: %s <sleeptime-in-seconds>\n", argv[0]);
    return EX_USAGE;
  } // if

  sleeptime = atoi(argv[1]);

  while (sleeptime > 0) {
    setproctitle("sleeping for %d second%s", sleeptime, (sleeptime == 1) ? "" : 
"s");
    sleep(1);
    sleeptime--;
  } // while

  setproctitle("finished");
  return EX_OK;
} // main()

// sleep-setproctitle.c
=== cut ===


Trond.

-- 
----------------------------------------------------------------------
Trond Endrestøl                     |     [email protected]
ACM, NAS, NUUG, SAGE, USENIX        |   FreeBSD 8.2-S & re-Alpine 2.01
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
htop-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htop-general

Reply via email to