On Sat, 2006-04-22 at 17:47 +0300, Karjala wrote:
> I would do: system("external.pl &") followed by system("disown %1"),
> but
> I'm not sure if that would work (and correctly 100% of the time).
> What
> if, for example, external.pl hasn't become job %1 yet when the disown
> command is called?
Just write your external script so that can be daemon-ized (standard
double-fork stuff, etc.) Your mason comp can call your script easy
enough.
I don't know what type of processing you want to do, but you may
consider adding a timeout of some kind to this script. The way that we
have approached it in the past is to launch the external script and pass
--timeout $seconds. In your daemon-ized script, you can then grab
$timeout via getopt and:
* Write a handler for $SIG{ALARM} so that it dies with something like
'timed out'
* alarm $timeout
* do your processing under eval in a while loop.
* catch the value of [EMAIL PROTECTED] If =~ /timed out/, then write a useful
msg to
some type of log.
* If your processing finishes before timing out, then kill 'TERM' your
$pid
This will help you from having some type of bug that launches a whole
lotta processes that never die.
HTH,
--Larry
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users