This project creates a wrapper executable that can be used to host any executable as an Windows service.

Download

The binaries are available here for download.

Usage

During your development...

  1. Take winsw.exe from the distribution, and rename it to your taste (such as myapp.exe)
  2. Write myapp.xml (see Configuration Syntax for more details)
  3. Place those two files side by side when you deploy your application, because that's how winsw.exe discovers its configuration.

At runtime...

  • To install a service, run myapp.exe install
  • To start a service, run myapp.exe start
  • To stop a service, run myapp.exe stop
  • To restart a service, run myapp.exe restart
  • To uninstall a service, run myapp.exe uninstall

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 myapp.exe status 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 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 myapp.copies (that is, it's in the same directory asmyapp.xml 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.

Windows Service Wrapper的更多相关文章

  1. 使用Windows Service Wrapper快速创建一个Windows Service

    前言 今天介绍一个小工具的使用.我们都知道Windows Service是一种特殊的应用程序,它的好处是可以一直在后台运行,相对来说,比较适合一些需要一直运行同时不需要过多用户干预的应用程序,这一类我 ...

  2. 使用Windows Service Wrapper快速创建一个Windows Service 如nginx

    前言 今天介绍一个小工具的使用.我们都知道Windows Service是一种特殊的应用程序,它的好处是可以一直在后台运行,相对来说,比较适合一些需要一直运行同时不需要过多用户干预的应用程序,这一类我 ...

  3. 详解Windows Service Wrapper(winsw.exe)及应用场景

    winsw.exe可以帮助nginx作为windows服务自启动,不需要每次都输入命令,很方便,使用到目前为止这种做法的效果很完美.你得到了 Windows 服务的支持,而且在服务重启时没有遗留孤立的 ...

  4. Java Service Wrapper 发布Java程序为Windows服务

    下载Windows版本:https://www.krenger.ch/blog/java-service-wrapper-3-5-37-for-windows-x64/ 转自:F:\java\bhGe ...

  5. Java Service Wrapper 发布Java程序或者jar包为Windows服务

    下载Windows版本:http://nchc.dl.sourceforge.net/sourceforge/wrapper/wrapper-windows-x86-32-3.2.3.zip 现在目前 ...

  6. 详解Maven项目利用java service wrapper将Java程序生成Windows服务

    在项目的开发中,有时候需要将Java应用程序打包成Windows服务,我们就直接可以通过windows的服务来启动和关闭java程序了. 本博文将通过有两种方法实现该功能,手动创建法和Maven自动打 ...

  7. Java Service Wrapper 使用(windows)

    1       简介 最近项目中需要做一个Windows系统服务,记录一下使用过程. Java Service Wrapper 可以将Java程序包装成系统服务,这样就可以随着系统的运行而自动运行.J ...

  8. Java Service Wrapper将jar包安装成Windows服务

    刚接触java,第一次使用Java开发windows服务,也是刚不久看了SSM框架 简直也是一头雾水,不过只要用心理解,其实很简单,下面有详细的步骤,包学包会 在windows上运行jar包,需要在工 ...

  9. 利用JAVA Service Wrapper把JAVA程序做成windows服务

    今天做了一个读取数据入库的程序.由于读取的数据每天都更新,于是就想把程序做成一个服务,每天定时执行.研究了一下,发现有几种方式可以做.下面我主要记录一下JAVA Service Wrapper方式. ...

随机推荐

  1. C#使用指针复制字节数组

    下面的示例使用指针将字节从一个数组复制到另一个数组. 此示例使用 unsafe 关键字,它使您能够在 Copy 方法中使用指针. fixed 语句用于声明指向源数组和目标数组的指针. 这将锁定源数组和 ...

  2. Inno Setup 在安装程序开始前和卸载程序开始前,检查并关闭运行的进程

    (2011-12-29 11:54:56) 转载▼ 标签: innosetup it 分类: 开发工具经验累积 Inno Setup在安装程序前,如果有使用的进程在运行,会有错误提示,而使得Insta ...

  3. 解析nginx负载均衡

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://baidutech.blog.51cto.com/4114344/1033718 ...

  4. cocos2d-html5版日历组件

    根据一as3版本给改编成成了js版的.as3版本的地址:  http://download.csdn.net/detail/fengye513/2722289 胜利项目做的差不多了,由于项目用的是c+ ...

  5. Core Java Volume I — 4.1. Introduction to Object-Oriented Programming

    4.1. Introduction to Object-Oriented ProgrammingObject-oriented programming, or OOP for short, is th ...

  6. C++ list<list<int> >类型的对象遍历

    void listSort(list<list<int> >* initList) { list<list<int> >::iterator itera ...

  7. 2016-2017 ACM-ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred) G 优先队列

    G. Car Repair Shop time limit per test 2 seconds memory limit per test 512 megabytes input standard ...

  8. clipToBounds

    最近在开发H5平台的iOS移动侧,遇到些问题,随手记录下来. 1 UIView的clipToBounds 窗口裁剪,默认是NO,表示如果父窗口的大小已经不足以显示子窗口,也不进行裁剪,而是显示,但这时 ...

  9. 转ORA-28002: the password will expire within 7 days 解决方法

    最后一步要改密码,否则还会报错. 1. 查看用户的profile设置: SELECT username,profile FROM dba_users; 一般用户的profile设置都为DEFAULT. ...

  10. Apache配置日志功能

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent ...