log = Log.new( "#{BuildServer::CONFIG_ROOT}/#{option[:name]}/main.log" )
begin
while(true)
- log.info "Build Server[#{option[:name]}] Start - PORT:[#{option[:port]}]"
+ log.info "Build Server[#{option[:name]}] Start - PORT: [#{option[:port]}]"
# Start child process
cmd = Utils.generate_shell_command("#{File.dirname(__FILE__)}/build-svr start -n #{option[:name]} -p #{option[:port]} --CHILD")
- IO.popen(cmd)
+
+ io = IO.popen(cmd)
+ puts io.readlines()
+
pid = Process.wait
# End chlid process
log.info "Down Build Server for DIBS upgrade."
break
else
+ log.error("Exit value : #{$?.exitstatus}")
log.error "Down Build Server. Try reboot Build Server."
end
end
# init transport path
if not File.exist? @transport_path then FileUtils.mkdir_p @transport_path end
+
+ #check that the port is open
+ if BuildCommServer.port_open? port then
+ errMsg = "Port \"#{port}\" is already in use."
+ @log.info "Server creation failed"
+ @log.error errMsg
+
+ puts "Server creation failed"
+ puts errMsg
+
+ return
+ end
# init project mgr
@log.info "Setting Project Manager..."
File.open(@run_file_path, "w") do |f|
f.puts @port
end
+
+ #check that the port is open
+ if BuildCommServer.port_open? port then
+ errMsg = "Port \"#{port}\" is already in use."
+ @log.info "Server creation failed"
+ @log.error errMsg
+
+ puts "Server creation failed"
+ puts errMsg
+
+ return
+ end
+
# set job request listener
@log.info "Setting listener..."