如何设置我的服务器exe继续运行 [英] How to setup my server exe keep running

查看:90
本文介绍了如何设置我的服务器exe继续运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个现在已部署的服务器进程,我想保持服务器运行.
以防万一,如果该进程因某种方式(某些异常或任何其他技术流程)而崩溃,那么我需要重新启动它.

为此,我创建了另一个进程,该进程会在进程列表中不断检查(例如,每2分钟检查一次)此特定进程名称,以防万一如果找不到该进程名称,则会启动该进程.

我已经实现了此解决方案,但是我知道这不是一个好主意,我相信对于这项工作必须有一些更好的主意.您能帮我这是最好的方法,还是建议一些更好的方法?

谢谢.

Hi,

I have a server process which is deployed now, and I want to keep my server running.
In case, if that process crashed by some means, either some exception or any other technical flow, then I need it to be restart again.

For this, I have created another process which keep checking(e.g, every 2 minutes) in processes list for this particular process name, and in case, if not found, it will start that process.

I have implemented this solution, but I know its not a good idea, I believe there must be some better ideas for this job. Can you help me is it best approach, or suggest some better one?

Thanks.

推荐答案

首先,如果它对您有用,我不会确切地说这是一个坏主意.但是,如果您的看门狗程序本身由于某种原因而停止运行(崩溃),则可能会出现问题.如果您绝对想更改设置,那么我的建议是从服务器进程中退出Windows服务(如果还没有的话).然后,您要做的就是配置Windows服务恢复选项.可以从安装程序中设置这些恢复选项.请在此处查看详细信息:在属性中设置恢复选项Windows服务 [
First of all if it works for you I wouldn''t exactly say it''s a bad idea. There might be a problem though if your watchdog program itself would stop functioning (crash) for some reason. If you are absolutely bent on changing your setup my advice to you would be to make a windows service out of your server process if it isn''t already one. Then all you have to do is configure the windows service recovery options. These recovery options can be set from within your installer. Please see here for details: Set Recovery Options in Properties of Windows Service[^].

Regards,

Manfred


这篇关于如何设置我的服务器exe继续运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