代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 7347b3db838ea3f02afc6c8a6dccac1ff8e7edbd Mon Sep 17 00:00:00 2001
From: licunlong <licunlong1@huawei.com>
Date: Tue, 8 Mar 2022 19:18:36 +0800
Subject: [PATCH] main: log which process send SIGNAL to PID1 This can help
users to figure out what makes systemd freeze. 1. Someone kills systemd
accidentally, then the sender_pid won't be 1; 2. systemd triggers segfault or
assert, then the sender_pid will be 1;
---
src/core/main.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/core/main.c b/src/core/main.c
index 5009b8d85f..41a4b4225f 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -228,7 +228,7 @@ _noreturn_ static void freeze_or_exit_or_reboot(void) {
freeze();
}
-_noreturn_ static void crash(int sig) {
+_noreturn_ static void crash(int sig, siginfo_t *siginfo, void *context) {
struct sigaction sa;
pid_t pid;
@@ -273,6 +273,14 @@ _noreturn_ static void crash(int sig) {
siginfo_t status;
int r;
+ if (siginfo) {
+ _cleanup_free_ char *cmdline = NULL;
+ pid_t sender_pid = siginfo->si_pid;
+
+ (void) get_process_cmdline(sender_pid, SIZE_MAX, 0, &cmdline);
+ log_emergency("Caught <%s> from PID "PID_FMT" (%s)", signal_to_string(sig), sender_pid, strna(cmdline));
+ }
+
/* Order things nicely. */
r = wait_for_terminate(pid, &status);
if (r < 0)
@@ -330,8 +338,8 @@ _noreturn_ static void crash(int sig) {
static void install_crash_handler(void) {
static const struct sigaction sa = {
- .sa_handler = crash,
- .sa_flags = SA_NODEFER, /* So that we can raise the signal again from the signal handler */
+ .sa_sigaction = crash,
+ .sa_flags = SA_NODEFER | SA_SIGINFO, /* So that we can raise the signal again from the signal handler */
};
int r;
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。