]> git.pld-linux.org Git - packages/systemd.git/commitdiff
Ignore sysv init script when native exists
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Fri, 3 Apr 2015 12:34:13 +0000 (14:34 +0200)
committerJacek Konieczny <j.konieczny@eggsoft.pl>
Fri, 3 Apr 2015 12:34:13 +0000 (14:34 +0200)
Otherwise even disabled systemd units would be started if there is
a legacy service enabled.

Patch taken from upstream:

https://github.com/systemd/systemd/commit/f4f01ec146d91cb6943828851d98eee6a1ad4dd9?diff=unified

ignore-sysv-if-native-exists.patch [new file with mode: 0644]
systemd.spec

diff --git a/ignore-sysv-if-native-exists.patch b/ignore-sysv-if-native-exists.patch
new file mode 100644 (file)
index 0000000..90aa462
--- /dev/null
@@ -0,0 +1,44 @@
+From f4f01ec146d91cb6943828851d98eee6a1ad4dd9 Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Wed, 2 Jul 2014 22:00:00 +0200
+Subject: [PATCH] sysv-generator: Skip init scripts for existing native
+ services
+
+This avoids taking the SysV init script enablement state into account if we
+have native units. Otherwise systemctl disable on native unit would not
+be respected in the presence of an enabled SysV script.
+
+Also, there's no need to do all the parsing and creation of service files if we
+already have a native systemd unit for the processed SysV init script.
+---
+ src/sysv-generator/sysv-generator.c |  8 +++++++-
+ test/sysv-generator-test.py         | 12 ++++++++++++
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
+index 673f04d..6e39b44 100644
+--- a/src/sysv-generator/sysv-generator.c
++++ b/src/sysv-generator/sysv-generator.c
+@@ -768,6 +768,11 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
+                         if (!fpath)
+                                 return log_oom();
++                        if (unit_file_get_state(UNIT_FILE_SYSTEM, NULL, name) >= 0) {
++                                log_debug("Native unit for %s already exists, skipping", name);
++                                continue;
++                        }
++
+                         service = new0(SysvStub, 1);
+                         if (!service)
+                                 return log_oom();
+@@ -852,7 +857,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+                                 service = hashmap_get(all_services, name);
+                                 if (!service){
+-                                        log_warning("Could not find init script for %s", name);
++                                        log_debug("Ignoring %s symlink in %s, not generating %s.",
++                                                  de->d_name, rcnd_table[i].path, name);
+                                         continue;
+                                 }
+
index d6c249db593e4f669cffd73b6bedcab2408029c5..7c55f2c8aad4bc3f7dfb49b4db3ac3ad44e35cc3 100644 (file)
@@ -57,6 +57,7 @@ Patch1:               config-pld.patch
 Patch2:                shut-sysv-up.patch
 Patch3:                pld-sysv-network.patch
 Patch4:                tmpfiles-not-fatal.patch
+Patch5:                ignore-sysv-if-native-exists.patch
 Patch8:                udev-ploop-rules.patch
 Patch9:                udevadm-in-sbin.patch
 Patch10:       net-rename-revert.patch
@@ -616,6 +617,7 @@ Uzupełnianie parametrów w zsh dla poleceń udev.
 #patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 %patch8 -p1
 %patch9 -p1
 # rejected upstream
This page took 0.097661 seconds and 4 git commands to generate.