none:没有进程会被杀掉,只是执行服务的 stop 命令。 Restart:定义何种情况 Systemd 会自动重启当前服务,可能的值包括: no(默认值):退出后不会重启 on-success:只有正常退出时(退出状态码为0),才会重启 on-failure:非正常退出时(退出状态码非0),包括被信号终止和超时,才会重启(守护进程,推荐值) on-abnormal:只...
Restart定义服务在异常情况下如何重启,例如“always”表示总是重启服务。User,Group指定运行服务的用户和组,确保服务在正确的权限下运行。[Service]段解析WantedBy,RequiredBy,Also,Alias:定义服务的启动级别,指定哪些启动级别下应该启动该服务。OnFailure:定义在主服务失败时应该启动的备用服务。FileDescription,Icon:提供...
ExitType=main Restart=on-failure NotifyAccess=main RestartUSec=10s TimeoutStartUSec=infinity TimeoutStopUSec=1min 30s TimeoutAbortUSec=1min 30s TimeoutStartFailureMode=terminate TimeoutStopFailureMode=terminate RuntimeMaxUSec=infinity RuntimeRandomizedExtraUSec=0 WatchdogUSec=0 WatchdogTimestampMonotonic...
OnFailure=send_email_to_tux@%n.service send_email_to_wilber@%n.serviceCopy 7 Using timers as a regular user systemd timers can also be used by regular users. It helps you to automate recurring tasks like backups, processing images, or moving data to the cloud. The same procedures and...