Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello all, I'm "porting" some shell scripts to run on win32 platforms (how fun) and have run into a problem. One of the scripts is a boot-time script which launches a daemon and then checks to make sure the daemon is running. The daemon prints prints both to STDOUT and STDERR. The current shell script runs this daemon through a sub-shell and then into a log file. This is done to allow log rotation without killing the daemon. The problem I am having is with actually spawning the daemon. I have tried fork(), Win32::Process, and pipes to no avail. It seems that each of these is waiting for the child to return before exitting. This child process (daemon) will not return, nor do I want it to. Also, I can not perform any action (request) which requires talking w/ the daemon while the parent is still waiting for the child to return (die). Any suggestions on how to do this in the win32 environment? I will supply some code if needed. Thanks, Eric

Replies are listed 'Best First'.
(jcwren) Re: spawning children in Win32 environment
by jcwren (Prior) on Oct 04, 2000 at 02:37 UTC
RE: spawning children in Win32 environment
by vladdrak (Monk) on Oct 04, 2000 at 04:55 UTC
    If you want to spawn and run, you could backtick a `start whatever` or do a system("start whatever"), although using Win32::Process more effectively is probably cooler. :) I've used named pipes for communication, so you might give that a shot.
    -Vlad