]> git.proxmox.com Git - systemd.git/commitdiff
SysV generator patch cleanup
authorMartin Pitt <martin.pitt@ubuntu.com>
Tue, 3 Feb 2015 12:45:25 +0000 (13:45 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Tue, 3 Feb 2015 12:45:25 +0000 (13:45 +0100)
Merge two patches into Add-support-for-rcS.d-init-scripts-to-the-sysv-gener.patch:
  - Do-not-order-rcS.d-services-after-local-fs.target-if.patch, as it
    partially reverts the above, and is just fixing it.
  - Map-rcS.d-init-script-dependencies-to-their-systemd-.patch as it's just
    adding some missing functionality for the same purpose.

debian/changelog
debian/patches/Add-support-for-rcS.d-init-scripts-to-the-sysv-gener.patch
debian/patches/Do-not-generate-systemd-units-from-sysv-init-scripts.patch
debian/patches/Do-not-order-rcS.d-services-after-local-fs.target-if.patch [deleted file]
debian/patches/Map-rcS.d-init-script-dependencies-to-their-systemd-.patch [deleted file]
debian/patches/series

index 2a0da59a2a5cede16fb3604b942c9bef3e1ef49d..b0b7c3729ea4f691124cbc1462e6ac4c37bf7495 100644 (file)
@@ -14,6 +14,11 @@ systemd (218-8) UNRELEASED; urgency=medium
   * Drop Also-redirect-to-update-rc.d-when-not-using-.service.patch; not
     necessary any more with the current version (mangle_names() already takes
     care of this).
+  * Merge into Add-support-for-rcS.d-init-scripts-to-the-sysv-gener.patch:
+    - Do-not-order-rcS.d-services-after-local-fs.target-if.patch, as it
+      partially reverts the above, and is just fixing it.
+    - Map-rcS.d-init-script-dependencies-to-their-systemd-.patch as it's just
+      adding some missing functionality for the same purpose.
 
  -- Martin Pitt <mpitt@debian.org>  Sun, 01 Feb 2015 22:42:30 +0100
 
index 7aaa6826fc3649fe55ee5db81edcbf5bcbcdfe63..ea503ed03a745f3e8f4309f38de93e64fbbd7a53 100644 (file)
@@ -3,11 +3,60 @@ Date: Sun, 20 Jul 2014 20:00:00 +0200
 Subject: Add support for rcS.d init scripts to the sysv-generator
 
 ---
- src/sysv-generator/sysv-generator.c | 24 ++++++++++++++++++++++--
- 1 file changed, 22 insertions(+), 2 deletions(-)
+ man/systemd.special.xml                   |  9 +++++++++
+ src/insserv-generator/insserv-generator.c |  2 +-
+ src/shared/special.h                      |  2 +-
+ src/sysv-generator/sysv-generator.c       | 31 +++++++++++++++++++++++++++----
+ 4 files changed, 38 insertions(+), 6 deletions(-)
 
+diff --git a/man/systemd.special.xml b/man/systemd.special.xml
+index 863d7f3..ec63e74 100644
+--- a/man/systemd.special.xml
++++ b/man/systemd.special.xml
+@@ -368,6 +368,15 @@
+                                         that have the
+                                         <option>auto</option> mount
+                                         option set.</para>
++
++                                        <para>systemd automatically
++                                        adds dependencies of type
++                                        <varname>After=</varname> for
++                                        this target unit to all SysV
++                                        init script service units with
++                                        an LSB header referring to the
++                                        <literal>$local_fs</literal>
++                                        facility.</para>
+                                 </listitem>
+                         </varlistentry>
+                         <varlistentry>
+diff --git a/src/insserv-generator/insserv-generator.c b/src/insserv-generator/insserv-generator.c
+index d86ee29..6c10735 100644
+--- a/src/insserv-generator/insserv-generator.c
++++ b/src/insserv-generator/insserv-generator.c
+@@ -62,7 +62,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char
+         static const char * const table[] = {
+                 /* LSB defined facilities */
+-                "local_fs",             NULL,
++                "local_fs",             SPECIAL_LOCAL_FS_TARGET,
+                 "network",              SPECIAL_NETWORK_TARGET,
+                 "named",                SPECIAL_NSS_LOOKUP_TARGET,
+                 "portmap",              SPECIAL_RPCBIND_TARGET,
+diff --git a/src/shared/special.h b/src/shared/special.h
+index b045047..fd613c6 100644
+--- a/src/shared/special.h
++++ b/src/shared/special.h
+@@ -49,7 +49,7 @@
+ #define SPECIAL_BUSNAMES_TARGET "busnames.target"
+ #define SPECIAL_TIMERS_TARGET "timers.target"
+ #define SPECIAL_PATHS_TARGET "paths.target"
+-#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"
++#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"         /* LSB's $local_fs */
+ #define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target"
+ #define SPECIAL_INITRD_FS_TARGET "initrd-fs.target"
+ #define SPECIAL_INITRD_ROOT_FS_TARGET "initrd-root-fs.target"
 diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
-index c01d15e..b2a15cf 100644
+index c01d15e..6a43f7d 100644
 --- a/src/sysv-generator/sysv-generator.c
 +++ b/src/sysv-generator/sysv-generator.c
 @@ -41,6 +41,7 @@
@@ -28,14 +77,7 @@ index c01d15e..b2a15cf 100644
          /* Standard SysV runlevels for start-up */
          { "rc1.d",  SPECIAL_RESCUE_TARGET,    RUNLEVEL_UP },
          { "rc2.d",  SPECIAL_RUNLEVEL2_TARGET, RUNLEVEL_UP },
-@@ -68,10 +72,14 @@ static const struct {
-            UP must be read before DOWN */
- };
-+/* Sysinit services uses DefaultDependencies=no, so explicitly order after a safe subset. */
-+#define SYSINIT_AFTER "local-fs.target"
-+
- typedef struct SysvStub {
+@@ -72,6 +76,7 @@ typedef struct SysvStub {
          char *name;
          char *path;
          char *description;
@@ -43,16 +85,16 @@ index c01d15e..b2a15cf 100644
          int sysv_start_priority;
          char *pid_file;
          char **before;
-@@ -189,6 +197,8 @@ static int generate_unit_file(SysvStub *s) {
+@@ -189,6 +194,8 @@ static int generate_unit_file(SysvStub *s) {
                  "Description=%s\n",
                  s->path, s->description);
  
 +        if (s->sysinit)
-+                fprintf(f, "DefaultDependencies=no\nAfter=" SYSINIT_AFTER "\n");
++                fprintf(f, "DefaultDependencies=no\n");
          if (!isempty(before))
                  fprintf(f, "Before=%s\n", before);
          if (!isempty(after))
-@@ -202,11 +212,12 @@ static int generate_unit_file(SysvStub *s) {
+@@ -202,11 +209,12 @@ static int generate_unit_file(SysvStub *s) {
                  "\n[Service]\n"
                  "Type=forking\n"
                  "Restart=no\n"
@@ -66,7 +108,32 @@ index c01d15e..b2a15cf 100644
                  yes_no(!s->pid_file));
  
          if (s->pid_file)
-@@ -713,6 +724,11 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
+@@ -265,16 +273,22 @@ static int sysv_translate_facility(const char *name, const char *filename, char
+         static const char * const table[] = {
+                 /* LSB defined facilities */
+-                "local_fs",             NULL,
++                "local_fs",             SPECIAL_LOCAL_FS_TARGET,
+                 "network",              SPECIAL_NETWORK_ONLINE_TARGET,
+                 "named",                SPECIAL_NSS_LOOKUP_TARGET,
+                 "portmap",              SPECIAL_RPCBIND_TARGET,
+                 "remote_fs",            SPECIAL_REMOTE_FS_TARGET,
+-                "syslog",               NULL,
++                "syslog",               "systemd-journald-dev-log.socket",
+                 "time",                 SPECIAL_TIME_SYNC_TARGET,
+                 /* Debian defined facilities */
+                 "x-display-manager",    "display-manager.service",
+                 "mail-transport-agent", "mail-transport-agent.target",
++                /* special rcS init scripts */
++                "cryptdisks",           "cryptsetup.target",
++                "mountall",             SPECIAL_LOCAL_FS_TARGET,
++                "mountnfs",             SPECIAL_REMOTE_FS_TARGET,
++                "checkroot",            "systemd-remount-fs.service",
++                "dbus",                 "dbus.socket",
+         };
+         unsigned i;
+@@ -713,6 +727,11 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
                  if (s->has_lsb && other->has_lsb)
                          continue;
  
@@ -78,7 +145,7 @@ index c01d15e..b2a15cf 100644
                  if (other->sysv_start_priority < s->sysv_start_priority) {
                          r = strv_extend(&s->after, other->name);
                          if (r < 0)
-@@ -864,8 +880,12 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+@@ -864,8 +883,12 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
                                  }
  
                                  if (de->d_name[0] == 'S')  {
index dec8e82a077a78a9513c5313043bdfcae99644ee..01977186a81be12bfdc2e4898721c34a2a0579ae 100644 (file)
@@ -8,10 +8,10 @@ Subject: Do not generate systemd units from sysv init scripts if a native
  1 file changed, 27 insertions(+), 1 deletion(-)
 
 diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
-index b2a15cf..069ac20 100644
+index 6a43f7d..22f2fdc 100644
 --- a/src/sysv-generator/sysv-generator.c
 +++ b/src/sysv-generator/sysv-generator.c
-@@ -748,6 +748,25 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
+@@ -751,6 +751,25 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
          return 0;
  }
  
@@ -37,7 +37,7 @@ index b2a15cf..069ac20 100644
  static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
          char **path;
  
-@@ -788,6 +807,12 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
+@@ -791,6 +810,12 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
                          if (hashmap_contains(all_services, name))
                                  continue;
  
@@ -50,7 +50,7 @@ index b2a15cf..069ac20 100644
                          service = new0(SysvStub, 1);
                          if (!service)
                                  return log_oom();
-@@ -875,7 +900,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+@@ -878,7 +903,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
  
                                  service = hashmap_get(all_services, name);
                                  if (!service){
diff --git a/debian/patches/Do-not-order-rcS.d-services-after-local-fs.target-if.patch b/debian/patches/Do-not-order-rcS.d-services-after-local-fs.target-if.patch
deleted file mode 100644 (file)
index 214f340..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-From: Jon Severinsson <jon@severinsson.net>
-Date: Thu, 3 Jul 2014 18:00:00 +0200
-Subject: Do not order rcS.d services after local-fs.target if they do not
- explicitly depending on $local_fs.
-
----
- man/systemd.special.xml                   | 9 +++++++++
- src/insserv-generator/insserv-generator.c | 2 +-
- src/shared/special.h                      | 2 +-
- src/sysv-generator/sysv-generator.c       | 7 ++-----
- 4 files changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/man/systemd.special.xml b/man/systemd.special.xml
-index 863d7f3..ec63e74 100644
---- a/man/systemd.special.xml
-+++ b/man/systemd.special.xml
-@@ -368,6 +368,15 @@
-                                         that have the
-                                         <option>auto</option> mount
-                                         option set.</para>
-+
-+                                        <para>systemd automatically
-+                                        adds dependencies of type
-+                                        <varname>After=</varname> for
-+                                        this target unit to all SysV
-+                                        init script service units with
-+                                        an LSB header referring to the
-+                                        <literal>$local_fs</literal>
-+                                        facility.</para>
-                                 </listitem>
-                         </varlistentry>
-                         <varlistentry>
-diff --git a/src/insserv-generator/insserv-generator.c b/src/insserv-generator/insserv-generator.c
-index d86ee29..6c10735 100644
---- a/src/insserv-generator/insserv-generator.c
-+++ b/src/insserv-generator/insserv-generator.c
-@@ -62,7 +62,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char
-         static const char * const table[] = {
-                 /* LSB defined facilities */
--                "local_fs",             NULL,
-+                "local_fs",             SPECIAL_LOCAL_FS_TARGET,
-                 "network",              SPECIAL_NETWORK_TARGET,
-                 "named",                SPECIAL_NSS_LOOKUP_TARGET,
-                 "portmap",              SPECIAL_RPCBIND_TARGET,
-diff --git a/src/shared/special.h b/src/shared/special.h
-index b045047..fd613c6 100644
---- a/src/shared/special.h
-+++ b/src/shared/special.h
-@@ -49,7 +49,7 @@
- #define SPECIAL_BUSNAMES_TARGET "busnames.target"
- #define SPECIAL_TIMERS_TARGET "timers.target"
- #define SPECIAL_PATHS_TARGET "paths.target"
--#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"
-+#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"         /* LSB's $local_fs */
- #define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target"
- #define SPECIAL_INITRD_FS_TARGET "initrd-fs.target"
- #define SPECIAL_INITRD_ROOT_FS_TARGET "initrd-root-fs.target"
-diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
-index 069ac20..3f9dcfa 100644
---- a/src/sysv-generator/sysv-generator.c
-+++ b/src/sysv-generator/sysv-generator.c
-@@ -72,9 +72,6 @@ static const struct {
-            UP must be read before DOWN */
- };
--/* Sysinit services uses DefaultDependencies=no, so explicitly order after a safe subset. */
--#define SYSINIT_AFTER "local-fs.target"
--
- typedef struct SysvStub {
-         char *name;
-         char *path;
-@@ -198,7 +195,7 @@ static int generate_unit_file(SysvStub *s) {
-                 s->path, s->description);
-         if (s->sysinit)
--                fprintf(f, "DefaultDependencies=no\nAfter=" SYSINIT_AFTER "\n");
-+                fprintf(f, "DefaultDependencies=no\n");
-         if (!isempty(before))
-                 fprintf(f, "Before=%s\n", before);
-         if (!isempty(after))
-@@ -276,7 +273,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char
-         static const char * const table[] = {
-                 /* LSB defined facilities */
--                "local_fs",             NULL,
-+                "local_fs",             SPECIAL_LOCAL_FS_TARGET,
-                 "network",              SPECIAL_NETWORK_ONLINE_TARGET,
-                 "named",                SPECIAL_NSS_LOOKUP_TARGET,
-                 "portmap",              SPECIAL_RPCBIND_TARGET,
diff --git a/debian/patches/Map-rcS.d-init-script-dependencies-to-their-systemd-.patch b/debian/patches/Map-rcS.d-init-script-dependencies-to-their-systemd-.patch
deleted file mode 100644 (file)
index fe6fede..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Jon Severinsson <jon@severinsson.net>
-Date: Fri, 11 Jul 2014 02:15:37 +0200
-Subject: Map rcS.d init script dependencies to their systemd equivalent.
-
----
- src/sysv-generator/sysv-generator.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
-index 3f9dcfa..22f2fdc 100644
---- a/src/sysv-generator/sysv-generator.c
-+++ b/src/sysv-generator/sysv-generator.c
-@@ -278,11 +278,17 @@ static int sysv_translate_facility(const char *name, const char *filename, char
-                 "named",                SPECIAL_NSS_LOOKUP_TARGET,
-                 "portmap",              SPECIAL_RPCBIND_TARGET,
-                 "remote_fs",            SPECIAL_REMOTE_FS_TARGET,
--                "syslog",               NULL,
-+                "syslog",               "systemd-journald-dev-log.socket",
-                 "time",                 SPECIAL_TIME_SYNC_TARGET,
-                 /* Debian defined facilities */
-                 "x-display-manager",    "display-manager.service",
-                 "mail-transport-agent", "mail-transport-agent.target",
-+                /* special rcS init scripts */
-+                "cryptdisks",           "cryptsetup.target",
-+                "mountall",             SPECIAL_LOCAL_FS_TARGET,
-+                "mountnfs",             SPECIAL_REMOTE_FS_TARGET,
-+                "checkroot",            "systemd-remount-fs.service",
-+                "dbus",                 "dbus.socket",
-         };
-         unsigned i;
index 91340573f6331a9e728c936bc641a88083c4dd06..97f2cfff74c5feb5d8be4bd14d07a9b80d0e9fe9 100644 (file)
@@ -48,8 +48,6 @@ Add-run-initctl-support-to-SysV-compat-tools.patch
 Add-support-for-TuxOnIce-hibernation.patch
 Add-support-for-rcS.d-init-scripts-to-the-sysv-gener.patch
 Do-not-generate-systemd-units-from-sysv-init-scripts.patch
-Do-not-order-rcS.d-services-after-local-fs.target-if.patch
-Map-rcS.d-init-script-dependencies-to-their-systemd-.patch
 Stop-syslog.socket-when-entering-emergency-mode.patch
 Make-run-lock-tmpfs-an-API-fs.patch
 Include-additional-directories-in-ProtectSystem.patch