124 Star 0 Fork 14

src-openEuler / resource-agents

 / 详情

【20.03-LTS-SP3】【x86】ldirectord服务启动后有错误Failed to parse PID from file /run/ldirectord.ldirectord.pid

已验收
缺陷
创建于  
2021-11-26 17:15

【环境信息】
cat /etc/openEuler-latest
openeulerversion=openEuler-20.03-LTS-SP3
compiletime=2021-11-22-21-37-44
gccversion=7.3.0-20210628.42.oe1
kernelversion=4.19.194-2106.1.0.0088.oe1
openjdkversion=1.8.0.312.b07-5.oe1
【问题复现步骤】
cp /usr/share/doc/ldirectord/ldirectord.cf /etc/ha.d/
systemctl start ldirectord
systemctl status ldirectord

出现概率(是否必现,概率性错误):偶现
【预期结果】
服务启动后没有该错误日志
【实际结果】
服务启动后出现该错误日志
输入图片说明
【附件信息】
比如系统message日志/组件日志、dump信息、图片等

评论 (3)

erin_dan 创建了缺陷
erin_dan 负责人设置为small_leek
展开全部操作日志

Hi erin_dan, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at
https://gitee.com/openeuler/community/blob/master/en/sig-infrastructure/command.md.
If you have any questions, please contact the SIG: Others, and any of the maintainers: @jimmy_hero, @small_leek.

erin_dan 计划截止日期设置为2021-11-27
erin_dan 计划开始日期设置为2021-11-26
erin_dan 计划截止日期2021-11-27 修改为2021-11-30
erin_dan 修改了描述
erin_dan 修改了标题
erin_dan 修改了描述
吴磊磊 通过src-openeuler/resource-agents Pull Request !6任务状态待办的 修改为已完成

问题原因:
systemd会在中间父进程退出后立即读取PID文件,读取成功后就认为该服务已经启动成功。但是,systemd读取PIDFile的时候,服务主进程可能还未将PID写入到PID文件中,这时systemd将出现问题,此issue现象正是因为systemd在ldirectord写入PID文件之前先去读取了PID文件,因为没有读取到内容,所以报错。

解决方法:
解决办法是使用ExecStartPost=/usr/bin/sleep 0.1,让systemd在初始化进程(即中间父进程)退出之后耽搁0.1秒再继续向下执行,即推迟了systemd读取PID的过程,保证能让systemd从PID文件中读取到值

erin_dan 关联分支设置为openEuler-20.03-LTS-SP3
erin_dan 任务状态已完成 修改为已验收

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5329419 openeuler ci bot 1632792936
1
https://gitee.com/src-openeuler/resource-agents.git
git@gitee.com:src-openeuler/resource-agents.git
src-openeuler
resource-agents
resource-agents

搜索帮助