in reply to Re^2: Win32::Daemon + IPC::Run redirect problem
in thread Win32::Daemon + IPC::Run redirect problem

Yes, I found the same (IPC::Run and IPC::Run3 cannot redirect, backticks and system can). The issue is I was looking at making a Perl script a service which would call other scripts (components). Many of which will use IPC::Run. I don't want to have to convert all the components which use IPC::Run losing the benefits of that module which are probably needed in some cases, and I don't want to impose a limitation on components due to running as a service. Unless there is an easy workaround or a bug fix on the horizon to avoid losing any component functionality, I don't think this is worth me pursuing.
  • Comment on Re^3: Win32::Daemon + IPC::Run redirect problem

Replies are listed 'Best First'.
Re^4: Win32::Daemon + IPC::Run redirect problem
by huck (Prior) on May 08, 2017 at 20:35 UTC

    The service is not started from a command line shell and doesn't have connections to STDOUT,STDERR,STDIN.

    That could be the key to the problem. What if you tried opening them if they are not open yet. That way if somehow IPC::Run is failing because they dont exist yet, well now it has some to takeover when it needs to

      They are "open", so the service process has some kind of emulated STDOUT, but a stat on it will fail. If you close STDOUT, you can see the same behavior from a command-line. If you call another perl script (or itself) from the service script, that child process will work correctly.