SHA256
1
0
forked from pool/systemd

Accepting request 705897 from Base:System

OBS-URL: https://build.opensuse.org/request/show/705897
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=296
This commit is contained in:
Dominique Leuenberger 2019-06-02 13:15:04 +00:00 committed by Git OBS Bridge
parent bfe5264cbd
commit 6ab432dbe1
9 changed files with 471 additions and 58 deletions

View File

@ -0,0 +1,365 @@
From e143d8271cd8d8dd862a627754d3daa2d6f9cd48 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Mon, 27 May 2019 10:54:26 +0200
Subject: [PATCH] Revert "insserv.conf generator"
This reverts commit dbb7a2e71bec6f6400f2b67cc409b22915fe8c72.
The only (system) packages which were still relying on the insserv-generator
have been fixed, see bsc#1052837 for the details.
[fbui: fixes bsc#1052837]
---
meson.build | 8 -
src/insserv-generator/insserv-generator.c | 320 ----------------------
2 files changed, 328 deletions(-)
delete mode 100644 src/insserv-generator/insserv-generator.c
diff --git a/meson.build b/meson.build
index 54664661b5..4377fe8419 100644
--- a/meson.build
+++ b/meson.build
@@ -2083,14 +2083,6 @@ if conf.get('HAVE_SYSV_COMPAT') == 1
install_rpath : rootlibexecdir,
install : true,
install_dir : systemgeneratordir)
-
- executable('systemd-insserv-generator',
- 'src/insserv-generator/insserv-generator.c',
- include_directories : includes,
- link_with : [libshared],
- install_rpath : rootlibexecdir,
- install : true,
- install_dir : systemgeneratordir)
endif
if conf.get('ENABLE_HOSTNAMED') == 1
diff --git a/src/insserv-generator/insserv-generator.c b/src/insserv-generator/insserv-generator.c
deleted file mode 100644
index 23b5a8255a..0000000000
--- a/src/insserv-generator/insserv-generator.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
- This file is part of systemd.
-
- Copyright 2012 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
- ***/
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#include "alloc-util.h"
-#include "mkdir.h"
-#include "log.h"
-#include "fileio.h"
-#include "unit-name.h"
-#include "special.h"
-#include "path-util.h"
-#include "util.h"
-#include "fd-util.h"
-#include "string-util.h"
-#include "strv.h"
-
-static const char *arg_dest = "/tmp";
-
-static char *sysv_translate_name(const char *name) {
- char *r;
-
- r = new(char, strlen(name) + sizeof(".service"));
- if (!r)
- return NULL;
-
- if (endswith(name, ".sh"))
- /* Drop .sh suffix */
- strcpy(stpcpy(r, name) - 3, ".service");
- if (startswith(name, "boot."))
- /* Drop SuSE-style boot. prefix */
- strcpy(stpcpy(r, name + 5), ".service");
- else
- /* Normal init script name */
- strcpy(stpcpy(r, name), ".service");
-
- return r;
-}
-
-static int sysv_translate_facility(const char *name, const char *filename, char **_r) {
-
- /* We silently ignore the $ prefix here. According to the LSB
- * spec it simply indicates whether something is a
- * standardized name or a distribution-specific one. Since we
- * just follow what already exists and do not introduce new
- * uses or names we don't care who introduced a new name. */
-
- static const char * const table[] = {
- /* LSB defined facilities */
- "local_fs", NULL,
- "network", SPECIAL_NETWORK_ONLINE_TARGET,
- "named", SPECIAL_NSS_LOOKUP_TARGET,
- "portmap", SPECIAL_RPCBIND_TARGET,
- "remote_fs", SPECIAL_REMOTE_FS_TARGET,
- "syslog", NULL,
- "time", SPECIAL_TIME_SYNC_TARGET,
- };
-
- unsigned i;
- int e;
- char *r;
- const char *n;
-
- assert(name);
- assert(_r);
-
- n = *name == '$' ? name + 1 : name;
-
- for (i = 0; i < ELEMENTSOF(table); i += 2) {
-
- if (!streq(table[i], n))
- continue;
-
- if (!table[i+1])
- return 0;
-
- r = strdup(table[i+1]);
- if (!r)
- return log_oom();
-
- goto finish;
- }
-
- /* If we don't know this name, fallback heuristics to figure
- * out whether something is a target or a service alias. */
-
- if (*name == '$') {
- if (!unit_prefix_is_valid(n))
- return -EINVAL;
-
- /* Facilities starting with $ are most likely targets */
- e = unit_name_build(n, NULL, ".target", &r);
- if (e < 0)
- return log_error_errno(e, "Failed to generate unit name: %m");
-
- } else if (filename && streq(name, filename))
- /* Names equaling the file name of the services are redundant */
- return 0;
- else
- /* Everything else we assume to be normal service names */
- r = sysv_translate_name(n);
-
- if (!r)
- return -ENOMEM;
-
-finish:
- *_r = r;
-
- return 1;
-}
-
-
-
-static int parse_insserv_conf(const char* filename) {
- _cleanup_fclose_ FILE *f = NULL;
- int r;
-
- if (!(f = fopen(filename, "re"))) {
- log_debug("Failed to open file %s", filename);
- r = errno == ENOENT ? 0 : -errno;
- return r;
- }
-
- while (!feof(f)) {
- char l[LINE_MAX], *t;
- _cleanup_strv_free_ char **parsed = NULL;
-
- if (!fgets(l, sizeof(l), f)) {
- if (feof(f))
- break;
-
- r = -errno;
- log_error("Failed to read configuration file '%s': %s", filename, strerror(-r));
- return -r;
- }
-
- t = strstrip(l);
- if (*t != '$' && *t != '<')
- continue;
-
- parsed = strv_split(t,WHITESPACE);
- /* we ignore <interactive>, not used, equivalent to X-Interactive */
- if (parsed && !startswith_no_case (parsed[0], "<interactive>")) {
- _cleanup_free_ char *facility = NULL;
- if (sysv_translate_facility(parsed[0], NULL, &facility) < 0 || !facility)
- continue;
- if (streq(facility, SPECIAL_REMOTE_FS_TARGET)) {
- _cleanup_free_ char *unit = NULL;
- /* insert also a Wants dependency from remote-fs-pre on remote-fs */
- unit = strjoin(arg_dest, "/remote-fs.target.d/50-",basename(filename),".conf", NULL);
- if (!unit)
- return log_oom();
-
- mkdir_parents_label(unit, 0755);
-
- r = write_string_file(unit,
- "# Automatically generated by systemd-insserv-generator\n\n"
- "[Unit]\n"
- "Wants=remote-fs-pre.target\n", WRITE_STRING_FILE_CREATE);
- if (r)
- return r;
- free (facility);
- facility=strdup(SPECIAL_REMOTE_FS_PRE_TARGET);
- }
- if (facility && endswith(facility, ".target")) {
- char *name, **j;
- FILE *file = NULL;
-
- STRV_FOREACH (j, parsed+1) {
- _cleanup_free_ char *unit = NULL;
- _cleanup_free_ char *dep = NULL;
-
- if (*j[0] == '+')
- name = *j+1;
- else
- name = *j;
- if (streq(name, "boot.localfs") ||
- streq(name, "boot.crypto"))
- continue;
- if ((sysv_translate_facility(name, NULL, &dep) < 0) || !dep)
- continue;
-
- unit = strjoin(arg_dest, "/", dep, ".d/50-",basename(filename),"-",parsed[0],".conf", NULL);
- if (!unit)
- return log_oom();
-
- mkdir_parents_label(unit, 0755);
-
- file = fopen(unit, "wxe");
- if (!file) {
- if (errno == EEXIST)
- log_error("Failed to create drop-in file %s", unit);
- else
- log_error("Failed to create drop-in file %s: %m", unit);
- return -errno;
- }
-
- fprintf(file,
- "# Automatically generated by systemd-insserv-generator\n\n"
- "[Unit]\n"
- "Wants=%s\n"
- "Before=%s\n",
- facility, facility);
-
- fflush(file);
- if (ferror(file)) {
- log_error("Failed to write unit file %s: %m", unit);
- return -errno;
- }
- fclose(file);
-
- if (*j[0] != '+') {
- free (unit);
- unit = strjoin(arg_dest, "/", facility, ".d/50-hard-dependency-",basename(filename),"-",parsed[0],".conf", NULL);
- if (!unit)
- return log_oom();
-
- mkdir_parents_label(unit, 0755);
-
- file = fopen(unit, "wxe");
- if (!file) {
- if (errno == EEXIST)
- log_error("Failed to create drop-in file %s, as it already exists", unit);
- else
- log_error("Failed to create drop-in file %s: %m", unit);
- return -errno;
- }
-
-
- fprintf(file,
- "# Automatically generated by systemd-insserv-generator\n\n"
- "[Unit]\n"
- "SourcePath=%s\n"
- "Requires=%s\n",
- filename, dep);
- fflush(file);
- if (ferror(file)) {
- log_error("Failed to write unit file %s: %m", unit);
- return -errno;
- }
- fclose(file);
- }
- }
- }
- }
- }
- return r;
-}
-
-static int parse_insserv(void) {
- DIR *d = NULL;
- struct dirent *de;
- int r = 0;
-
- if (!(d = opendir("/etc/insserv.conf.d/"))) {
- if (errno != ENOENT) {
- log_debug("opendir() failed on /etc/insserv.conf.d/ %s", strerror(errno));
- }
- } else {
-
- while ((de = readdir(d))) {
- char *path = NULL;
- if (hidden_or_backup_file(de->d_name))
- continue;
-
- path = strjoin("/etc/insserv.conf.d/", de->d_name, NULL);
- parse_insserv_conf(path);
- free(path);
- }
- closedir (d);
- }
-
- r = parse_insserv_conf("/etc/insserv.conf");
-
- return r;
-}
-
-int main(int argc, char *argv[]) {
- int r = 0;
-
- if (argc > 1 && argc != 4) {
- log_error("This program takes three or no arguments.");
- return EXIT_FAILURE;
- }
-
- if (argc > 1)
- arg_dest = argv[1];
-
- log_set_prohibit_ipc(true);
- log_set_target(LOG_TARGET_AUTO);
- log_parse_environment();
- log_open();
-
- umask(0022);
-
- r = parse_insserv();
-
- return (r < 0) ? EXIT_FAILURE : EXIT_SUCCESS;
-}
--
2.21.0

View File

@ -0,0 +1,31 @@
From 5e397db506aa75e50387bdcb6bfd3d4fa7ac92e7 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Mon, 27 May 2019 14:50:36 +0200
Subject: [PATCH] rc-local-generator: deprecate halt.local support
Its support will be dropped after systemd v242, see [1]. So let's give users of
this script a chance to replace it nicely.
[1] https://github.com/systemd/systemd/pull/12571
---
src/rc-local-generator/rc-local-generator.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c
index 7a3948e92d..5699c4f876 100644
--- a/src/rc-local-generator/rc-local-generator.c
+++ b/src/rc-local-generator/rc-local-generator.c
@@ -68,6 +68,10 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
if (check_executable(RC_LOCAL_SCRIPT_PATH_STOP) >= 0) {
log_debug("Automatically adding halt-local.service.");
+ log_warning("Support for %s will be removed soon. "
+ "Please see systemd-shutdown(8) man page for a similar but better alternative.",
+ RC_LOCAL_SCRIPT_PATH_STOP);
+
k = add_symlink("halt-local.service", "final.target");
}
--
2.21.0

View File

@ -1,51 +0,0 @@
diff --git a/src/login/org.freedesktop.login1.policy b/src/login/org.freedesktop.login1.policy
index 6dc79aa32a..398fb7bc21 100644
--- a/src/login/org.freedesktop.login1.policy
+++ b/src/login/org.freedesktop.login1.policy
@@ -337,17 +337,6 @@
</defaults>
</action>
- <action id="org.freedesktop.login1.set-reboot-parameter">
- <description gettext-domain="systemd">Set the reboot "reason" in the kernel</description>
- <message gettext-domain="systemd">Authentication is required to set the reboot "reason" in the kernel.</message>
- <defaults>
- <allow_any>auth_admin_keep</allow_any>
- <allow_inactive>auth_admin_keep</allow_inactive>
- <allow_active>yes</allow_active>
- </defaults>
- <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.reboot</annotate>
- </action>
-
<action id="org.freedesktop.login1.set-reboot-to-firmware-setup">
<description gettext-domain="systemd">Indicate to the firmware to boot to setup interface</description>
<message gettext-domain="systemd">Authentication is required to indicate to the firmware to boot to setup interface.</message>
@@ -359,28 +348,6 @@
<annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.reboot</annotate>
</action>
- <action id="org.freedesktop.login1.set-reboot-to-boot-loader-menu">
- <description gettext-domain="systemd">Indicate to the boot loader to boot to the boot loader menu</description>
- <message gettext-domain="systemd">Authentication is required to indicate to the boot loader to boot to the boot loader menu.</message>
- <defaults>
- <allow_any>auth_admin_keep</allow_any>
- <allow_inactive>auth_admin_keep</allow_inactive>
- <allow_active>yes</allow_active>
- </defaults>
- <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.reboot</annotate>
- </action>
-
- <action id="org.freedesktop.login1.set-reboot-to-boot-loader-entry">
- <description gettext-domain="systemd">Indicate to the boot loader to boot a specific entry</description>
- <message gettext-domain="systemd">Authentication is required to indicate to the boot loader to boot into a specific boot loader entry.</message>
- <defaults>
- <allow_any>auth_admin_keep</allow_any>
- <allow_inactive>auth_admin_keep</allow_inactive>
- <allow_active>yes</allow_active>
- </defaults>
- <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.reboot</annotate>
- </action>
-
<action id="org.freedesktop.login1.set-wall-message">
<description gettext-domain="systemd">Set a wall message</description>
<message gettext-domain="systemd">Authentication is required to set a wall message</message>

