-
Bug
-
Resolution: Fixed
-
Major
-
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 ;;
Fixed in 1.388 as https://github.com/hudson/hudson/commit/1168ddff5da6e2f84065949200b1ce92fd207d1d
Sleeping a fixed amount of time is obviously not the right approach
, so instead I modified the script to poll for the termination of the process.