DRb on Windows Wants to Be Touched

K

Keith Fahlgren

Hey,

We all appreciate the special joy that human contact can bring, but this
is driving me crazy....

Warning: I'll admit upfront that I only do occasionally Ruby programming
on Windows, so this could be a simple issue.

Here's the problem:
1. I run a DRb server on a Windows box to provide access to a
Windows-only program (using system())
2. I hit it from a DRb client
3. The command prompt (DOS) on the server side waits/hangs at
(seemingly) random times until I hit some keyboard keys (like, say
CTRL+B) and then it continues

Why in the world should the server wait for human (keyboard)
intervention?

Notes: It does this if I start it from the DOS command line or by
double-clicking the script.
I can start it and run it properly (without keyboard input) when I run
the system() string in DOS directly

The (simplified) DRB server looks like this:

class FooBar
def to_pdf(fo, pdf)
#security stuff here...
system("#{FO2PDF} #{AH_OPTIONS} -pea -d #{fo.untaint} -o
#{pdf.untaint}")
end
end

require 'drb'
require 'drb/acl'
require 'thread'
PORT = 2775
HOSTNAME = 'some.ip.here'

# Security
acl = ACL.new(%w(deny all
allow localhost
allow some.other.ip
))
$SAFE = 1
DRb.install_acl(acl)
puts "SAFE level at #{$SAFE}"
DRb.start_service("druby://#{HOSTNAME}:#{PORT}", FooBar.new)
# Keep running...
puts "Service up and running..."
DRb.thread.join


Any ideas?


Thanks,
Keith
 
A

ara.t.howard

Hey,

We all appreciate the special joy that human contact can bring, but this
is driving me crazy....

Warning: I'll admit upfront that I only do occasionally Ruby programming
on Windows, so this could be a simple issue.

Here's the problem:
1. I run a DRb server on a Windows box to provide access to a
Windows-only program (using system())
2. I hit it from a DRb client
3. The command prompt (DOS) on the server side waits/hangs at
(seemingly) random times until I hit some keyboard keys (like, say
CTRL+B) and then it continues

Why in the world should the server wait for human (keyboard)
intervention?

the program run requires stdin. reopen 'stdin' to 'nul' (or whatever it is in
windows) before becoming a daemon.


-a
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top