我有一个基于 linuxOS 的系统。如果可执行 bin 文件被终止或崩溃,我想重新启动它。
可执行文件在 home/bin/filename 中的位置 我有 etc 目录,其中有 init.d 、systemd、cron sun-directories 。
请建议编写任何脚本,以便 bin 文件在崩溃时重新启动。
最佳答案
尝试 restartd
包。
Restartd is a daemon for checking running and not running processes. It reads the /proc directory every n seconds and does a POSIX regexp on the process names. You can execute a script or a program if the process is or is not running.
您可以设置观看什么进程、时间间隔等。
关于linux - 如果 Linux 进程失败或崩溃,自动重新启动它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41584395/