2024-04-25 11:12:22 +02:00
|
|
|
From 6eb24d1fcf8ea676bd0f0e32a9afda7431eafd77 Mon Sep 17 00:00:00 2001
|
2020-09-04 08:47:46 +02:00
|
|
|
From: Thomas Blume <Thomas.Blume@suse.com>
|
|
|
|
Date: Wed, 4 May 2016 17:40:04 +0200
|
2024-02-23 17:24:26 +01:00
|
|
|
Subject: [PATCH] sysv-generator: translate "Required-Start" into a "Wants"
|
2022-01-14 16:14:43 +01:00
|
|
|
dependency
|
2020-09-04 08:47:46 +02:00
|
|
|
|
2022-01-14 16:14:43 +01:00
|
|
|
'Required-Start:' used to be supported by insserv but this functionality was
|
|
|
|
dropped when insserv was rewritten into a compat perl wrapper (insserv-compat),
|
|
|
|
which happened when systemd was introduced in SUSE, I guess.
|
|
|
|
|
|
|
|
It's been decided to add back the support in systemd instead of insserv-compat,
|
|
|
|
see the comments in bsc#857204.
|
2020-09-04 08:47:46 +02:00
|
|
|
|
2022-01-14 16:14:43 +01:00
|
|
|
[tblume: Port of SLES12SP1 patch 0018-Make-LSB-Skripts-know-about-Required-and-Should.patch]
|
2024-04-25 11:12:22 +02:00
|
|
|
[fbui: patch sysv-generator-test.py to take this SUSE's specifity into account]
|
2020-09-04 08:47:46 +02:00
|
|
|
|
2022-01-14 16:14:43 +01:00
|
|
|
[wfink: fixes bsc#857204]
|
2020-09-04 08:47:46 +02:00
|
|
|
---
|
2022-01-14 16:14:43 +01:00
|
|
|
src/sysv-generator/sysv-generator.c | 7 ++++++-
|
2024-04-25 11:12:22 +02:00
|
|
|
test/sysv-generator-test.py | 2 +-
|
|
|
|
2 files changed, 7 insertions(+), 2 deletions(-)
|
2020-09-04 08:47:46 +02:00
|
|
|
|
|
|
|
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
|
2024-02-23 17:24:26 +01:00
|
|
|
index 4485e2e368..e0833a7179 100644
|
2020-09-04 08:47:46 +02:00
|
|
|
--- a/src/sysv-generator/sysv-generator.c
|
|
|
|
+++ b/src/sysv-generator/sysv-generator.c
|
2024-02-23 17:24:26 +01:00
|
|
|
@@ -412,8 +412,13 @@ static int handle_dependencies(SysvStub *s, unsigned line, const char *full_text
|
2020-09-04 08:47:46 +02:00
|
|
|
return log_oom();
|
|
|
|
|
|
|
|
r = strv_extend(&s->wants, m);
|
|
|
|
- } else
|
|
|
|
+ } else {
|
|
|
|
r = strv_extend(is_before ? &s->before : &s->after, m);
|
|
|
|
+
|
2022-01-14 16:14:43 +01:00
|
|
|
+ if (startswith_no_case(full_text, "Required-Start:"))
|
2020-09-04 08:47:46 +02:00
|
|
|
+ r = strv_extend(&s->wants, m);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (r < 0)
|
|
|
|
return log_oom();
|
|
|
|
}
|
2024-04-25 11:12:22 +02:00
|
|
|
diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py
|
|
|
|
index 24fafbaaa4..827d802a17 100755
|
|
|
|
--- a/test/sysv-generator-test.py
|
|
|
|
+++ b/test/sysv-generator-test.py
|
|
|
|
@@ -224,7 +224,7 @@ class SysvGeneratorTest(unittest.TestCase):
|
|
|
|
self.add_sysv('foo', {'Required-Start': '$named $portmap'})
|
|
|
|
s = self.run_generator()[1]['foo.service']
|
|
|
|
self.assertEqual(set(s.options('Unit')),
|
|
|
|
- set(['Documentation', 'SourcePath', 'Description', 'After']))
|
|
|
|
+ set(['Documentation', 'SourcePath', 'Description', 'After', 'Wants']))
|
|
|
|
self.assertEqual(s.get('Unit', 'After').split(), ['nss-lookup.target', 'rpcbind.target'])
|
|
|
|
|
|
|
|
def test_lsb_deps(self):
|
2020-09-04 08:47:46 +02:00
|
|
|
--
|
2024-02-23 17:24:26 +01:00
|
|
|
2.35.3
|
2020-09-04 08:47:46 +02:00
|
|
|
|