# DRb on Windows Wants to Be Touched

**URL:** <https://www.ruby-forum.com/t/drb-on-windows-wants-to-be-touched/101247>\
**Category:** Ruby\
**Created:** [August 3, 2006, 7:13pm UTC](https://www.ruby-forum.com/t/drb-on-windows-wants-to-be-touched/101247 "2006-08-03T19:13:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![keith2koool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/67e7ee/32.png) [@keith2koool](https://www.ruby-forum.com/u/keith2koool)\
**Post date:** [August 3, 2006, 7:13pm UTC](https://www.ruby-forum.com/t/drb-on-windows-wants-to-be-touched/101247/1 "2006-08-03T19:13:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![keith2koool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/67e7ee/32.png) [@keith2koool](https://www.ruby-forum.com/u/keith2koool)\
**Post date:** [August 3, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/drb-on-windows-wants-to-be-touched/101247/2 "2006-08-03T19:25:38Z")

</div>

On Fri, 4 Aug 2006, Keith F. wrote:

> 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