View File

@ -1,3 +1,36 @@
-------------------------------------------------------------------
Tue May 28 11:53:30 UTC 2019 - Franck Bui <fbui@suse.com>
- Import commit eaa7b8b148927d471609de75e542dffcc1b36df4
7e58b89136 udevd: change the default value of udev.children-max (again) (bsc#1107617)
-------------------------------------------------------------------
Tue May 28 09:51:30 UTC 2019 - Franck Bui <fbui@suse.com>
- Add 0001-rc-local-generator-deprecate-halt.local-support.patch
/etc/init.d/halt.local support will removed from the next systemd
version (v243) so for now on warn (hopefully the few) users who rely
on this script so they have a chance to switch to systemd-shutdown
interface.
-------------------------------------------------------------------
Mon May 27 09:33:45 UTC 2019 - Franck Bui <fbui@suse.com>
- Add 0001-Revert-insserv.conf-generator.patch (bsc#1052837)
All remaining packages have been fixed so they don't rely on the
insser-generator to generate proper deps. So let's drop it as all
services should carry the proper dependencies itself.
-------------------------------------------------------------------
Mon May 27 09:30:05 UTC 2019 - Franck Bui <fbui@suse.com>
- Drop debug-only-remove-new-policies.patch
The new DBUS methods have been reviewed by the security team.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue May 14 14:27:12 UTC 2019 - Franck Bui <fbui@suse.com> Tue May 14 14:27:12 UTC 2019 - Franck Bui <fbui@suse.com>

View File

@ -26,7 +26,7 @@
##### WARNING: please do not edit this auto generated spec file. Use the systemd.spec! ##### ##### WARNING: please do not edit this auto generated spec file. Use the systemd.spec! #####
%define mini -mini %define mini -mini
%define min_kernel_version 4.5 %define min_kernel_version 4.5
%define suse_version +suse.75.g9984a86d0d %define suse_version +suse.77.geaa7b8b148
%bcond_with gnuefi %bcond_with gnuefi
%if 0%{?bootstrap} %if 0%{?bootstrap}
@ -167,7 +167,8 @@ Source200: scripts-udev-convert-lib-udev-path.sh
# merged by upstream. # merged by upstream.
Patch1: 0001-resolved-create-etc-resolv.conf-symlink-at-runtime.patch Patch1: 0001-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
Patch2: 0001-logind-keep-backward-compatibility-with-UserTasksMax.patch Patch2: 0001-logind-keep-backward-compatibility-with-UserTasksMax.patch
Patch3: debug-only-remove-new-policies.patch Patch3: 0001-Revert-insserv.conf-generator.patch
Patch4: 0001-rc-local-generator-deprecate-halt.local-support.patch
%description %description
Systemd is a system and service manager, compatible with SysV and LSB Systemd is a system and service manager, compatible with SysV and LSB

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d5ad0c9c95ffa3b089676482ccdf91c72d6e2a01f4f97eece0264a737afc9af5
size 5323056

BIN
systemd-v242+suse.77.geaa7b8b148.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,36 @@
-------------------------------------------------------------------
Tue May 28 11:53:30 UTC 2019 - Franck Bui <fbui@suse.com>
- Import commit eaa7b8b148927d471609de75e542dffcc1b36df4
7e58b89136 udevd: change the default value of udev.children-max (again) (bsc#1107617)
-------------------------------------------------------------------
Tue May 28 09:51:30 UTC 2019 - Franck Bui <fbui@suse.com>
- Add 0001-rc-local-generator-deprecate-halt.local-support.patch
/etc/init.d/halt.local support will removed from the next systemd
version (v243) so for now on warn (hopefully the few) users who rely
on this script so they have a chance to switch to systemd-shutdown
interface.
-------------------------------------------------------------------
Mon May 27 09:33:45 UTC 2019 - Franck Bui <fbui@suse.com>
- Add 0001-Revert-insserv.conf-generator.patch (bsc#1052837)
All remaining packages have been fixed so they don't rely on the
insser-generator to generate proper deps. So let's drop it as all
services should carry the proper dependencies itself.
-------------------------------------------------------------------
Mon May 27 09:30:05 UTC 2019 - Franck Bui <fbui@suse.com>
- Drop debug-only-remove-new-policies.patch
The new DBUS methods have been reviewed by the security team.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue May 14 14:27:12 UTC 2019 - Franck Bui <fbui@suse.com> Tue May 14 14:27:12 UTC 2019 - Franck Bui <fbui@suse.com>

View File

@ -24,7 +24,7 @@
%define bootstrap 0 %define bootstrap 0
%define mini %nil %define mini %nil
%define min_kernel_version 4.5 %define min_kernel_version 4.5
%define suse_version +suse.75.g9984a86d0d %define suse_version +suse.77.geaa7b8b148
%bcond_with gnuefi %bcond_with gnuefi
%if 0%{?bootstrap} %if 0%{?bootstrap}
@ -165,7 +165,8 @@ Source200: scripts-udev-convert-lib-udev-path.sh
# merged by upstream. # merged by upstream.
Patch1: 0001-resolved-create-etc-resolv.conf-symlink-at-runtime.patch Patch1: 0001-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
Patch2: 0001-logind-keep-backward-compatibility-with-UserTasksMax.patch Patch2: 0001-logind-keep-backward-compatibility-with-UserTasksMax.patch
Patch3: debug-only-remove-new-policies.patch Patch3: 0001-Revert-insserv.conf-generator.patch
Patch4: 0001-rc-local-generator-deprecate-halt.local-support.patch
%description %description
Systemd is a system and service manager, compatible with SysV and LSB Systemd is a system and service manager, compatible with SysV and LSB