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.
* 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
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 @@
/* 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;
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"
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;
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') {
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;
}
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;
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){
+++ /dev/null
-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,
+++ /dev/null
-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;
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