From a9d2e0cabe36104a5e69ca497efbf0930f8bba9a Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 5 Oct 2015 14:30:49 +0200 Subject: [PATCH] systemctl shows the full cgroup hierarchy when doing status of a or non-existing unit (#1268601) Resolves: #1268601 --- ...ly-handle-empty-control-group-paths-.patch | 46 ------------------- systemd.spec | 7 ++- 2 files changed, 5 insertions(+), 48 deletions(-) delete mode 100644 0036-systemctl-properly-handle-empty-control-group-paths-.patch diff --git a/0036-systemctl-properly-handle-empty-control-group-paths-.patch b/0036-systemctl-properly-handle-empty-control-group-paths-.patch deleted file mode 100644 index 4b66128..0000000 --- a/0036-systemctl-properly-handle-empty-control-group-paths-.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 9a73a3023c5934c88ba1da694c41af4e1c08ff44 Mon Sep 17 00:00:00 2001 -From: Lennart Poettering -Date: Mon, 24 Aug 2015 21:09:49 +0200 -Subject: [PATCH 36/47] systemctl: properly handle empty control group paths in - "status" - -When showing the status of the "-.slice" slice root unit (whose reported -cgroup path is ""), we suppressed the cgroup tree so far, because -skipped it for all unit with an empty cgroup path. Let's fix that, and -properly handle the empty cgroup path. ---- - src/systemctl/systemctl.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c -index 6db4d65..3ee8f20 100644 ---- a/src/systemctl/systemctl.c -+++ b/src/systemctl/systemctl.c -@@ -3609,7 +3609,14 @@ static int status_property(const char *name, sd_bus_message *m, UnitStatusInfo * - if (r < 0) - return bus_log_parse_error(r); - -- if (!isempty(s)) { -+ if (streq(name, "ControlGroup")) -+ i->control_group = s; -+ else if (!isempty(s)) { -+ /* For all but the cgroup path (see above) we -+ * consider the empty string as unset. For the -+ * cgroup path the empty string refers to the -+ * root of the cgroup tree. */ -+ - if (streq(name, "Id")) - i->id = s; - else if (streq(name, "LoadState")) -@@ -3632,8 +3639,6 @@ static int status_property(const char *name, sd_bus_message *m, UnitStatusInfo * - i->control_group = e; - } - #endif -- else if (streq(name, "ControlGroup")) -- i->control_group = s; - else if (streq(name, "StatusText")) - i->status_text = s; - else if (streq(name, "PIDFile")) --- -2.5.0 - diff --git a/systemd.spec b/systemd.spec index 15e98ce..32db018 100644 --- a/systemd.spec +++ b/systemd.spec @@ -13,7 +13,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 222 -Release: 6%{?gitcommit:.git%{gitcommit}}%{?dist} +Release: 7%{?gitcommit:.git%{gitcommit}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -74,7 +74,6 @@ Patch0036: 0032-logind-get-a-fresh-file-descriptor-to-clean-up-a-VT.patch Patch0037: 0033-timedatectl-assert-timezone-is-not-null-in-setenv-ca.patch Patch0038: 0034-timedatectl-when-no-timezone-is-set-consider-UTC-the.patch Patch0039: 0035-core-downgrade-Module-inserted-message-for-kmod-to-D.patch -Patch0040: 0036-systemctl-properly-handle-empty-control-group-paths-.patch Patch0041: 0037-selinux-fix-regression-of-systemctl-subcommands-when.patch Patch0042: 0038-socket-fix-setsockopt-call.-SOL_SOCKET-changed-to-SO.patch Patch0043: 0039-sd-event-improve-debug-message-when-we-fail-to-remov.patch @@ -85,6 +84,7 @@ Patch0047: 0043-Fixup-WWN-bytes-for-big-endian-systems.patch Patch0048: 0044-units-run-ldconfig-also-when-cache-is-unpopulated.patch Patch0049: 0045-sd-event-fix-prepare-priority-queue-comparison-funct.patch Patch0050: 0046-Revert-core-one-step-back-again-for-nspawn-we-actual.patch +Patch0051: 0048-core-report-root-cgroup-as-over-the-bus.patch Patch997: 0001-Re-apply-walters-unit-patch-for-F23-systemd-v222.patch Patch998: 0001-Revert-core-mount-add-dependencies-to-dynamically-mo-v222.patch @@ -823,6 +823,9 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd /usr/lib/firewalld/services/* %changelog +* Mon Oct 5 2015 Jan Synáček - 222-7 +- systemctl shows the full cgroup hierarchy when doing status of a disabled or non-existing unit (#1268601) + * Fri Sep 25 2015 Michal Sekletar - 222-6 - Scope units will not get killed immediately during shutdown (#1170765) - Fix comparison function for priority queue (#1202598)