Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restarting Hudson on Windows

I've been having an issue with Hudson on windows.

Whenever I update Hudson or a plugin I get the option to restart when no jobs are running.
If I click this button Hudson hangs and doesn't restart. I've tried restarting the Hudson service but this doesn't help, so end up having to reboot the box to bring Hudson back online.

I've just updated to the most recent version, but didn't click the restart button and it's now vanished.

Is there a correct way to restart Hudson on windows?

Cheers

Tom

like image 212
TDH Avatar asked Sep 21 '10 11:09

TDH


People also ask

How long does Jenkins take to restart?

I also restarted the Jenkins service and it worked. It did take 3-4 minutes after I restarted the service for the page to load up, though. So make sure you're patient before moving on to something else.


1 Answers

I have a this problem once in a while too. For some reason the Hudson server does not shut down completely and the server that starts up, can not use the port. To fix that problem, I run `netstat -n -o'. This way I can find out the process ID that holds the port and kill that app through taskmanager. Now I can restart the service and Hudson comes up fine.

For the last few weeks I had a similar problem. The description says, that it restarts the app, when no processes are running. I missed out on one job that was hold in the build queue and because of a faulty configuration never actually build, therefore preventing Hudson from restarting.

After all of your jobs are finished and your server does not restart. Just visit the restart page again http://server:port/restart and try to restart again. If that doesn't work stop the service and start it again.


UPDATE:

Since I grew tired of physically logging into the Hudson/Jenkins server, I now use following commands to run the kill remotely. These commands assume that you run the service with a dedicated user (e.g. JenkinsUser). If another process running with the same credentials than the service does and might start java.exe, you need to run the netstat which needs to be executed locally on the Jenkins server or by using rexec (this was not an option for me).

:: get the pid of jenkins java.exe
tasklist /S %JENKINSSERVER% /FI "IMAGENAME eq java.exe" /FI "USERNAME eq %DOMAIN\USERNAME%"

:: terminate process use pid from previous command (instead of 1234)
taskkill /S %JENKINSSERVER% /F /T /PID 1234

:: stop the Jenkins service (just in case the service is hanging)
sc \\%JENKINSSERVER% stop Jenkins

:: start the Jenkins service again
sc \\%JENKINSSERVER% start Jenkins

If I have to much time, I might create a script out of it.

like image 156
Peter Schuetze Avatar answered Oct 11 '22 21:10

Peter Schuetze