diff options
author | Jon Ringle <jringle@gridpoint.com> | 2018-07-20 11:22:43 -0400 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-07-23 13:44:54 +0200 |
commit | fbb48d4c66ada1ea7ffb3bdd03cf5e6a3579b600 (patch) | |
tree | 789d2fe31cf70c24d71cd135824724e079e6d559 /src/core/dbus-kill.c | |
parent | 2484bff32bc5af4af811381393df1090d6e4586f (diff) | |
download | systemd-fbb48d4c66ada1ea7ffb3bdd03cf5e6a3579b600.tar.gz |
Make final kill signal configurable
Usecase is to allow changing the final kill from SIGKILL to SIGQUIT which
should create a core dump useful for debugging why the service didn't stop
with the SIGTERM
Diffstat (limited to 'src/core/dbus-kill.c')
-rw-r--r-- | src/core/dbus-kill.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/dbus-kill.c b/src/core/dbus-kill.c index 028e7ec1c1..3e2a7694a7 100644 --- a/src/core/dbus-kill.c +++ b/src/core/dbus-kill.c @@ -12,6 +12,7 @@ const sd_bus_vtable bus_kill_vtable[] = { SD_BUS_VTABLE_START(0), SD_BUS_PROPERTY("KillMode", "s", property_get_kill_mode, offsetof(KillContext, kill_mode), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("KillSignal", "i", bus_property_get_int, offsetof(KillContext, kill_signal), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("FinalKillSignal", "i", bus_property_get_int, offsetof(KillContext, final_kill_signal), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("SendSIGKILL", "b", bus_property_get_bool, offsetof(KillContext, send_sigkill), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("SendSIGHUP", "b", bus_property_get_bool, offsetof(KillContext, send_sighup), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_VTABLE_END @@ -19,6 +20,7 @@ const sd_bus_vtable bus_kill_vtable[] = { static BUS_DEFINE_SET_TRANSIENT_PARSE(kill_mode, KillMode, kill_mode_from_string); static BUS_DEFINE_SET_TRANSIENT_TO_STRING(kill_signal, "i", int32_t, int, "%" PRIi32, signal_to_string_with_check); +static BUS_DEFINE_SET_TRANSIENT_TO_STRING(final_kill_signal, "i", int32_t, int, "%" PRIi32, signal_to_string_with_check); int bus_kill_context_set_transient_property( Unit *u, @@ -47,5 +49,8 @@ int bus_kill_context_set_transient_property( if (streq(name, "KillSignal")) return bus_set_transient_kill_signal(u, name, &c->kill_signal, message, flags, error); + if (streq(name, "FinalKillSignal")) + return bus_set_transient_final_kill_signal(u, name, &c->final_kill_signal, message, flags, error); + return 0; } |