Quick Tip - Make Anything A Windows Service
Published Thu, 15 Sep 2011
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!
About the Author
Richard Nichols is an Australian software engineer with a passion for making things.
You might also enjoy reading -
- Use Hudson (now Jenkins) to restart a Windows service...
- Recruitment From The "Other Side" - Part 1
- Wicket On Google App Engine (GAE) - Deployment Configuration
- Clever way of waiting for a specified delay in a DOS / Windows batch file...
- Setting Up Memcached As A Windows Service