diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-10-08 16:28:25 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-10-09 10:27:56 +0200 |
commit | acb0f501f4291efce82bcf89d4ad92b6a895f4fa (patch) | |
tree | 03a377beedbcad56dab74ec5bc03b2a0a86323c7 /src/core/dbus-manager.c | |
parent | core: Bump log level of reexecute request to notice (diff) | |
download | systemd-acb0f501f4291efce82bcf89d4ad92b6a895f4fa.tar.xz systemd-acb0f501f4291efce82bcf89d4ad92b6a895f4fa.zip |
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.
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r-- | src/core/dbus-manager.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 2ffede9cb8..d01e972aad 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -1665,6 +1665,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 @@ -1689,6 +1691,8 @@ static int method_reboot(sd_bus_message *message, void *userdata, sd_bus_error * if (r < 0) return r; + log_caller(message, m, "Reboot"); + m->objective = MANAGER_REBOOT; return sd_bus_reply_method_return(message, NULL); @@ -1731,6 +1735,8 @@ static int method_soft_reboot(sd_bus_message *message, void *userdata, sd_bus_er return r; } + log_caller(message, m, "Soft reboot"); + free_and_replace(m->switch_root, rt); m->objective = MANAGER_SOFT_REBOOT; @@ -1751,6 +1757,8 @@ static int method_poweroff(sd_bus_message *message, void *userdata, sd_bus_error if (r < 0) return r; + log_caller(message, m, "Poweroff"); + m->objective = MANAGER_POWEROFF; return sd_bus_reply_method_return(message, NULL); @@ -1770,6 +1778,8 @@ static int method_halt(sd_bus_message *message, void *userdata, sd_bus_error *er if (r < 0) return r; + log_caller(message, m, "Halt"); + m->objective = MANAGER_HALT; return sd_bus_reply_method_return(message, NULL); @@ -1789,6 +1799,8 @@ static int method_kexec(sd_bus_message *message, void *userdata, sd_bus_error *e if (r < 0) return r; + log_caller(message, m, "Kexec"); + m->objective = MANAGER_KEXEC; return sd_bus_reply_method_return(message, NULL); |