11 月 152019
 

linux有个supervisor可以做进程管理,防止进程僵死。windows没有对应的软件,由于交易程序必须跑在window下容易僵死,所以后来查文档发现,可以做成服务,防止程序僵死。

参考文档 :https://www.cnblogs.com/tianfang/p/7912648.html

 

使用NSSM将exe封装为服务

NSSM是一个服务封装程序,它可以将普通exe程序封装成服务,使之像windows服务一样运行。同类型的工具还有微软自己的srvany,不过nssm更加简单易用,并且功能强大。它的特点如下:

  1. 支持普通exe程序(控制台程序或者带界面的Windows程序都可以)

  2. 安装简单,修改方便

  3. 可以重定向输出(并且支持Rotation)

  4. 可以自动守护封装了的服务,程序挂掉了后可以自动重启

  5. 可以自定义环境变量

主要是第4点比较符合我的要求,后来封装成服务,果然解决了这个问题。

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny