Your message dated Thu, 23 Sep 2021 17:48:25 +0000
with message-id <[email protected]>
and subject line Bug#962412: fixed in insserv 1.23.0-1
has caused the Debian Bug report #962412,
regarding OpenRC and LSB header logic
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
962412: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=962412
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: insserv
Version: 1.21.0-1
Hi. Attached is an insserv patch that adds better support for OpenRC
initscripts. Naturally, it looks for #!/sbin/openrc-run as the shebang
in the initscript and acts accordingly.
If merged, this can also close #960934
>From 6b1313cb395d951bc1395137d8d2feff6f73eb23 Mon Sep 17 00:00:00 2001
From: Merlijn Wajer <[email protected]>
Date: Sun, 7 Jun 2020 17:22:06 +0000
Subject: [PATCH] Support OpenRC initscripts when scanning for LSB.
This patch adds support for OpenRC scripts and avoids the
unnecessary warnings that insserv produces when the LSB headers
are missing. In OpenRC they are unnecessary because dependencies
are handled internally with the depend() function.
Co-authored-by: Ivan J. <[email protected]>
---
insserv.c | 43 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 39 insertions(+), 4 deletions(-)
diff --git a/insserv.c b/insserv.c
index f949f05..75c6140 100644
--- a/insserv.c
+++ b/insserv.c
@@ -1390,6 +1390,35 @@ static inline void scan_script_reset(void)
xreset(script_inf.interactive);
}
+/*
+ * return 1 if the script is an openrc script
+ */
+
+static int is_openrc_job(const char *path)
+{
+ char buf[64];
+ FILE *script = NULL;
+
+ script = fopen(path, "r");
+ if (script == NULL) {
+ warn("Can not open script %s: %s\n", path, strerror(errno));
+ return 0;
+ }
+
+ if (fgets(buf, 64, script) == NULL) {
+ warn("Could not read script %s: %s\n", path, strerror(errno));
+ fclose(script);
+ return 0;
+ }
+
+ fclose(script);
+
+ if (!strncmp(buf, "#!/sbin/openrc-run\n", 19))
+ return 1;
+
+ return 0;
+}
+
/*
* return name of upstart job if the script is a symlink to
* /lib/init/upstart-job, or NULL if path do not point to an
@@ -1461,6 +1490,7 @@ static char *is_upstart_job(const char *path)
#define FOUND_LSB_OVERRIDE 0x04
#define FOUND_LSB_UPSTART 0x08
#define FOUND_LSB_SYSTEMD 0x10
+#define FOUND_LSB_OPENRC 0x20
static int o_flags = O_RDONLY;
@@ -1820,6 +1850,11 @@ static uchar scan_script_defaults(int dfd, const char *restrict const path,
}
#endif /* WANT_SYSTEMD */
+ if (is_openrc_job(path)) {
+ ret |= FOUND_LSB_OPENRC;
+ goto out;
+ }
+
if (NULL != (upstart_job = is_upstart_job(path))) {
xreset(upstart_job);
/*
@@ -2035,7 +2070,7 @@ static void scan_script_locations(const char *const path, const char *const over
if (!lsb)
service->attr.flags |= SERV_NOTLSB;
- if ((lsb & FOUND_LSB_HEADER) == 0) {
+ if ((lsb & (FOUND_LSB_HEADER|FOUND_LSB_OPENRC)) == 0) {
if ((lsb & (FOUND_LSB_DEFAULT|FOUND_LSB_OVERRIDE)) == 0)
warn("warning: script '%s' missing LSB tags and overrides\n", d->d_name);
else
@@ -3134,7 +3169,7 @@ int main (int argc, char *argv[])
char * provides, * begin, * token;
const uchar lsb = scan_script_defaults(dfd, name, override_path, (char**)0, false, ignore);
- if ((lsb & FOUND_LSB_HEADER) == 0) {
+ if ((lsb & (FOUND_LSB_HEADER|FOUND_LSB_OPENRC)) == 0) {
if ((lsb & (FOUND_LSB_DEFAULT|FOUND_LSB_OVERRIDE)) == 0)
warn("warning: script '%s' missing LSB tags and overrides\n", name);
else
@@ -3329,7 +3364,7 @@ int main (int argc, char *argv[])
/* main scanner for LSB comment in current script */
lsb = scan_script_defaults(dfd, d->d_name, override_path, (char**)0, false, ignore);
- if ((lsb & FOUND_LSB_HEADER) == 0) {
+ if ((lsb & (FOUND_LSB_HEADER|FOUND_LSB_OPENRC)) == 0) {
if ((lsb & (FOUND_LSB_DEFAULT|FOUND_LSB_OVERRIDE)) == 0)
warn("warning: script '%s' missing LSB tags and overrides\n", d->d_name);
else
@@ -3370,7 +3405,7 @@ int main (int argc, char *argv[])
#endif /* SUSE */
#ifndef SUSE
- if (!lsb) {
+ if (!lsb || (lsb & FOUND_LSB_OPENRC)) {
script_inf.required_start = xstrdup(DEFAULT_DEPENDENCY);
script_inf.required_stop = xstrdup(DEFAULT_DEPENDENCY);
script_inf.default_start = xstrdup(DEFAULT_START_LVL);
--
2.20.1
--- End Message ---
--- Begin Message ---
Source: insserv
Source-Version: 1.23.0-1
Done: Mark Hindley <[email protected]>
We believe that the bug you reported is fixed in the latest version of
insserv, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Mark Hindley <[email protected]> (supplier of updated insserv package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Thu, 23 Sep 2021 12:57:28 +0100
Source: insserv
Architecture: source
Version: 1.23.0-1
Distribution: unstable
Urgency: medium
Maintainer: Debian sysvinit maintainers
<[email protected]>
Changed-By: Mark Hindley <[email protected]>
Closes: 868103 910797 962412
Changes:
insserv (1.23.0-1) unstable; urgency=medium
.
* New upstream version 1.23.0.
- includes support for OpenRC scripts (Closes: #962412).
* d/control:
- add myself to Uploaders.
- remove retired Uploaders (Closes: #910797)
- update to Standards Version 4.6.0 (no changes)
* d/patches:
- remove patches-from-trek-closes-971713.patch applied upstream.
- Refresh patches.
- New patch to keep /sbin/insserv and /lib/lsb/ in / despite
upstream now using PREFIX.
* Remove obsolete /etc/bash_completion.d/insserv conffile (Closes: #868103).
Checksums-Sha1:
08b83a21547bc72ca2885993da035479d9117845 2005 insserv_1.23.0-1.dsc
e6fd7fb0a609815dc975d9cd6d4849fb6efc76fb 64468 insserv_1.23.0.orig.tar.xz
12b7e892170192fb2220eb418496f267b16d07ed 47004 insserv_1.23.0-1.debian.tar.xz
498f1ac768fb488ddb4bff1723c51189837389a1 6367 insserv_1.23.0-1_amd64.buildinfo
Checksums-Sha256:
8902a1e9c78436b6b0445e2c28b83c4d65f1791ffd9240a3968e27748774871f 2005
insserv_1.23.0-1.dsc
842963425b0ded18c2fef080f272e307d34d6334f7c70c5b998345512766b0a9 64468
insserv_1.23.0.orig.tar.xz
e883f596f2bac2d9b3afa8eaec50cd64cb9862ac117914348be7a3ccc487258b 47004
insserv_1.23.0-1.debian.tar.xz
4e79c8e63bfb3cb9b14548f7baab5e2c9aa48f9b12cfe678abe486d5f6a83026 6367
insserv_1.23.0-1_amd64.buildinfo
Files:
8c44ee77be46babb1b2152cadd1891a3 2005 misc optional insserv_1.23.0-1.dsc
a492a786c53dfc75ca96a2ff53664485 64468 misc optional insserv_1.23.0.orig.tar.xz
0b1f84b08826d45c314cee039fc8f833 47004 misc optional
insserv_1.23.0-1.debian.tar.xz
45e066402dcd8b32bdf1f4cb76aa95c8 6367 misc optional
insserv_1.23.0-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEUGwVpCsK9aCoVCPu0opFvzKH1kkFAmFMujAACgkQ0opFvzKH
1kkD+hAAjKrfYPa8zAf24PHS2Dw9g9UsdUZdWEiqybW5Y7GQaLhvunFC/+w72A/c
ctMaxG/6iSET/7oZOS1z3lGIEdXzuZ4w0GLcDG8oMvS/SJ5u33ZsScF1AkShiDlV
71oekYis0TI9XaSGlkiaDFkzysWuMoXrVXu1Ua0ZhwIUNiIAs9bD/AjKzbTE+ZjH
0YmdosPoUYAezQlEjhm/wkw7A84c01KLf6MuxCIDhPtLOa7ix0FMNl6GZYgquYxq
LpFak42Brh+zV/z4JKJp8ODm7BLtAbEd0xZNO3bb1CrSyqL/Za/ruYxyXFNWfdWz
Hx8KzN5asFUlGdGX90Cnl3T0Wm5VzVxq9BUsM2grpaJpZsHvhC/eWTfXXSqWw5eQ
yOvPwO8FOKKG62CVOwD6ysAO8GaVFV0VP1ITDRu4c82ajiEFH2gJ5ggkIL+1oM0v
3UVefDZSw6JsXvnVovOwi8ssO6ud+2WLGuzB40aKB6Bgrq4FZ3eZ3dHQOWSo8yhC
2tm8go8yKyesFn22M6fn0yXkqlBkLVwGMVr8ZRMOKF2QLqH9G0Nacoz1rkkDgsIx
0cOCQlXzmnhLa5O7XfPSN8zgiIblxlgHjnEfiH+NFOjYFwaU0ENMMH5tGBJM2m/6
Gmxp5ftsIFzwOl3G9hdvKaGrt+VxMp4krRQn/FN1SrmJmnxg+D8=
=B2qE
-----END PGP SIGNATURE-----
--- End Message ---