SPUG: Creating a NON zombie daemon

Scott Blachowicz scott at sabmail.rresearch.com
Mon Apr 17 20:31:09 CDT 2000

On Mon, Apr 17, 2000 at 06:01:27PM -0700, Thomas Holkenbrink wrote:
> system("java myClass.class");

Try "exec".  On Unix systems "fork()" copies your process to form a
new one and "exec()" overlays a process with a new one.  (you
frequently see "fork & exec" mentioned together).  So, you probably
want something like

	exec ("java", "myClass.class");

> 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"

Sounds to me like it dies early or doesn't get started?  Maybe your
$PATH for the init script is different than what it is otherwise, so
it can't find "java"?  Try specifying full paths to things?  Make sure
you capture your stdout/stderr to a file somewhere and see if there
are any clues there?  Do debugging dumps of environment variables from
the perl script to look for clues?


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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