winSW工具
https://github.com/winsw/winsw
常用命令:
winsw.exe install myapp.xml # 安装服务
winsw.exe start myapp.xml # 开启
winsw.exe status myapp.xml # 查看状态
简单xml配置示例:
模拟cmd命令 mtgssd.exe -c mtgssd.ini
<service>
<id>mtgssd</id>
<name>mtgssd</name>
<description>mtgssd</description>
<executable>mtgssd</executable>
<arguments>-c mtgssd.ini</arguments>
<onfailure action="restart" delay="60 sec"/>
<onfailure action="restart" delay="120 sec"/>
<logmode>reset</logmode>
</service>
配置文件说明
https://github.com/winsw/winsw/blob/v3/docs/xml-config-file.md