关于systemd的service超时时间设定

为什么80%的码农都做不了架构师?>>>   hot3.png

故障界面

  • 有些服务器的 rc.local 里有些奇怪的东西。比如sleep 600,然后启动的时候就: 关于systemd的service超时时间设定_第1张图片
  • 这个 no limit 实际上是可配置的 /lib/systemd/system/rc.local.service
[Unit]
Description=/etc/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0 # 单位是秒,默认是0不限制
RemainAfterExit=yes
SysVStartPriority=99

限时效果

  • 改完之后就是这个效果 TimeoutSec=60关于systemd的service超时时间设定_第2张图片
  • 然后需要注意的是,超时后服务会被 killed关于systemd的service超时时间设定_第3张图片

转载于:https://my.oschina.net/anglix/blog/529070

你可能感兴趣的:(关于systemd的service超时时间设定)