Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Background proc requires ENTER keystroke on Windows 2012 (daemonize)

by tye (Sage)
on Aug 02, 2016 at 01:54 UTC ( [id://1168978]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Background proc requires ENTER keystroke on Windows 2012 (details)
in thread Background proc requires ENTER keystroke on Windows 2012

You can probably prevent this problem by "backgrounding" your daemon the proper way, by daemonizing it. No, Proc::Background does not do that either.

If you at least re-open STDIN, STDOUT, and STDERR to/from File::Spec->devnull() (or even have the last two append to some log file), then I will be a bit surprised if the daemon has the ability to ask for input from the calling context.

Some of the daemonize modules might even know the right trick for completely disassociating the daemon from the parent's "console" (similar to what motivates the setsid() part of daemonizing on Unix). If not, you could try calling Free() in Win32::Console, though I don't recall having tried that and I have not swapped back in most of what little I used to know about Win32 "consoles".

If I wanted to try and debug what is happening, then I'd probably next look for a compatible version of "process monitor" such as one from the former SysInternals.

- tye        

  • Comment on Re^3: Background proc requires ENTER keystroke on Windows 2012 (daemonize)
  • Download Code

Replies are listed 'Best First'.
Re^4: Background proc requires ENTER keystroke on Windows 2012 (daemonize)
by stevieb (Canon) on Aug 02, 2016 at 15:27 UTC

    I see what you mean now tye regarding properly daemonizing the process compared to just putting it into the background.

    I'm looking at the daemon modules now, and will get some test code written later on today.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1168978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found