Bootstrap

NSSM介绍

NSSM(the Non-Sucking Service Manager)是Windows环境下一款免安装的服务管理软件,它可以将应用封装成服务,即将普通exe程序封装成服务使之像windows服务可以设置自动启动等。并且可以监控程序运行状态,程序异常中断后自动启动,实现守护进程的功能。

nssm is a service helper which doesn't suck. srvany and other service helper programs suck because they don't handle failure of the application running as a service. If you use such a program you may see a service listed as started when in fact the application has died. nssm monitors the running service and will restart it if it dies. With nssm you know that if a service says it's running, it really is. Alternatively, if your application is well-behaved you can configure nssm to absolve all responsibility for restarting it and let Windows take care of recovery actions.

官网
http://nssm.cc

服务管理主要有启动、停止和重启,其命令如下:
启动服务:nssm start <servicename>
停止服务: nssm stop <servicename>
重启服务: nssm restart <servicename>
当然,也可以使用系统自带的服务管理器操作和使用系统的命令。

修改参数
NSSM安装的服务修改起来非常方便,命令如下:
nssm edit <servicename>
会自动启动操作界面,直接更改即可。

服务删除
服务删除可以使用如下命令之一:
nssm remove <servicename>
nssm remove <servicename> confirm
功能没有大的区别,后面的命令是自动确认的,没有交互界面。

 

;