用systemd管理进程时,修改复位超时等待时间

在使用systemd管理进程时,默认的复位超时等待时间是90秒,可以通过修改配置文件来改变这一设定。问题在于,直接修改/etc/systemd中的文件可能无法生效,因为默认设置是在编译期间确定的。正确做法是,在源码目录/etc/systemd/增加自定义配置文件,修改DefaultTimeoutStopSec值,然后在编译后将文件安装到/usr/lib/systemd/system.conf.d,以此覆盖默认设置。
摘要由CSDN通过智能技术生成

用systemd管理进程时,系统复位默认等待时间为90s,如果一个进程不能正常结束,则需要倒计时90秒,系统才能复位,立马感到很烦。

来先看看这个90S是在哪里定义的吧,不难发现,这个参数是在下面文件中:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See systemd-system.conf(5) for details.


[Manager]
#LogLevel=info
#LogTarget=journal-or-kmsg
#LogColor=yes
#LogLocation=no
#DumpCore=yes
#ShowStatus=yes
#CrashChangeVT=no
#CrashShell=no
#CrashRe

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值