https://github.com/kohsuke/winsw/
WinSW is being managed by the XML configuration file.
Your renamed WinSW.exe binary also accepts the following commands:
Command | Description |
---|---|
install | Installs the service. |
uninstall | Uninstalls the service. |
start | Starts the service. |
stop | Stops the service. |
restart | Stops and then starts the service. |
status | Checks the status of the service. |
refresh | Refreshes the service properties without reinstallation. |
customize | Customizes the wrapper executable. |
dev | Experimental commands. |
xml配置文件
<service>
<id>Nginx</id>
<name>Nginx 1.18.0</name>
<description>This service runs Nginx continuous integration system.</description>
<startmode>Automatic</startmode>
<env name="HOME" value="D:\nginx-1.18.0"/>
<executable>%HOME%/nginx.exe</executable>
<startargument>-p%HOME%</startargument>
<stopargument>-s</stopargument>
<stopargument>stop</stopargument>
<logmode>rotate</logmode>
<logpath>srvlogs</logpath>
</service>