1 Star 0 Fork 49

YYNA/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0663-core-consider-service-with-no-start-command-immediat.patch 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:44 . update to systemd-239-58.el8.src.rpm
From c667291303bb876707d86ac3ab9ca62355bae1b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 16 Oct 2018 22:45:34 +0200
Subject: [PATCH] core: consider service with no start command immediately
started
The service would always be in state == SERVICE_INACTIVE, but it needs to go
through state == SERVICE_START so that SuccessAction/FailureAction are executed.
(cherry picked from commit ef5ae8e71329e43c277e6d4f983f0c0793047b94)
Related: #1860899
---
src/core/service.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/core/service.c b/src/core/service.c
index ae31973774..4da1c5accb 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2055,6 +2055,12 @@ static void service_enter_start(Service *s) {
goto fail;
}
+ /* We force a fake state transition here. Otherwise, the unit would go directly from
+ * SERVICE_DEAD to SERVICE_DEAD without SERVICE_ACTIVATING or SERVICE_ACTIVE
+ * inbetween. This way we can later trigger actions that depend on the state
+ * transition, including SuccessAction=. */
+ service_set_state(s, SERVICE_START);
+
service_enter_start_post(s);
return;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ful9/systemd.git
git@gitee.com:ful9/systemd.git
ful9
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385