47313b1
From d5cd1a02f0da4de24cce433b1759e3e297df0f5f Mon Sep 17 00:00:00 2001
b397f2a
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
b397f2a
Date: Sun, 2 Nov 2014 10:25:06 -0500
b397f2a
Subject: [PATCH] Revert "core: send sigabrt on watchdog timeout to get the
b397f2a
 stacktrace"
b397f2a
b397f2a
This reverts commit db2cb23b5b179707000d28a11efb3d888d06ee80.
b397f2a
---
b397f2a
 TODO                    |  2 ++
b397f2a
 man/systemd.service.xml |  5 ++---
b397f2a
 src/core/busname.c      |  2 +-
b397f2a
 src/core/mount.c        |  3 +--
b397f2a
 src/core/scope.c        |  2 +-
b397f2a
 src/core/service.c      | 37 +++++++++++--------------------------
b397f2a
 src/core/service.h      |  1 -
b397f2a
 src/core/socket.c       |  3 +--
b397f2a
 src/core/swap.c         |  3 +--
b397f2a
 src/core/unit.c         | 24 ++++++------------------
b397f2a
 src/core/unit.h         |  8 +-------
b397f2a
 11 files changed, 27 insertions(+), 63 deletions(-)
b397f2a
b397f2a
diff --git a/TODO b/TODO
b397f2a
index 64b24c18a7..68506671fa 100644
b397f2a
--- a/TODO
b397f2a
+++ b/TODO
b397f2a
@@ -48,6 +48,8 @@ Features:
b397f2a
 
b397f2a
 * consider showing the unit names during boot up in the status output, not just the unit descriptions
b397f2a
 
b397f2a
+* send SIGABRT when a service watchdog is triggered, by default, so that we acquire a backtrace of the hang.
b397f2a
+
b397f2a
 * dhcp: do we allow configuring dhcp routes on interfaces that are not the one we got the dhcp info from?
b397f2a
 
b397f2a
 * maybe allow timer units with an empty Units= setting, so that they
b397f2a
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
b397f2a
index e563b1968b..115d1692ed 100644
b397f2a
--- a/man/systemd.service.xml
b397f2a
+++ b/man/systemd.service.xml
b397f2a
@@ -593,9 +593,8 @@
b397f2a
                                 (i.e. the "keep-alive ping"). If the time
b397f2a
                                 between two such calls is larger than
b397f2a
                                 the configured time, then the service
b397f2a
-                                is placed in a failed state and it will
b397f2a
-                                be terminated with <varname>SIGABRT</varname>.
b397f2a
-                                By setting <varname>Restart=</varname> to
b397f2a
+                                is placed in a failed state. By
b397f2a
+                                setting <varname>Restart=</varname> to
b397f2a
                                 <option>on-failure</option> or
b397f2a
                                 <option>always</option>, the service
b397f2a
                                 will be automatically restarted. The
b397f2a
diff --git a/src/core/busname.c b/src/core/busname.c
b397f2a
index 68cb6ca7b7..22d2a6d24b 100644
b397f2a
--- a/src/core/busname.c
b397f2a
+++ b/src/core/busname.c
b397f2a
@@ -446,7 +446,7 @@ static void busname_enter_signal(BusName *n, BusNameState state, BusNameResult f
b397f2a
 
b397f2a
         r = unit_kill_context(UNIT(n),
b397f2a
                               &kill_context,
b397f2a
-                              state != BUSNAME_SIGTERM ? KILL_KILL : KILL_TERMINATE,
b397f2a
+                              state != BUSNAME_SIGTERM,
b397f2a
                               -1,
b397f2a
                               n->control_pid,
b397f2a
                               false);
b397f2a
diff --git a/src/core/mount.c b/src/core/mount.c
b397f2a
index 01243c381a..e284357c6f 100644
b397f2a
--- a/src/core/mount.c
b397f2a
+++ b/src/core/mount.c
b397f2a
@@ -775,8 +775,7 @@ static void mount_enter_signal(Mount *m, MountState state, MountResult f) {
b397f2a
         r = unit_kill_context(
b397f2a
                         UNIT(m),
b397f2a
                         &m->kill_context,
b397f2a
-                        (state != MOUNT_MOUNTING_SIGTERM && state != MOUNT_UNMOUNTING_SIGTERM && state != MOUNT_REMOUNTING_SIGTERM) ?
b397f2a
-                        KILL_KILL : KILL_TERMINATE,
b397f2a
+                        state != MOUNT_MOUNTING_SIGTERM && state != MOUNT_UNMOUNTING_SIGTERM && state != MOUNT_REMOUNTING_SIGTERM,
b397f2a
                         -1,
b397f2a
                         m->control_pid,
b397f2a
                         false);
b397f2a
diff --git a/src/core/scope.c b/src/core/scope.c
b397f2a
index 0f7c1f97ce..e8f9e8dd73 100644
b397f2a
--- a/src/core/scope.c
b397f2a
+++ b/src/core/scope.c
b397f2a
@@ -243,7 +243,7 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) {
b397f2a
                 r = unit_kill_context(
b397f2a
                                 UNIT(s),
b397f2a
                                 &s->kill_context,
b397f2a
-                                state != SCOPE_STOP_SIGTERM ? KILL_KILL : KILL_TERMINATE,
b397f2a
+                                state != SCOPE_STOP_SIGTERM,
b397f2a
                                 -1, -1, false);
b397f2a
                 if (r < 0)
b397f2a
                         goto fail;
b397f2a
diff --git a/src/core/service.c b/src/core/service.c
b397f2a
index 2b16778731..d160c4e93b 100644
b397f2a
--- a/src/core/service.c
b397f2a
+++ b/src/core/service.c
b397f2a
@@ -56,7 +56,6 @@ static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
b397f2a
         [SERVICE_EXITED] = UNIT_ACTIVE,
b397f2a
         [SERVICE_RELOAD] = UNIT_RELOADING,
b397f2a
         [SERVICE_STOP] = UNIT_DEACTIVATING,
b397f2a
-        [SERVICE_STOP_SIGABRT] = UNIT_DEACTIVATING,
b397f2a
         [SERVICE_STOP_SIGTERM] = UNIT_DEACTIVATING,
b397f2a
         [SERVICE_STOP_SIGKILL] = UNIT_DEACTIVATING,
b397f2a
         [SERVICE_STOP_POST] = UNIT_DEACTIVATING,
b397f2a
@@ -77,7 +76,6 @@ static const UnitActiveState state_translation_table_idle[_SERVICE_STATE_MAX] =
b397f2a
         [SERVICE_EXITED] = UNIT_ACTIVE,
b397f2a
         [SERVICE_RELOAD] = UNIT_RELOADING,
b397f2a
         [SERVICE_STOP] = UNIT_DEACTIVATING,
b397f2a
-        [SERVICE_STOP_SIGABRT] = UNIT_DEACTIVATING,
b397f2a
         [SERVICE_STOP_SIGTERM] = UNIT_DEACTIVATING,
b397f2a
         [SERVICE_STOP_SIGKILL] = UNIT_DEACTIVATING,
b397f2a
         [SERVICE_STOP_POST] = UNIT_DEACTIVATING,
b397f2a
@@ -665,7 +663,7 @@ static void service_set_state(Service *s, ServiceState state) {
b397f2a
                     SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
b397f2a
                     SERVICE_RELOAD,
b397f2a
                     SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
b397f2a
-                    SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
b397f2a
+                    SERVICE_STOP_POST,
b397f2a
                     SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL,
b397f2a
                     SERVICE_AUTO_RESTART))
b397f2a
                 s->timer_event_source = sd_event_source_unref(s->timer_event_source);
b397f2a
@@ -674,7 +672,7 @@ static void service_set_state(Service *s, ServiceState state) {
b397f2a
                     SERVICE_START, SERVICE_START_POST,
b397f2a
                     SERVICE_RUNNING, SERVICE_RELOAD,
b397f2a
                     SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
b397f2a
-                    SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
b397f2a
+                    SERVICE_STOP_POST,
b397f2a
                     SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
b397f2a
                 service_unwatch_main_pid(s);
b397f2a
                 s->main_command = NULL;
b397f2a
@@ -684,7 +682,7 @@ static void service_set_state(Service *s, ServiceState state) {
b397f2a
                     SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
b397f2a
                     SERVICE_RELOAD,
b397f2a
                     SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
b397f2a
-                    SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
b397f2a
+                    SERVICE_STOP_POST,
b397f2a
                     SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
b397f2a
                 service_unwatch_control_pid(s);
b397f2a
                 s->control_command = NULL;
b397f2a
@@ -698,7 +696,7 @@ static void service_set_state(Service *s, ServiceState state) {
b397f2a
                     SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
b397f2a
                     SERVICE_RUNNING, SERVICE_RELOAD,
b397f2a
                     SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL, SERVICE_STOP_POST,
b397f2a
-                    SERVICE_STOP_SIGABRT, SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL) &&
b397f2a
+                    SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL) &&
b397f2a
             !(state == SERVICE_DEAD && UNIT(s)->job)) {
b397f2a
                 service_close_socket_fd(s);
b397f2a
                 service_connection_unref(s);
b397f2a
@@ -752,7 +750,7 @@ static int service_coldplug(Unit *u) {
b397f2a
                            SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
b397f2a
                            SERVICE_RELOAD,
b397f2a
                            SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
b397f2a
-                           SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
b397f2a
+                           SERVICE_STOP_POST,
b397f2a
                            SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
b397f2a
 
b397f2a
                         usec_t k;
b397f2a
@@ -781,7 +779,7 @@ static int service_coldplug(Unit *u) {
b397f2a
                             SERVICE_START, SERVICE_START_POST,
b397f2a
                             SERVICE_RUNNING, SERVICE_RELOAD,
b397f2a
                             SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
b397f2a
-                            SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
b397f2a
+                            SERVICE_STOP_POST,
b397f2a
                             SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL))) {
b397f2a
                         r = unit_watch_pid(UNIT(s), s->main_pid);
b397f2a
                         if (r < 0)
b397f2a
@@ -793,7 +791,7 @@ static int service_coldplug(Unit *u) {
b397f2a
                            SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
b397f2a
                            SERVICE_RELOAD,
b397f2a
                            SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
b397f2a
-                           SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
b397f2a
+                           SERVICE_STOP_POST,
b397f2a
                            SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
b397f2a
                         r = unit_watch_pid(UNIT(s), s->control_pid);
b397f2a
                         if (r < 0)
b397f2a
@@ -1183,8 +1181,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
b397f2a
         r = unit_kill_context(
b397f2a
                         UNIT(s),
b397f2a
                         &s->kill_context,
b397f2a
-                        (state != SERVICE_STOP_SIGTERM && state != SERVICE_FINAL_SIGTERM && state != SERVICE_STOP_SIGABRT) ?
b397f2a
-                        KILL_KILL : (state == SERVICE_STOP_SIGABRT ? KILL_ABORT : KILL_TERMINATE),
b397f2a
+                        state != SERVICE_STOP_SIGTERM && state != SERVICE_FINAL_SIGTERM,
b397f2a
                         s->main_pid,
b397f2a
                         s->control_pid,
b397f2a
                         s->main_pid_alien);
b397f2a
@@ -1200,7 +1197,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
b397f2a
                 }
b397f2a
 
b397f2a
                 service_set_state(s, state);
b397f2a
-        } else if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGABRT)
b397f2a
+        } else if (state == SERVICE_STOP_SIGTERM)
b397f2a
                 service_enter_signal(s, SERVICE_STOP_SIGKILL, SERVICE_SUCCESS);
b397f2a
         else if (state == SERVICE_STOP_SIGKILL)
b397f2a
                 service_enter_stop_post(s, SERVICE_SUCCESS);
b397f2a
@@ -1214,8 +1211,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
b397f2a
 fail:
b397f2a
         log_warning_unit(UNIT(s)->id, "%s failed to kill processes: %s", UNIT(s)->id, strerror(-r));
b397f2a
 
b397f2a
-        if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGKILL ||
b397f2a
-            state == SERVICE_STOP_SIGABRT)
b397f2a
+        if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGKILL)
b397f2a
                 service_enter_stop_post(s, SERVICE_FAILURE_RESOURCES);
b397f2a
         else
b397f2a
                 service_enter_dead(s, SERVICE_FAILURE_RESOURCES, true);
b397f2a
@@ -1641,7 +1637,6 @@ static int service_start(Unit *u) {
b397f2a
         /* We cannot fulfill this request right now, try again later
b397f2a
          * please! */
b397f2a
         if (s->state == SERVICE_STOP ||
b397f2a
-            s->state == SERVICE_STOP_SIGABRT ||
b397f2a
             s->state == SERVICE_STOP_SIGTERM ||
b397f2a
             s->state == SERVICE_STOP_SIGKILL ||
b397f2a
             s->state == SERVICE_STOP_POST ||
b397f2a
@@ -1700,7 +1695,6 @@ static int service_stop(Unit *u) {
b397f2a
 
b397f2a
         /* Already on it */
b397f2a
         if (s->state == SERVICE_STOP ||
b397f2a
-            s->state == SERVICE_STOP_SIGABRT ||
b397f2a
             s->state == SERVICE_STOP_SIGTERM ||
b397f2a
             s->state == SERVICE_STOP_SIGKILL ||
b397f2a
             s->state == SERVICE_STOP_POST ||
b397f2a
@@ -2132,7 +2126,6 @@ static void service_notify_cgroup_empty_event(Unit *u) {
b397f2a
                 service_enter_running(s, SERVICE_SUCCESS);
b397f2a
                 break;
b397f2a
 
b397f2a
-        case SERVICE_STOP_SIGABRT:
b397f2a
         case SERVICE_STOP_SIGTERM:
b397f2a
         case SERVICE_STOP_SIGKILL:
b397f2a
 
b397f2a
@@ -2259,7 +2252,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
b397f2a
                                 service_enter_running(s, f);
b397f2a
                                 break;
b397f2a
 
b397f2a
-                        case SERVICE_STOP_SIGABRT:
b397f2a
                         case SERVICE_STOP_SIGTERM:
b397f2a
                         case SERVICE_STOP_SIGKILL:
b397f2a
 
b397f2a
@@ -2400,7 +2392,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
b397f2a
                                 service_enter_signal(s, SERVICE_STOP_SIGTERM, f);
b397f2a
                                 break;
b397f2a
 
b397f2a
-                        case SERVICE_STOP_SIGABRT:
b397f2a
                         case SERVICE_STOP_SIGTERM:
b397f2a
                         case SERVICE_STOP_SIGKILL:
b397f2a
                                 if (main_pid_good(s) <= 0)
b397f2a
@@ -2470,12 +2461,6 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us
b397f2a
                 service_enter_signal(s, SERVICE_STOP_SIGTERM, SERVICE_FAILURE_TIMEOUT);
b397f2a
                 break;
b397f2a
 
b397f2a
-        case SERVICE_STOP_SIGABRT:
b397f2a
-                log_warning_unit(UNIT(s)->id,
b397f2a
-                                 "%s stop-sigabrt timed out. Terminating.", UNIT(s)->id);
b397f2a
-                service_enter_signal(s, SERVICE_STOP_SIGTERM, s->result);
b397f2a
-                break;
b397f2a
-
b397f2a
         case SERVICE_STOP_SIGTERM:
b397f2a
                 if (s->kill_context.send_sigkill) {
b397f2a
                         log_warning_unit(UNIT(s)->id, "%s stop-sigterm timed out. Killing.", UNIT(s)->id);
b397f2a
@@ -2543,7 +2528,7 @@ static int service_dispatch_watchdog(sd_event_source *source, usec_t usec, void
b397f2a
         log_error_unit(UNIT(s)->id, "%s watchdog timeout (limit %s)!", UNIT(s)->id,
b397f2a
                        format_timespan(t, sizeof(t), s->watchdog_usec, 1));
b397f2a
 
b397f2a
-        service_enter_signal(s, SERVICE_STOP_SIGABRT, SERVICE_FAILURE_WATCHDOG);
b397f2a
+        service_enter_signal(s, SERVICE_STOP_SIGTERM, SERVICE_FAILURE_WATCHDOG);
b397f2a
 
b397f2a
         return 0;
b397f2a
 }
b397f2a
diff --git a/src/core/service.h b/src/core/service.h
b397f2a
index 54fbe46fa4..0db0c4d64c 100644
b397f2a
--- a/src/core/service.h
b397f2a
+++ b/src/core/service.h
b397f2a
@@ -39,7 +39,6 @@ typedef enum ServiceState {
b397f2a
         SERVICE_EXITED,            /* Nothing is running anymore, but RemainAfterExit is true hence this is OK */
b397f2a
         SERVICE_RELOAD,
b397f2a
         SERVICE_STOP,              /* No STOP_PRE state, instead just register multiple STOP executables */
b397f2a
-        SERVICE_STOP_SIGABRT,      /* Watchdog timeout */
b397f2a
         SERVICE_STOP_SIGTERM,
b397f2a
         SERVICE_STOP_SIGKILL,
b397f2a
         SERVICE_STOP_POST,
b397f2a
diff --git a/src/core/socket.c b/src/core/socket.c
b397f2a
index 6ba8338d8b..9004cb42cf 100644
b397f2a
--- a/src/core/socket.c
b397f2a
+++ b/src/core/socket.c
b397f2a
@@ -1578,8 +1578,7 @@ static void socket_enter_signal(Socket *s, SocketState state, SocketResult f) {
b397f2a
         r = unit_kill_context(
b397f2a
                         UNIT(s),
b397f2a
                         &s->kill_context,
b397f2a
-                        (state != SOCKET_STOP_PRE_SIGTERM && state != SOCKET_FINAL_SIGTERM) ?
b397f2a
-                        KILL_KILL : KILL_TERMINATE,
b397f2a
+                        state != SOCKET_STOP_PRE_SIGTERM && state != SOCKET_FINAL_SIGTERM,
b397f2a
                         -1,
b397f2a
                         s->control_pid,
b397f2a
                         false);
b397f2a
diff --git a/src/core/swap.c b/src/core/swap.c
b397f2a
index 1add722bf1..13e12ad67a 100644
b397f2a
--- a/src/core/swap.c
b397f2a
+++ b/src/core/swap.c
b397f2a
@@ -687,8 +687,7 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) {
b397f2a
         r = unit_kill_context(
b397f2a
                         UNIT(s),
b397f2a
                         &s->kill_context,
b397f2a
-                        (state != SWAP_ACTIVATING_SIGTERM && state != SWAP_DEACTIVATING_SIGTERM) ?
b397f2a
-                        KILL_KILL : KILL_TERMINATE,
b397f2a
+                        state != SWAP_ACTIVATING_SIGTERM && state != SWAP_DEACTIVATING_SIGTERM,
b397f2a
                         -1,
b397f2a
                         s->control_pid,
b397f2a
                         false);
b397f2a
diff --git a/src/core/unit.c b/src/core/unit.c
b397f2a
index 84f210a312..489ea1e502 100644
b397f2a
--- a/src/core/unit.c
b397f2a
+++ b/src/core/unit.c
b397f2a
@@ -3313,7 +3313,7 @@ int unit_make_transient(Unit *u) {
b397f2a
 int unit_kill_context(
b397f2a
                 Unit *u,
b397f2a
                 KillContext *c,
b397f2a
-                KillOperation k,
b397f2a
+                bool sigkill,
b397f2a
                 pid_t main_pid,
b397f2a
                 pid_t control_pid,
b397f2a
                 bool main_pid_alien) {
b397f2a
@@ -3326,19 +3326,7 @@ int unit_kill_context(
b397f2a
         if (c->kill_mode == KILL_NONE)
b397f2a
                 return 0;
b397f2a
 
b397f2a
-        switch (k) {
b397f2a
-        case KILL_KILL:
b397f2a
-                sig = SIGKILL;
b397f2a
-                break;
b397f2a
-        case KILL_ABORT:
b397f2a
-                sig = SIGABRT;
b397f2a
-                break;
b397f2a
-        case KILL_TERMINATE:
b397f2a
-                sig = c->kill_signal;
b397f2a
-                break;
b397f2a
-        default:
b397f2a
-                assert_not_reached("KillOperation unknown");
b397f2a
-        }
b397f2a
+        sig = sigkill ? SIGKILL : c->kill_signal;
b397f2a
 
b397f2a
         if (main_pid > 0) {
b397f2a
                 r = kill_and_sigcont(main_pid, sig);
b397f2a
@@ -3352,7 +3340,7 @@ int unit_kill_context(
b397f2a
                         if (!main_pid_alien)
b397f2a
                                 wait_for_exit = true;
b397f2a
 
b397f2a
-                        if (c->send_sighup && k != KILL_KILL)
b397f2a
+                        if (c->send_sighup && !sigkill)
b397f2a
                                 kill(main_pid, SIGHUP);
b397f2a
                 }
b397f2a
         }
b397f2a
@@ -3368,12 +3356,12 @@ int unit_kill_context(
b397f2a
                 } else {
b397f2a
                         wait_for_exit = true;
b397f2a
 
b397f2a
-                        if (c->send_sighup && k != KILL_KILL)
b397f2a
+                        if (c->send_sighup && !sigkill)
b397f2a
                                 kill(control_pid, SIGHUP);
b397f2a
                 }
b397f2a
         }
b397f2a
 
b397f2a
-        if ((c->kill_mode == KILL_CONTROL_GROUP || (c->kill_mode == KILL_MIXED && k == KILL_KILL)) && u->cgroup_path) {
b397f2a
+        if ((c->kill_mode == KILL_CONTROL_GROUP || (c->kill_mode == KILL_MIXED && sigkill)) && u->cgroup_path) {
b397f2a
                 _cleanup_set_free_ Set *pid_set = NULL;
b397f2a
 
b397f2a
                 /* Exclude the main/control pids from being killed via the cgroup */
b397f2a
@@ -3397,7 +3385,7 @@ int unit_kill_context(
b397f2a
 
b397f2a
                         /* wait_for_exit = true; */
b397f2a
 
b397f2a
-                        if (c->send_sighup && k != KILL_KILL) {
b397f2a
+                        if (c->send_sighup && !sigkill) {
b397f2a
                                 set_free(pid_set);
b397f2a
 
b397f2a
                                 pid_set = unit_pid_set(main_pid, control_pid);
b397f2a
diff --git a/src/core/unit.h b/src/core/unit.h
b397f2a
index 081ab18f10..bbad546356 100644
b397f2a
--- a/src/core/unit.h
b397f2a
+++ b/src/core/unit.h
b397f2a
@@ -54,12 +54,6 @@ enum UnitActiveState {
b397f2a
         _UNIT_ACTIVE_STATE_INVALID = -1
b397f2a
 };
b397f2a
 
b397f2a
-typedef enum KillOperation {
b397f2a
-        KILL_TERMINATE,
b397f2a
-        KILL_KILL,
b397f2a
-        KILL_ABORT,
b397f2a
-} KillOperation;
b397f2a
-
b397f2a
 static inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) {
b397f2a
         return t == UNIT_ACTIVE || t == UNIT_RELOADING;
b397f2a
 }
b397f2a
@@ -582,7 +576,7 @@ int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const
b397f2a
 
b397f2a
 int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name);
b397f2a
 
b397f2a
-int unit_kill_context(Unit *u, KillContext *c, KillOperation k, pid_t main_pid, pid_t control_pid, bool main_pid_alien);
b397f2a
+int unit_kill_context(Unit *u, KillContext *c, bool sigkill, pid_t main_pid, pid_t control_pid, bool main_pid_alien);
b397f2a
 
b397f2a
 int unit_make_transient(Unit *u);
b397f2a