A System and Service Manager
CentOS Sources
2015-03-26 a1d4ebc132e4c738774209ba31206eb4f405d768
import systemd-208-20.el7_1.2
3 files added
1 files modified
174 ■■■■■ changed files
SOURCES/0383-shared-install-avoid-prematurely-rejecting-missing-u.patch 40 ●●●●● patch | view | raw | blame | history
SOURCES/0384-core-fix-enabling-units-via-their-absolute-paths.patch 36 ●●●●● patch | view | raw | blame | history
SOURCES/0385-Revert-units-fix-BindsTo-logic-when-applied-relative.patch 86 ●●●●● patch | view | raw | blame | history
SPECS/systemd.spec 12 ●●●●● patch | view | raw | blame | history
SOURCES/0383-shared-install-avoid-prematurely-rejecting-missing-u.patch
New file
@@ -0,0 +1,40 @@
From be49ecd6ee3af4aa83572ca413aa457058e3573d Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Thu, 30 Oct 2014 20:12:05 -0400
Subject: [PATCH] shared/install: avoid prematurely rejecting "missing" units
f7101b7368df copied some logic to prevent enabling masked units, but
also added a check which causes attempts to enable templated units to
fail. Since we know the logic beyond this check will properly handle
units which truly do not exist, we can rely on the unit file state
comparison to suffice for expressing the intent of f7101b7368df.
ref: https://bugs.archlinux.org/task/42616
(Cherry-picked from 0ffce503cd6e5a5ff5ba5cd1cc23684cfb8bb9e3)
Resolves: #1199981
---
 src/shared/install.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/shared/install.c b/src/shared/install.c
