Redirect stdout and stderr in Windows Service
I created开发者_如何学Python a windows service that can execute processes exposed via wcf (internal use only). I recently ran into an issue where this works fine if I execute the process (cmd.exe) directly, but when installed to run as LOCALSYSTEM, output and error redirection didn't work. After a day or so, I figured out that if I also redirect stdin, things work fine. I found a related thread here, but no real resolution.
Anyway, I was wondering if anyone knows the reason for this and are there known issues with output in Windows Services?
One complication is that I recently installed W7 SP1, so I'm not sure if this changed the behavior or not since I haven't had a chance to uninstall and try again.
The standard streams are only available to processes that are running interactively. Windows Services do not run in interactive mode.
精彩评论