]> git.pld-linux.org Git - packages/systemd.git/blob - ignore-sysv-if-native-exists.patch
config-pld.patch fix
[packages/systemd.git] / ignore-sysv-if-native-exists.patch
1 From f4f01ec146d91cb6943828851d98eee6a1ad4dd9 Mon Sep 17 00:00:00 2001
2 From: Martin Pitt <martin.pitt@ubuntu.com>
3 Date: Wed, 2 Jul 2014 22:00:00 +0200
4 Subject: [PATCH] sysv-generator: Skip init scripts for existing native
5  services
6
7 This avoids taking the SysV init script enablement state into account if we
8 have native units. Otherwise systemctl disable on native unit would not
9 be respected in the presence of an enabled SysV script.
10
11 Also, there's no need to do all the parsing and creation of service files if we
12 already have a native systemd unit for the processed SysV init script.
13 ---
14  src/sysv-generator/sysv-generator.c |  8 +++++++-
15  test/sysv-generator-test.py         | 12 ++++++++++++
16  2 files changed, 19 insertions(+), 1 deletion(-)
17
18 diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
19 index 673f04d..6e39b44 100644
20 --- a/src/sysv-generator/sysv-generator.c
21 +++ b/src/sysv-generator/sysv-generator.c
22 @@ -768,6 +768,11 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
23                          if (!fpath)
24                                  return log_oom();
25  
26 +                        if (unit_file_get_state(UNIT_FILE_SYSTEM, NULL, name) >= 0) {
27 +                                log_debug("Native unit for %s already exists, skipping", name);
28 +                                continue;
29 +                        }
30 +
31                          service = new0(SysvStub, 1);
32                          if (!service)
33                                  return log_oom();
34 @@ -852,7 +857,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
35  
36                                  service = hashmap_get(all_services, name);
37                                  if (!service){
38 -                                        log_warning("Could not find init script for %s", name);
39 +                                        log_debug("Ignoring %s symlink in %s, not generating %s.",
40 +                                                  de->d_name, rcnd_table[i].path, name);
41                                          continue;
42                                  }
43  
44
This page took 0.288409 seconds and 3 git commands to generate.