index 7a29798..13db732 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1522,12 +1522,10 @@ int unit_file_enable(
         STRV_FOREACH(i, files) {
                 UnitFileState state;
+                /* We only want to know if this unit is masked, so we ignore
+                 * errors from unit_file_get_state, deferring other checks.
+                 * This allows templated units to be enabled on the fly. */
                 state = unit_file_get_state(scope, root_dir, *i);
-                if (state < 0) {
-                        log_error("Failed to get unit file state for %s: %s", *i, strerror(-state));
-                        return state;
-                }
-
                 if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
                         log_error("Failed to enable unit: Unit %s is masked", *i);
                         return -ENOTSUP;
SOURCES/0384-core-fix-enabling-units-via-their-absolute-paths.patch
New file
@@ -0,0 +1,36 @@
From a13006e07ad1c8f3de577b8b64f22a0e044784e7 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Tue, 10 Feb 2015 10:34:20 +0100
Subject: [PATCH] core: fix enabling units via their absolute paths
In case when client requests enable but gives us full path to unit file we
should call manager_load_unit with 2nd and 3rd argument swapped because we
don't want to search for unit file in usual places but rather load it directly.
Related: #1199981
---
 src/core/dbus-manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index cebc730..f35f23b 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1603,7 +1603,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                 STRV_FOREACH(i, l) {
                         Unit *u;
-                        r = manager_load_unit(m, *i, NULL, NULL, &u);
+                        r = path_is_absolute(*i) ? manager_load_unit(m, NULL, *i, NULL, &u) : manager_load_unit(m, *i, NULL, NULL, &u);
                         if (r < 0) {
                                 dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s does not exist.", *i);
                                 return bus_send_error_reply(connection, message, &error, -ENOENT);
@@ -1681,7 +1681,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                 STRV_FOREACH(i, l) {
                         Unit *u;
-                        r = manager_load_unit(m, *i, NULL, NULL, &u);
+                        r = path_is_absolute(*i) ? manager_load_unit(m, NULL, *i, NULL, &u) : manager_load_unit(m, *i, NULL, NULL, &u);
                         if (r < 0) {
                                 dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s does not exist.", *i);
                                 return bus_send_error_reply(connection, message, &error, -ENOENT);
SOURCES/0385-Revert-units-fix-BindsTo-logic-when-applied-relative.patch
New file
@@ -0,0 +1,86 @@
From 1f4f34eb7592ec54f86040529c96d35efe97b219 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Wed, 11 Mar 2015 11:29:40 +0100
Subject: [PATCH] Revert "units: fix BindsTo= logic when applied relative to
 services with Type=oneshot"
This reverts commit 469d48cf685bd0157fa44ff7ebd3bd0302746ab0.
Resolves: #1203803
---
 src/core/unit.c | 48 ++++--------------------------------------------
 1 file changed, 4 insertions(+), 44 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index f221b9a..b51e351 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1302,44 +1302,12 @@ static void unit_check_unneeded(Unit *u) {
                 if (unit_active_or_pending(other))
                         return;
-        log_info_unit(u->id, "Unit %s is not needed anymore. Stopping.", u->id);
+        log_info_unit(u->id, "Service %s is not needed anymore. Stopping.", u->id);
         /* Ok, nobody needs us anymore. Sniff. Then let's commit suicide */
         manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL);
 }
-static void unit_check_binds_to(Unit *u) {
-        bool stop = false;
-        Unit *other;
-        Iterator i;
-
-        assert(u);
-
-        if (u->job)
-                return;
-
-        if (unit_active_state(u) != UNIT_ACTIVE)
-                return;
-
-        SET_FOREACH(other, u->dependencies[UNIT_BINDS_TO], i) {
-                if (other->job)
-                        continue;
-
-                if (!UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other)))
-                        continue;
-
-                stop = true;
-        }
-
-        if (!stop)
-                return;
-
-        log_info_unit(u->id, "Unit %s is bound to inactive service. Stopping, too.", u->id);
-
-        /* A unit we need to run is gone. Sniff. Let's stop this. */
-        manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL);
-}
-
 static void retroactively_start_dependencies(Unit *u) {
         Iterator i;
         Unit *other;
@@ -1643,19 +1611,11 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
         manager_recheck_journal(m);
         unit_trigger_notify(u);
-        if (u->manager->n_reloading <= 0) {
-                /* Maybe we finished startup and are now ready for
-                 * being stopped because unneeded? */
+        /* Maybe we finished startup and are now ready for being
+         * stopped because unneeded? */
+        if (u->manager->n_reloading <= 0)
                 unit_check_unneeded(u);
-                /* Maybe we finished startup, but something we needed
-                 * has vanished? Let's die then. (This happens when
-                 * something BindsTo= to a Type=oneshot unit, as these
-                 * units go directly from starting to inactive,
-                 * without ever entering started.) */
-                unit_check_binds_to(u);
-        }
-
         unit_add_to_dbus_queue(u);
         unit_add_to_gc_queue(u);
 }
SPECS/systemd.spec
@@ -11,7 +11,7 @@
Name:           systemd
Url:            http://www.freedesktop.org/wiki/Software/systemd
Version:        208
Release:        20%{?dist}
Release:        20%{?dist}.2
# For a breakdown of the licensing, see README
License:        LGPLv2+ and MIT and GPLv2+
Summary:        A System and Service Manager
@@ -413,6 +413,9 @@
Patch0380: 0380-mount-add-remote-fs-dependencies-if-needed-after-cha.patch
Patch0381: 0381-mount-check-options-as-well-as-fstype-for-network-mo.patch
Patch0382: 0382-rules-don-t-enable-usb-pm-for-Avocent-devices.patch
Patch0383: 0383-shared-install-avoid-prematurely-rejecting-missing-u.patch
Patch0384: 0384-core-fix-enabling-units-via-their-absolute-paths.patch
Patch0385: 0385-Revert-units-fix-BindsTo-logic-when-applied-relative.patch
%global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);}
@@ -1213,6 +1216,13 @@
%{_datadir}/systemd/gatewayd
%changelog
* Thu Mar 19 2015 Lukas Nykryn <lnykryn@redhat.com> - 208-20.2
- Revert "units: fix BindsTo= logic when applied relative to services with Type=oneshot" (#1203803)
* Mon Mar 09 2015 Lukas Nykryn <lnykryn@redhat.com> - 208-20.1
- shared/install: avoid prematurely rejecting "missing" units (#1199981)
- core: fix enabling units via their absolute paths (#1199981)
* Mon Dec 22 2014 Lukas Nykryn <lnykryn@redhat.com> - 208-20
- core: introduce new Delegate=yes/no property controlling creation of cgroup subhierarchies (#1139223)
- core: don't migrate PIDs for units that may contain subcgroups, do this only for leaf units (#1139223)