| Installing Hudson as a Windows Service |
|
|
|
| Tuesday, 17 March 2009 12:00 |
|
I don't usually recommend using Windows for your build server, but sometimes you may not have a choice. You may be running Microsoft tools as an integral part of your build lifecycle, for example, or be constrained to use the local company standards. This article tells you how it can be done. Hudson has a very convenient feature designed to make it easy to install Hudson as a Windows servers. There is currently no graphical installer that does this for you, but you get the next best thing - a web-based graphical installer. First, you need to start the Hudson server on your target machine. The simplest approach is to run Hudson using Java Web Start (see http://wiki.hudson-ci.org/display/HUDSON/Meet+Hudson#MeetHudson-TestDrive). Alternatively, you can do this by downloading Hudson and running it from the command line, as you would normally do:
This second option is useful if the default Hudson port (8080) is already being used by another application. It doesn't actually matter too much which port you use - you can change this later. Next, connect to this server and go to the Manage Hudson screen. Here you will find an "Install as Windows Service" button. This will create a Hudson service on the server that will automatically start and stop Hudson in an orderly manner. Hudson will prompt you for an installation directory. This will be the Hudson home directory (HUDSON_HOME). The default value is the default HUDSON_HOME value: a directory called ".hudson" in the current user's home directory. This is often not a good choice for a Windows installation. When running Hudson on Windows, you should avoid installing your Hudson home directory anywhere near your "C:\Documents And Settings" directory - not only is it a ridiculously long name, the spaces can wreak havoc with your Ant and Maven builds and any tests using classpath-based resources. It is much better to use a short and sensible name such as "C:\hudson".
A short home directory path is sometimes required for other reasons, too. On many versions of Windows (Windows XP, Windows Server 2003,...), file path lengths are limited to around 260 characters. If you combine a nested Hudson work directory and a deep class path, you can often overrun this, which will result in very obscure build errors. To minimize the risks of over-running the Windows file path limits (and without having to reformat your disk and install Ubuntu in its place, an option unfortunately not available to everyone ;-) ), you need to redefine the HUDSON_HOME environment variable to point to a shorter path in the hudson.xml file, as shown above. This approach won't always work with Windows Vista. The best solution to this problem is to reformat your hard disk and install a proper operating system. If this is not a feasible option, then open the command line prompt as an administrator (right-click, "Run as administrator") and to execute the
This basic installation will work fine in a simple context, but you will often need to fine-tune your service. For example, by default, the Hudson service will be running under the local System account. However, if you are using Maven, Hudson will need an
You configure the finer details of the Hudson service in a file called hudson.xml, in the same directory as your hudson.war file. Here you can configure (or re-configure) ports, JVM options, an the Hudson work directory. In the following example, we give Hudson a bit more memory and get it to run on port 8081:
Finally, if you need to uninstall the Hudson service, you can do one of two things. The simplest is to run the Hudson executable with the "uninstall" option:
Bookmark
Email this
Trackback(0)
Comments (4)
![]() written by hardysale, February 08, 2010
Shoppers pay up to Cheap ED Hardy Shoes,Clothes lining. If you asylum’t experience the comfort of authentic
written by Discount Air Jordan , April 13, 2010
Wow! What an eclectic mix of Flash websites! I have to agree with others about the issue of SEO marketing with Flash, but you have to admit, these are very clever websites! Plus, it's fun to do something different. Flash is different and engaging, and you can't get these types of websites with HTML. Thanks for sharing!
Discount Air Jordan written by This e-mail address is being protected from spambots. You need JavaScript enabled to view it , April 13, 2010
What a great blog! It is a pity that I can not find RRS address. If RRS offers a subscription service, I can easily follow your blog!
By Air Jordans written by Joe Breher, March 17, 2011
I am encountering an issue with running jenkins as a service. After a few minutes of operation, the service just stops. An attempt to restart it fails immediately with a dialog indicating the service stopped.
If I uninstall from command line, then reinstall through jenkins GUI, the service will operate for a few minutes before stopping again. Do you have a suggestion for how I would debug this issue? Are there some logs I should be scrutinizing? XP SP2 32-bit Pro, Jenkins 1.401 (failed similarly on 1.400). Write comment
|
|