Quick Tip – Make Anything A Windows Service

I recently had to get nginx running as a Windows service and I came across a little project called “winsw” (Windows Service Wrapper) which was created by Kohsuke Kawaguchi – creator of Hudson/Jenkins.

Apparently he created it while at Sun for Hudson. The other popular Java Service Wrapper for Windows (by Tanuki) is GPL licenced and has commercial licences available. Kohsuke created “winsw” so there was an option for Hudson available under a more permissive licence than GPL.

Conveniently, “winsw” can actually be used with pretty much any process you want to turn into a windows service, not just Java apps.

It’s got really simple configuration with an XML file e.g.

<service>
  <id>fisheye</id>
  <name>dev.net FishEye</name>
  <description>FishEye</description>
  <executable>%FISHEYE_HOME%\bin\fisheyectl.bat</executable>
  <logpath>P:\dev\logs\os\windows\services</logpath>
  <logmode>roll</logmode>
  <depend>Spooler</depend>
  <startargument>run</startargument>
  <stopargument>stop</stopargument>
</service>

And it’s basically just a single EXE file (31KB) and the XML config (although it does require .NET 3).

Anyhow, this is a nice little tool to have in your toolbelt, particularly for getting non-Windows friendly stuff running on Windows servers!

Related posts:

  1. Use Hudson (now Jenkins) to restart a Windows service…
  2. Setting Up Memcached As A Windows Service
  3. 1 Minute Guide – Installing Redmine on Windows
  4. Netbeans 7 + Git plugin on Windows Issues?
  5. Thoughts on the WordPress & Thesis GPL hoo-haa

This entry was posted in IT, Software Engineering and tagged open-source, servers, tips, windows. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>