Hi,
I had a good working program, what it did was reading a message from a unix queue, forking a process, in the child process execute an ftp script, and in the parent process waiting for the process to end, or waiting for the signal SIGALRM to go off (waitpid is doing that for me).
So this code used to work fine:
signal(SIGALRM, alarm_catcher)
alarm (60)
lreturnpid = waitpid (lpid, &lstatus, 0);
So the waitpid function does exit when, a) the child process terminates b) the SIGALRM is called.
The only change I did was instead of using unix queues, starting to use jms queues to read from (Fiorano).
Appearently Fiorano also reacts on signals, requests SIGALRM signals when no message on the queue and reads SIGALRM signals.
The effect is that my orig code does not work anymore, since Fiorano steals the timeout alarm meant for my script ... I think that is the reason ...
What I am looking for is an alternative for the waitpid function that does not use signals, but does stop waiting after some time or when the process is finished ... what first occurs ...
Thanks,
Tim
Start Free Trial