- Drop 0006-sysv-generator-add-back-support-for-SysV-scripts-for.patch 0009-sysv-add-back-support-for-all-virtual-facility-and-f.patch

Given the fact that Factory no more ship SysV init scripts since several
  months, only scripts coming from 3rd party applications should remain which
  are unlikely to rely on the SUSE specifities implemented by these
  patches. This change was announced on the Factory mailing list:
  https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/3ERUP5ZZJ6PPA36L3HVN46BH6U6JL74O/

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1241
This commit is contained in:
Franck Bui 2022-01-31 15:05:15 +00:00 committed by Git OBS Bridge
parent ba0a8a2e06
commit acd6970dd2
4 changed files with 12 additions and 168 deletions

View File

@ -1,123 +0,0 @@
From 1bd48f23ea7750b354bfb94482f9f035bf8b7841 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Thu, 26 May 2016 08:59:41 +0200
Subject: [PATCH 06/11] sysv-generator: add (back) support for SysV scripts for
the early boot
For the record, the upstream support was removed by commit
3cdebc217c42c8529086f2965319b6a48eaaeabe.
The sysv-generator has some weirdos: for example a service at the rc0
runlevel won't be started during shutdown since it will get both
"WantedBy=poweroff.target" and "Conflicts=shutdown.target".
Anyways what's the current patch implements the following:
- a symlink /etc/init.d/boot.d/S??boot.foo will add
"WantedBy/Before=sysinit.target" constraints and make sure that the
default dependencies added by systemd are turned off.
- a symlink /etc/init.d/boot.d/K??boot.foo will add
"Conflicts/Before=shutdown.target" so "foo" service will be stopped
like any other regular services. If this symlink is not installed
however, "foo" will be stopped lately during the systemd killing
spree.
This is a forward-port of commit 29db8537e1ca10796797d9854d1 in SP1.
[Since v232]
Support for S* symlinks in runlevel 0 or 6 has been completely and silently
removed by 788d2b088b13a2444b9eb2ea82c0cc57d9f0980f. Since it was already
broken as pointed out above, this probably wasn't really used and therefore
no one will really care. So let's drop it too.
However this has the side effect to make the support of early sysv scripts more
difficult. To make things easy, the support of K* symlinks in boot.d/ has been
removed too: this is probably not used (anymore) (at least intentionally).
The consequence is that early sysv services are stopped during shutdown at
the same time as 'normal' services.
---
src/sysv-generator/sysv-generator.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index bf23c48662..fa5355c964 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -31,6 +31,9 @@ static const struct {
const char *path;
const char *target;
} rcnd_table[] = {
+ /* SUSE style boot.d */
+ { "boot.d", SPECIAL_SYSINIT_TARGET },
+
/* Standard SysV runlevels for start-up */
{ "rc1.d", SPECIAL_RESCUE_TARGET },
{ "rc2.d", SPECIAL_MULTI_USER_TARGET },
@@ -57,6 +60,7 @@ typedef struct SysvStub {
bool has_lsb;
bool reload;
bool loaded;
+ bool early;
} SysvStub;
static SysvStub* free_sysvstub(SysvStub *s) {
@@ -146,6 +150,12 @@ static int generate_unit_file(SysvStub *s) {
fprintf(f, "Description=%s\n", t);
}
+ if (s->early) {
+ fprintf(f, "DefaultDependencies=no\n");
+ fprintf(f, "Conflicts=%s\n", SPECIAL_SHUTDOWN_TARGET);
+ fprintf(f, "Before=%s\n", SPECIAL_SHUTDOWN_TARGET);
+ }
+
STRV_FOREACH(p, s->before)
fprintf(f, "Before=%s\n", *p);
STRV_FOREACH(p, s->after)
@@ -212,6 +222,10 @@ static char *sysv_translate_name(const char *name) {
_cleanup_free_ char *c = NULL;
char *res;
+ if (startswith(name, "boot."))
+ /* Drop SuSE-style boot. prefix */
+ name += 5;
+
c = strdup(name);
if (!c)
return NULL;
@@ -288,6 +302,11 @@ static int sysv_translate_facility(SysvStub *s, unsigned line, const char *name,
return 1;
}
+ /* Strip "boot." prefix from file name for comparison (Suse specific) */
+ e = startswith(filename, "boot.");
+ if (e)
+ filename += 5;
+
/* Strip ".sh" suffix from file name for comparison */
filename_no_sh = strdupa(filename);
e = endswith(filename_no_sh, ".sh");
@@ -651,6 +670,9 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
if (other->sysv_start_priority < 0)
continue;
+ if (s->early != other->early)
+ continue;
+
/* If both units have modern headers we don't care
* about the priorities */
if (s->has_lsb && other->has_lsb)
@@ -775,6 +797,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
.sysv_start_priority = -1,
.name = TAKE_PTR(name),
.path = TAKE_PTR(fpath),
+ .early = !!startswith(de->d_name, "boot."),
};
r = hashmap_put(all_services, service->name, service);
--
2.26.2

View File

@ -1,43 +0,0 @@
From 6f4d9d9688ad65bb46d09ac09f570c6ee4bc3671 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Fri, 14 Jan 2022 08:17:38 +0100
Subject: [PATCH 1010/1010] sysv: add back support for '$all' virtual facility
and '+' facitity name prefix
'$all' was probably a Debian thing and has probably never been supported by RH,
which explains why systemd upstream never supported it too. At least I couldn't
find any reference of this facility name in
http://refspecs.linux-foundation.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic.html#FACILNAME. OTOH
'$all' is described in https://wiki.debian.org/LSBInitScripts
Regarding the '+' prefix, I couldn't find any mention of it
anywhere. Apparently it was equivalent to '$' in facility names.
[wfink: bsc#858864]
---
src/sysv-generator/sysv-generator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index c6e1953839..0aadb397ed 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -243,6 +243,7 @@ static int sysv_translate_facility(SysvStub *s, unsigned line, const char *name,
"remote_fs", SPECIAL_REMOTE_FS_TARGET,
"syslog", NULL,
"time", SPECIAL_TIME_SYNC_TARGET,
+ "all", SPECIAL_DEFAULT_TARGET,
};
const char *filename;
@@ -257,6 +258,7 @@ static int sysv_translate_facility(SysvStub *s, unsigned line, const char *name,
filename = basename(s->path);
+ n = *name == '+' ? ++name : name;
n = *name == '$' ? name + 1 : name;
for (i = 0; i < ELEMENTSOF(table); i += 2) {
--
2.31.1

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Jan 31 14:54:07 UTC 2022 - Franck Bui <fbui@suse.com>
- Drop 0006-sysv-generator-add-back-support-for-SysV-scripts-for.patch 0009-sysv-add-back-support-for-all-virtual-facility-and-f.patch
Given the fact that Factory no more ship SysV init scripts since several
months, only scripts coming from 3rd party applications should remain which
are unlikely to rely on the SUSE specifities implemented by these
patches. This change was announced on the Factory mailing list:
https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/3ERUP5ZZJ6PPA36L3HVN46BH6U6JL74O/
-------------------------------------------------------------------
Mon Jan 31 11:37:23 UTC 2022 - Franck Bui <fbui@suse.com>

View File

@ -201,10 +201,8 @@ Patch1: 0001-restore-var-run-and-var-lock-bind-mount-if-they-aren.patch
Patch2: 0002-rc-local-fix-ordering-startup-for-etc-init.d-boot.lo.patch
Patch3: 0003-strip-the-domain-part-from-etc-hostname-when-setting.patch
Patch5: 0005-udev-create-default-symlinks-for-primary-cd_dvd-driv.patch
Patch6: 0006-sysv-generator-add-back-support-for-SysV-scripts-for.patch
Patch7: 0007-networkd-make-network.service-an-alias-of-systemd-ne.patch
Patch8: 0008-sysv-generator-translate-Required-Start-into-a-Wants.patch
Patch9: 0009-sysv-add-back-support-for-all-virtual-facility-and-f.patch
Patch10: 0001-conf-parser-introduce-early-drop-ins.patch
Patch11: 0011-core-disable-session-keyring-per-system-sevice-entir.patch
Patch12: 0009-pid1-handle-console-specificities-weirdness-for-s390.patch