Windows Service Wrapper
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...
- Take
winsw.exefrom the distribution, and rename it to your taste (such asmyapp.exe) - Write
myapp.xml(see Configuration Syntax for more details) - Place those two files side by side when you deploy your application, because that's how
winsw.exediscovers 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的更多相关文章
- 使用Windows Service Wrapper快速创建一个Windows Service
前言 今天介绍一个小工具的使用.我们都知道Windows Service是一种特殊的应用程序,它的好处是可以一直在后台运行,相对来说,比较适合一些需要一直运行同时不需要过多用户干预的应用程序,这一类我 ...
- 使用Windows Service Wrapper快速创建一个Windows Service 如nginx
前言 今天介绍一个小工具的使用.我们都知道Windows Service是一种特殊的应用程序,它的好处是可以一直在后台运行,相对来说,比较适合一些需要一直运行同时不需要过多用户干预的应用程序,这一类我 ...
- 详解Windows Service Wrapper(winsw.exe)及应用场景
winsw.exe可以帮助nginx作为windows服务自启动,不需要每次都输入命令,很方便,使用到目前为止这种做法的效果很完美.你得到了 Windows 服务的支持,而且在服务重启时没有遗留孤立的 ...
- Java Service Wrapper 发布Java程序为Windows服务
下载Windows版本:https://www.krenger.ch/blog/java-service-wrapper-3-5-37-for-windows-x64/ 转自:F:\java\bhGe ...
- Java Service Wrapper 发布Java程序或者jar包为Windows服务
下载Windows版本:http://nchc.dl.sourceforge.net/sourceforge/wrapper/wrapper-windows-x86-32-3.2.3.zip 现在目前 ...
- 详解Maven项目利用java service wrapper将Java程序生成Windows服务
在项目的开发中,有时候需要将Java应用程序打包成Windows服务,我们就直接可以通过windows的服务来启动和关闭java程序了. 本博文将通过有两种方法实现该功能,手动创建法和Maven自动打 ...
- Java Service Wrapper 使用(windows)
1 简介 最近项目中需要做一个Windows系统服务,记录一下使用过程. Java Service Wrapper 可以将Java程序包装成系统服务,这样就可以随着系统的运行而自动运行.J ...
- Java Service Wrapper将jar包安装成Windows服务
刚接触java,第一次使用Java开发windows服务,也是刚不久看了SSM框架 简直也是一头雾水,不过只要用心理解,其实很简单,下面有详细的步骤,包学包会 在windows上运行jar包,需要在工 ...
- 利用JAVA Service Wrapper把JAVA程序做成windows服务
今天做了一个读取数据入库的程序.由于读取的数据每天都更新,于是就想把程序做成一个服务,每天定时执行.研究了一下,发现有几种方式可以做.下面我主要记录一下JAVA Service Wrapper方式. ...
随机推荐
- android死机问题
一般在平时工作中,基本上很多代码可以在eclipse+ndk进行调试,但如果需要用到具体的硬件设备,如媒体播放设备无法模拟的情况下,只能上硬件(盒子或手机)上进行调试.此时唯一的调试手段就是logca ...
- Objects and Data Structures
Date Abstraction Hiding implementation is not just a matter of putting a layer of fucntions between ...
- Cisco ASA 5505 Routing Between Two (Internal) VLANS
Referenced:http://www.petenetlive.com/KB/Article/0000869 Problem I had to set this up for a client t ...
- [转]Golang之struct类型
http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=22312037&id=3756923 一.struct ...
- oracle数据库什么情况下创建索引比较好
索引就好象一本字典的目录.凭借字典的目录,我们可以非常迅速的找到我们所需要的条目.数据库也是如此.凭借Oracle数据库的索引,相关语句可以迅速的定位记录的位置,而不必去定位整个表. 虽 然说,在表中 ...
- Node.js简单介绍并实现一个简单的Web MVC框架
编号:1018时间:2016年6月13日16:06:41功能:Node.js简单介绍并实现一个简单的Web MVC框架URL :https://cnodejs.org/topic/4f16442cca ...
- 【转】How-To-Ask-Questions-The-Smart-Way
提问的智慧 How To Ask Questions The Smart Way Copyright © 2001,2006,2014 Eric S. Raymond, Rick Moen 本指南英文 ...
- [转]C语言文件操作
1,两种文件存取方式(输入,输出方式) 顺序存取 直接存取 2,数据的两种存放形式 文本文件 二进制文件 13.2文件指针 定义文件类型指针变量的一般形式: FILE *指针变量名; 例如: FILE ...
- map遍历的四种方法
public static void main(String[] args) { Map<String, String> map = new HashMap<String, Stri ...
- Java—面向对象—构造方法及相关思维导图
先构造一个Book类的代码 package org.hanqi.pn0120; public class Book { //构造方法 //1.方法名和类名一样 //2.没有返回值,不需要加void / ...