[Title] // add exception process in build-svr
authordev.sungmin.kim <dev.sungmin.kim@samsung.com>
Wed, 5 Sep 2012 02:10:07 +0000 (11:10 +0900)
committerdev.sungmin.kim <dev.sungmin.kim@samsung.com>
Wed, 5 Sep 2012 02:10:07 +0000 (11:10 +0900)
[Type]      //
[Module]    //
[Priority]  //
[CQ#]       //
[Redmine#]  //
[Problem]   //
[Cause]     //
[Solution]  //
[TestCase]  //

build-svr

index 7434c323ea4fdbf2dee576108804e276992b568e..fd881ffc7532c28bedcc5b31feab14f2d26d0fb9 100755 (executable)
--- a/build-svr
+++ b/build-svr
@@ -86,29 +86,33 @@ begin
                        BuildServerController.start_server( option[:name], option[:port] ) 
                else  # Parent Process
                        log = Log.new( "#{BuildServer::CONFIG_ROOT}/#{option[:name]}/main.log" )
-                       while(true)
-                               log.info "Build Server[#{option[:name]}] Start - PORT:[#{option[:port]}]"
-                               # Start child process
-                               cmd = Utils.execute_shell_generate("#{File.dirname(__FILE__)}/build-svr start -n #{option[:name]} -p #{option[:port]} --CHILD")
-                               IO.popen(cmd)
-                               pid = Process.wait
-
-                               # End chlid process
-                               log.info "Child process terminated, pid = #{pid}, status = #{$?.exitstatus}"
-                               if ($?.exitstatus == 0) then # SERVER STOP COMMAND
-                                       log.info "Down Build Server."
-                                       break
-                               elsif ($?.exitstatus == 99) then # DIBS UPGRADE
-                                       cmd = "#{File.dirname(__FILE__)}/upgrade -l #{File.dirname(__FILE__)} -S -t BUILDSERVER -n #{option[:name]} -p #{option[:port]}" 
-                                       cmd = Utils.execute_shell_generate(cmd)
-                                       puts cmd
-                                       Utils.spawn(cmd)
-                                       log.info cmd
-                                       log.info "Down Build Server for DIBS upgrade."
-                                       break
-                               else
-                                       log.error "Down Build Server. Try reboot Build Server."
+                       begin
+                               while(true)
+                                       log.info "Build Server[#{option[:name]}] Start - PORT:[#{option[:port]}]"
+                                       # Start child process
+                                       cmd = Utils.execute_shell_generate("#{File.dirname(__FILE__)}/build-svr start -n #{option[:name]} -p #{option[:port]} --CHILD")
+                                       IO.popen(cmd)
+                                       pid = Process.wait
+
+                                       # End chlid process
+                                       log.info "Child process terminated, pid = #{pid}, status = #{$?.exitstatus}"
+                                       if ($?.exitstatus == 0) then # SERVER STOP COMMAND
+                                               log.info "Down Build Server."
+                                               break
+                                       elsif ($?.exitstatus == 99) then # DIBS UPGRADE
+                                               cmd = "#{File.dirname(__FILE__)}/upgrade -l #{File.dirname(__FILE__)} -S -t BUILDSERVER -n #{option[:name]} -p #{option[:port]}" 
+                                               cmd = Utils.execute_shell_generate(cmd)
+                                               puts cmd
+                                               Utils.spawn(cmd)
+                                               log.info cmd
+                                               log.info "Down Build Server for DIBS upgrade."
+                                               break
+                                       else
+                                               log.error "Down Build Server. Try reboot Build Server."
+                                       end
                                end
+                       rescue => e
+                               log.error( e.message, Log::LV_USER)
                        end
                end
        when "stop"