且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检测应用程序崩溃并重新启动它的***方式?

更新时间:2023-02-02 13:50:45

如何创建一个包装应用程序来启动错误的应用程序作为一个孩子,等待它?如果子进程的退出代码指示错误,则重新启动它,否则退出。

How about creating a wrapper application that launches the faulty app as a child and waits for it? If the exit code of the child indicates an error, then restart it, else exit.