From 74bf1c6803f9f3d797fe474862df856edd748e45 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 1 Mar 2013 15:55:22 -0800 Subject: [PATCH] adding doc --- README.markdown | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 README.markdown diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..b766516 --- /dev/null +++ b/README.markdown @@ -0,0 +1,28 @@ +winsw: Windows service wrapper in less restrictive license +========================= + +Why? +---- +Now, I think the first question that people would ask is, why another, when there's [Java Service Wrapper project](http://wrapper.tanukisoftware.org/doc/english/download.jsp) already available. The main reason for writing my own was the license — Java Service Wrapper project is in GPL (so that they can sell their commercial version in a different license), and that made it difficult for [Jenkins](http://jenkins-ci.org/) (which is under the MIT license) to use it. + +Functionality-wise, there's really not much that's worth noting; the problem of wrapping a process as a Windows service is so well defined that there aren't really any room for substantial innovation. You basically write a configuration file specifying how you'd like your process to be launched, and we provide programmatic means to install/uninstall/start/stop services. Another notable different is that winsw can host any executable, whereas Java Service Wrapper can only host Java apps. Whether you like this or not depends on your taste, so I wouldn't claim mine is better. It's just different. + +Usage +----- +You write the configuration file that defines your service. This is the one I use for Jenkins: + + + jenkins + Jenkins + This service runs Jenkins continuous integration system. + + java + -Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080 + rotate + + +You'll rename `winsw.exe` into something like `jenkins.exe`, then you put this XML file as `jenkins.xml`. The executable locates the configuration file via this file name convention. You can then install the service like: + + jenkins.exe install + +... and you can use the exit code from these processes to determine whether the operation was successful. There are other commands to perform other operations, like `uninstall`, `start`, `stop`, and so on.