Re: processname aendern

David Haller <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Hallo,

Am Tue, 22 Nov 2005, Alexandra Druecke schrieb:
>Und zwar möchte ich, daß bei der Anzeige eines in C selbstgeschriebenen 
>Programmes - z.B. mit 'ps ax' - hinter dem Namen des Programmes, der 
>aktuelle Status erscheint. Bei 'sendmail' sieht das z.B. so aus:
>
>4397 ?   Ss   0:00 sendmail: Queue control
>4399 ?   S    0:00  \_ sendmail: running queue: /var/spool/clientmqueue
>4404 ?   Ss   0:00 sendmail: accepting connections
[..]
>Die Frage ist also: Wie geht es richtig? Geht es ÃŒberhaupt richtig? Oder 
>ist das alles nur Pfusch? Und wenn, wie pfuscht man am besten?

Use the source!

grep nach 'accepting connections' in den sendmail-sourcen:

daemon.c:      sm_setproctitle(true, e, "accepting connections");

Und das fuehrt zu:

    setproctitle("%s", buf);

das es teils in der libc gibt, aber das sendmail auch implementiert,
falls es eben nicht vorhanden ist. Siehe conf.c in den
sendmail-sourcen wie sendmail das 'setproctitle' implementiert. 
Beachte aber, wie dabei mit dem Environment umgegangen wird
(initsetproctitle).

HTH,
-dnh

-- 
Vor allem fÀllt mir auf daß syntax highlighting in der Defaultkonfiguration
meistens unbrauchbar ist. Irgendein Depp scheint zu meinen, daß man alle
vorhandenen Farben auch wirklich benutzten muß, so daß das Ergebnis nicht
hilfreich sondern einfach nur schrecklich bunt ist :-/            -- kraxel

-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfÃŒgbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.