Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates-src > by-pkgid > ab4b662b9827b6375ffd451bf4abd615 > files > 416

systemd-44-24.fc17.src.rpm

From ac4548ac765bdfa8741ae9de10fa6ba263cc1f10 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Wed, 13 Jun 2012 18:27:41 +0200
Subject: [PATCH] systemctl: warn about all active triggers, not just sockets
 (cherry picked from commit
 1c291cf34cb22c8ca5ec0db122bd5e8bfabe9ac5)

---
 src/systemctl/systemctl.c |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 92753e9..7426647 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1665,7 +1665,7 @@ finish:
         return r;
 }
 
-static void check_listening_sockets(
+static void check_triggering_units(
                 DBusConnection *bus,
                 const char *unit_name) {
 
@@ -1728,20 +1728,17 @@ static void check_listening_sockets(
 
                 dbus_message_iter_get_basic(&sub, &service_trigger);
 
-                if (!endswith(service_trigger, ".socket"))
-                        goto next;
-
                 r = check_one_unit(bus, service_trigger, true);
                 if (r < 0)
                         goto finish;
                 if (r == 0) {
                         if (print_warning_label) {
-                                log_warning("There are listening sockets associated with %s :", unit_name);
+                                log_warning("Warning: Stopping %s, but it can still be activated by:", unit_name);
                                 print_warning_label = false;
                         }
-                        log_warning("%s", service_trigger);
+                        log_warning("  %s", service_trigger);
                 }
-next:
+
                 dbus_message_iter_next(&sub);
         }
 finish:
@@ -1836,9 +1833,10 @@ static int start_unit_one(
                 }
         }
 
-        /* When stopping unit check if we have some listening sockets active */
-        if (streq(method, "StopUnit") && !arg_quiet)
-                check_listening_sockets(bus, name);
+        /* When stopping a unit warn if it can still be triggered by
+         * another active unit (socket, path, timer) */
+        if (!arg_quiet && streq(method, "StopUnit"))
+                check_triggering_units(bus, name);
 
         r = 0;