How to make sure an application keeps running on Linux

前端 未结 16 1368
清歌不尽
清歌不尽 2020-11-28 18:51

I\'m trying to ensure a script remains running on a development server. It collates stats and provides a web service so it\'s supposed to persist, yet a few times a day, it

16条回答
  •  无人及你
    2020-11-28 19:29

    I think a better solution is if you test the function, too. For example, if you had to test an apache, it is not enough only to test, if "apache" processes on the systems exist.

    If you want to test if apache OK is, then try to download a simple web page, and test if your unique code is in the output.

    If not, kill the apache with -9 and then do a restart. And send a mail to the root (which is a forwarded mail address to the roots of the company/server/project).

提交回复
热议问题