Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Background proc requires ENTER keystroke on Windows 2012 (details)

by stevieb (Canon)
on Aug 02, 2016 at 00:56 UTC ( [id://1168973]=note: print w/replies, xml ) Need Help??


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

The latter, tye.

"executing: ..." is displayed before I hit ENTER. This is after I see in Task Manager a new perl.exe process start up. Once it does, the "executing..." line is displayed, then I must hit enter for the entire process to proceed.

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

Replies are listed 'Best First'.
Re^3: Background proc requires ENTER keystroke on Windows 2012 (daemonize)
by tye (Sage) on Aug 02, 2016 at 01:54 UTC

    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        

      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://1168973]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-20 16:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found