Last updated November 01, 2008 22:49, by kohsuke
Feedicon  
This project creates a wrapper executable that can be used to host any executable as an Windows service. =Download= <a href="http://maven.dyndns.org/2/com/sun/winsw/winsw/">The binaries are available here</a> for download. =Usage= During your development... # Take <code>winsw.exe</code> from the distribution, and rename it to your taste (such as <code>myapp.exe</code>) # Write <code>myapp.xml</code> (see [[Configuration Syntax]] for more details) # Place those two files side by side when you deploy your application, because that's how <code>winsw.exe</code> discovers its configuration. At runtime... * To install a service, run <code>myapp.exe install</code> * To start a service, run <code>myapp.exe start</code> * To stop a service, run <code>myapp.exe stop</code> * To restart a service, run <code>myapp.exe restart</code> * To uninstall a service, run <code>myapp.exe uninstall</code> When there's a problem, these commands also report an error message to stderr. On a successful completion, these commands do no produce any output and exit with 0. In addition, you can also run <code>myapp.exe status</code> to have it print out the current status of the service to stdout. Again, any error encountered during the processing would cause output to be reported to stderr. All these commands use the same set of [[ExitCode|exit code]] to indicate its result. ==Deferred File Operations== To support self updating services, winsw offers a mechanism to perform file operations before a service start up. This is often necessary because Windows prevents files from overwritten while it's in use. To perform file operations, write a text file (in the UTF-8 encoding) at <code>myapp.copies</code> (that is, it's in the same directory as <code>myapp.xml</code> but with a different file extension), and for each operation add one line: * To move a file, write "src>dst". If the 'dst' file already exists it will be overwritten. The success or failure of these operations will be recorded in the event log. =Contributions Welcome= If you are interested in joining the project, let me know. I'm always interested in more committers.
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close