代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4389fea50bbb0810ed9193522c487257ca0b5d2d Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Tue, 8 Oct 2024 16:28:25 +0200
Subject: [PATCH] core: Log in more scenarios about which process initiated an
operation
Exit/Reboot/Poweroff and similar operations are invasive enough that
logging about who initiated them is very useful to debug issues.
(cherry picked from commit acb0f501f4291efce82bcf89d4ad92b6a895f4fa)
(cherry picked from commit 814be7116dda14074749253d94b83387ceff0ff1)
(cherry picked from commit 4ce745446386bae450114c6fc2278577a7cf46f4)
Conflict:the current code does not have the method_soft_reboot function, so the related code is not combined
Reference:https://github.com/systemd/systemd/commit/acb0f501f4291efce82bcf89d4ad92b6a895f4fa
---
src/core/dbus-manager.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 90c1daf995..856dd3b5dc 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1706,6 +1706,8 @@ static int method_exit(sd_bus_message *message, void *userdata, sd_bus_error *er
if (r < 0)
return r;
+ log_caller(message, m, "Exit");
+
/* Exit() (in contrast to SetExitCode()) is actually allowed even if
* we are running on the host. It will fall back on reboot() in
* systemd-shutdown if it cannot do the exit() because it isn't a
@@ -1730,6 +1732,8 @@ static int method_reboot(sd_bus_message *message, void *userdata, sd_bus_error *
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED,
"Reboot is only supported for system managers.");
+ log_caller(message, m, "Reboot");
+
m->objective = MANAGER_REBOOT;
return sd_bus_reply_method_return(message, NULL);
@@ -1792,6 +1798,8 @@ static int method_poweroff(sd_bus_message *message, void *userdata, sd_bus_error
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED,
"Powering off is only supported for system managers.");
+ log_caller(message, m, "Poweroff");
+
m->objective = MANAGER_POWEROFF;
return sd_bus_reply_method_return(message, NULL);
@@ -1811,6 +1819,8 @@ static int method_halt(sd_bus_message *message, void *userdata, sd_bus_error *er
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED,
"Halt is only supported for system managers.");
+ log_caller(message, m, "Halt");
+
m->objective = MANAGER_HALT;
return sd_bus_reply_method_return(message, NULL);
@@ -1830,6 +1840,8 @@ static int method_kexec(sd_bus_message *message, void *userdata, sd_bus_error *e
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED,
"KExec is only supported for system managers.");
+ log_caller(message, m, "Kexec");
+
m->objective = MANAGER_KEXEC;
return sd_bus_reply_method_return(message, NULL);
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。