Hi,

I am trying to start Webrick as root user and get TCP Bind error even
though the port appears to be not taken.  Running the same script as a
non-root user that owns the ruby installs works just fine.

1) Running dvdelta_start.sh runs just fine as a non root user
2) Running the same script gives me TCP Bind error
 su - dvdelta -c "/opt/apps/datavail/current-delta/dvdelta_start.sh
start" 2>&1 >>/tmp/dvdelta.log

I'd appreciate any pointers to help debug this issue.

Thanks.

Prakash
+++++++++++++++++++++++++++++++++++


The log file shows the following -

[2009-05-22 04:46:37] INFO  WEBrick 1.3.1
[2009-05-22 04:46:37] INFO  ruby 1.8.7 (2009-04-08) [x86_64-linux]
[2009-05-22 04t:46:47] WARN  TCPServer Error: Address already in use -
bind(2)
[2009-05-22 04:46:47] INFO  WEBrick::HTTPServer#start: pid=30733
port=8192



login as: root

++++++++++++++++++++++++++++++++++++++++++++++++++
class JobServer

   def initialize(jobRepository, port)
     @repos = jobRepository
     @port = port
   end

   def run
    @server = HTTPServer.new( :Port => @port )
    @server.mount("/styles.css", CssServlet)
    @server.mount("/jobs", ListJobsServlet, @repos)
    @server.mount("/deploy", DeployJobServlet, @repos)
    @server.mount("/", IndexServlet)
    trap("INT"){ @server.shutdown }
    @server.start
   end

end
/
++++++++++++++++++++++++++++++++++++++++++++++++++++
Calling the server start...

  server = JobServer.new(jobRepository, 8192)
  server.run

++++++++++++++++++++++++++++++++++++++++++++++++++++
The log file shows the following -

[2009-05-22 04:46:37] INFO  WEBrick 1.3.1
[2009-05-22 04:46:37] INFO  ruby 1.8.7 (2009-04-08) [x86_64-linux]
[2009-05-22 04:46:47] WARN  TCPServer Error: Address already in use -
bind(2)
[2009-05-22 04:46:47] INFO  WEBrick::HTTPServer#start: pid=30733
port=8192
-- 
Posted via http://www.ruby-forum.com/.