16 Star 11 Fork 105

src-openEuler/systemd

同时对服务执行start、daemon-reload、try-restart会残留nop类型job

已完成
缺陷
创建于  
2022-02-09 15:49

【标题描述】能够简要描述问题:说明什么场景下,做了什么操作,出现什么问题(尽量使用正向表达方式)
【环境信息】
输入图片说明
【问题复现步骤】
执行如下脚本可复现,若脚本卡住,可执行systemctl list-jobs查看已存在nop 状态的服务,这会导致sytemctl动作卡住
必现

cat > /etc/systemd/system/test1.service << EOF
[Unit]
Description=whorweTEST1

[Service]
Type=oneshot
ExecStart=/bin/bash /etc/systemd/system/test1.sh

[Install]
WantedBy=test.target
EOF
cat > /etc/systemd/system/test1.sh << EOF
systemctl daemon-reload &
systemctl try-restart test3.service
EOF
chmod +x /etc/systemd/system/test1.sh
cat > /etc/systemd/system/test2.service << EOF
[Unit]
Description=whorweTEST2
After=test1.service

[Service]
ExecStart=/usr/bin/true

[Install]
WantedBy=test.target
EOF
cat > /etc/systemd/system/test3.service << EOF
[Unit]
Description=whorweTEST3
After=test2.service

[Service]
ExecStart=/usr/bin/true

[Install]
WantedBy=test.target
EOF
cat > /etc/systemd/system/test.target << EOF
[Unit]
Description=whorweTEST_TARGET
EOF
systemctl daemon-reload
systemctl enable test1 test2 test3
cp /etc/systemd/system.conf /etc/systemd/system.conf.back
sed -i 's/#DefaultStartLimitBurst=5/DefaultStartLimitBurst=500/g' /etc/systemd/system.conf
systemctl daemon-reload
for i in `seq 1 100`; do
        systemctl stop test1 test2 test3 test.target;
        systemctl restart test.target;
        if [ $(($i%10)) = "0" ]; then
                echo $i;
        fi
done
mv /etc/systemd/system.conf.back /etc/systemd/system.conf
rm -rf /etc/systemd/system/test*
systemctl daemon-reload

【预期结果】
nop 状态进程会被清理,不会影响systemctl动作
【实际结果】
卡住
输入图片说明
nop 状态的任务一直存在,未被清理
输入图片说明
【附件信息】

评论 (1)

likechiguoguo 创建了缺陷 3年前
openeuler-ci-bot 添加了
 
sig/Base-service
标签
3年前
ltx 里程碑设置为openEuler-22.03-LTS 3年前
ltx 里程碑openEuler-22.03-LTS 修改为openEuler-22.03-LTS-round-1 3年前
ltx 负责人设置为hexiaowen 3年前
Mingtai 通过合并 Pull Request !208: sync some patchs to fix cve and issue任务状态待办的 修改为已完成 3年前

登录 后才可以发表评论

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

搜索帮助