in reply to Re: fork, exec and pid
in thread fork, exec and pid

Thanks a lot for the clarification, I have finally decided to implement the redirection myself and skip the intermediate shells:

#child print "This is child $$\n"; open STDERR, '>&STDOUT'; open STDOUT, '> /pathlogs/mylog.log'; my $command='sh /path/process.sh'; exec($command);

This way, killing the pid of the child, we kill the command process and I also get the redirections.

It also seems to work with

#child print "This is child $$\n"; open STDERR, '>&STDOUT'; open STDOUT, '> /pathlogs/mylog.log'; my $script='/soft/perl-version/bin/perl /path/process.pl'; exec($script);

I will clearly have to research more to use correctly exec and pid managing :)