[Israel.pm] change proccess name of a forked apache process

Itzik Lerner - Orpak itzik at orpak.co.il
Mon Jul 19 07:18:05 PDT 2004


Thanks Migo, this works usual but not under mod_perl

--Itzik

-----Original Message-----
From: Mikhael Goikhman [mailto:migo at homemail.com] 
Sent: Monday, July 19, 2004 3:09 PM
To: Perl in Israel
Subject: Re: [Israel.pm] change proccess name of a forked apache process

On 19 Jul 2004 15:49:23 +0200, Itzik Lerner - Orpak wrote:
> 
> I need to change the process name ( as it will be displayed by ps) of a
> process
> 
> After I fork'd out from mod_perl  under Apache.
> 
> [...] I get a new process with it's own pid, but when looking of the
> output of ps, the process name is 'httpd',
> 
> I want to change it to something else.

You may modify $0, and this will be reflected in ps on many systems. Try:

  perl -we '$0 = "my-important-process"; sleep 100'

Regards,
Mikhael.

-- 
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl



More information about the Perl mailing list