SPUG: Creating a NON zombie daemon

El JoPe Magnifico jope-spug at n2h2.com
Tue Apr 18 15:23:21 CDT 2000


On Tue, 18 Apr 2000, Thomas Holkenbrink wrote:
>> Either that or the PID itself since the execed process
>> will re-use the same number.
> 
> The PID changes from run time till the exec... if the proccess
> starts out as one PID then changes to another??? 

Note that if you do your exec() with a single arg, or any of the args
contain shell metacharacters, the command will be exec'ed using "/bin/sh
-c", which will run under the original PID, but then fork off the command
under a different PID.  In other words, do...
	exec("java", "myClass.class");
rather than...
	exec("java myClass.class");
Nasty gotcha to remember anytime you do exec() or system().  =)
  -jp


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