Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by tye (Sage)
on Aug 02, 2016 at 01:54 UTC ( #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
Node Status?
node history
Node Type: note [id://1168978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2020-10-29 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (270 votes). Check out past polls.

    Notices?