SPUG: Creating a NON zombie daemon

Thomas Holkenbrink Thomas_Holkenbrink at emeraldsolutions.com
Tue Apr 18 12:17:26 CDT 2000


Alright .. with a little better understanding and a good read of the
differences between the two.. System and Exec..  so the next problem is Now
that the daemon is running what would be the quickest way to grep the PID of
that process... a grep through ps -ef looking for my class name??

Thomas

-----Original Message-----
From: ced at carios2.ca.boeing.com [mailto:ced at carios2.ca.boeing.com]
Sent: Monday, April 17, 2000 7:15 PM
To: Thomas_Holkenbrink at emeraldsolutions.com; spug-list at pm.org
Subject: Re: SPUG: Creating a NON zombie daemon


> I have a Java application that will run like a daemon for a Perl
program...
> but How do I start the daemon up and Only have one PID associated with it?

> I have tried like this but I get two process?
> <CODE>

That's because system("java...") forks. 

> system("java myClass.class");

Perhaps this is what you want:

exec "/path/to/java", "myClass.class"   or die "exec: $!";


> I would like to be able to something similar in a init script but it wont
> work??? any ideas?  It seems to function but nothing ever shows up in a
"ps
> -ef"

Could the Java program be exiting prematurely... ?    


Rgds,
--
Charles DeRykus

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe
           Email to majordomo at pm.org: "action" spug-list your_address


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe
           Email to majordomo at pm.org: "action" spug-list your_address





More information about the spug-list mailing list