【标题描述】quota_nld.service服务启动之后,日志中会出现(偶现)“Can't open PID file /run/quota_nld.pid (yet?) after start: Operation not permitted”
【环境信息】
软件信息:
1) OS版本及分支:openEuler 22.03 (LTS-SP1)
2) 内核信息:5.10.0-126.0.0.66.oe2203sp1.x86_64
3) 发现问题的组件版本信息:quota-4.06-5.oe2203sp1.x86_64
【问题复现步骤】
具体操作步骤
dnf install -y quota
systemctl start quota_nld.service
systemctl status quota_nld.service
出现概率(是否必现,概率性错误):偶现
【预期结果】
服务启动成功,日志打印正常
【实际结果】
quota_nld.service服务启动之后,日志中会出现(偶现)“Can't open PID file /run/quota_nld.pid (yet?) after start: Operation not permitted”,如下图所示(建议在服务配置中增加等待时间):
【附件信息】
比如系统message日志/组件日志、dump信息、图片等
Hi wenjunryou, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Storage, and any of the maintainers: @louhongxiang , @linfeilong835 , @zero , @liuzhiqiang
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
问题根本原因:
systemd在读取PID文件时,PID文件还未产生,故读取失败。
解决方案:
考虑到造成该情况是因为产生PID文件的过程是在daemon进程中执行的,因此quota_nld主进程退出时,daemon进程可能仍未创建PID文件。于是将创建PID文件放在quota_nld主进程中执行,保证程序退出时,PID文件必然存在。
【验收环境】
软件信息:
1) OS版本及分支:openEuler 22.03 (LTS-SP1)
2) 内核信息:5.10.0-132.0.0.73.oe2203sp1
3) 验收问题的组件版本信息:quota-4.06-6.oe2203sp1
【验收结果】
服务启动成功,日志打印正常,问题验收通过
登录 后才可以发表评论