Clarkman has asked for the wisdom of the Perl Monks concerning the following question:
Hello!
We are experiencing some re-direct issues with the system call. Hard thing is, the behavior is not determinate. We run a script thus:
Then inside the script we fork off, and use system() to spawn another child process like this:/usr/bin/nohup ./do-upgrades.pl > do-upgrades.log &
We then waitpid inside the forked process until upgrade.pl exits. Been stable for years. But, as we have drilled down into the logs, we have found that in some cases the upgrade.pl child process starts out writing to its parent process log (do-upgrades.log), and in other instances it writes to worklog correctly as directed. Anyone have ideas how this is happening? THANKS!if(defined ($f) and $f==0) { # I'm a child my $result = system("./upgrade.pl $sensor >> worklog 2>&1"); print "result from upgrade script for $sensor was $result.\n"; exit(0); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: system() call mis-directs?
by jcb (Parson) on Mar 03, 2020 at 00:47 UTC | |
by haukex (Archbishop) on Mar 03, 2020 at 07:43 UTC | |
by afoken (Chancellor) on Mar 03, 2020 at 21:35 UTC | |
by jcb (Parson) on Mar 04, 2020 at 00:55 UTC | |
by Clarkman (Novice) on Mar 03, 2020 at 01:05 UTC | |
by jcb (Parson) on Mar 03, 2020 at 02:42 UTC | |
| |
by Clarkman (Novice) on Mar 05, 2020 at 00:11 UTC | |
by Clarkman (Novice) on Mar 05, 2020 at 02:33 UTC | |
by jcb (Parson) on Mar 06, 2020 at 00:04 UTC | |
Re: system() call mis-directs?
by haukex (Archbishop) on Mar 03, 2020 at 07:42 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom