Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7937

debian init.d script needs to sleep during a restart command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Ubuntu 10.04
      Hudson 1.381

      Hudson does not restart properly when calling "/etc/init.d/hudson restart". When it calls "do_start" java hasn't let go of port 8080 so the restart fails. The solution is to sleep for 2 seconds between stopping and starting:

       
        restart|force-reload)
          #   
          # If the "reload" option is implemented then remove the
          # 'force-reload' alias
          #   
          log_daemon_msg "Restarting $DESC" "$NAME"
          do_stop
          sleep 2 # wait for java to release the port !!
          case "$?" in
            0|1)
              do_start
              case "$?" in
                0) log_end_msg 0 ;;
                1) log_end_msg 1 ;; # Old process is still running
                *) log_end_msg 1 ;; # Failed to start
              esac
              ;;  
            *)  
              # Failed to stop
              log_end_msg 1
              ;;  
          esac
          ;;  
      

            Unassigned Unassigned
            tjwallace tjwallace
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: