From 9fbd97d876404a68cd11f4f942792e6ef9c23ba623582ba4c5a02adef3dbd428 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Fri, 9 Sep 2011 16:22:08 +0000 Subject: [PATCH] Accepting request 81717 from home:fcrozat:systemd - Add revert_insserv_conf_parsing.patch and systemd-insserv_conf: remove insserv.conf parsing from systemd and use generator instead. - put back default.target creation at package install and remove inittab generator, Yast2 is now able to create it. - Add revert_insserv_conf_parsing.patch and systemd-insserv_conf: remove insserv.conf parsing from systemd and use generator instead. - put back default.target creation at package install and remove inittab generator, Yast2 is now able to create it. OBS-URL: https://build.opensuse.org/request/show/81717 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=189 --- revert_insserv_conf_parsing.patch | 103 ++++++++++++++++++++++++++++++ systemd-gtk.changes | 9 +++ systemd-inittab | 8 --- systemd-insserv_conf | 34 ++++++++++ systemd.changes | 9 +++ systemd.spec | 13 +++- 6 files changed, 165 insertions(+), 11 deletions(-) create mode 100644 revert_insserv_conf_parsing.patch delete mode 100644 systemd-inittab create mode 100644 systemd-insserv_conf diff --git a/revert_insserv_conf_parsing.patch b/revert_insserv_conf_parsing.patch new file mode 100644 index 00000000..3279bd1d --- /dev/null +++ b/revert_insserv_conf_parsing.patch @@ -0,0 +1,103 @@ +From b0ff66c6e92ca9d9458f3236ee37397635bb0f0e Mon Sep 17 00:00:00 2001 +From: Frederic Crozat +Date: Fri, 9 Sep 2011 11:19:26 +0200 +Subject: [PATCH] Revert "service: parse insserv.conf and plugs its system facilities into systemd." + +Let's use a generator instead + +This reverts commit de3910a324aefcb15c26be27033d6917494e5946. +--- + src/service.c | 70 --------------------------------------------------------- + 1 files changed, 0 insertions(+), 70 deletions(-) + +diff --git a/src/service.c b/src/service.c +index abd8f36..37cb0bc 100644 +--- a/src/service.c ++++ b/src/service.c +@@ -2969,72 +2969,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) { + } + + #ifdef HAVE_SYSV_COMPAT +- +-#ifdef TARGET_SUSE +-static void sysv_facility_in_insserv_conf(Manager *mgr) { +- FILE *f=NULL; +- int r; +- +- if (!(f = fopen("/etc/insserv.conf", "re"))) { +- r = errno == ENOENT ? 0 : -errno; +- goto finish; +- } +- +- while (!feof(f)) { +- char l[LINE_MAX], *t; +- char **parsed = NULL; +- +- if (!fgets(l, sizeof(l), f)) { +- if (feof(f)) +- break; +- +- r = -errno; +- log_error("Failed to read configuration file '/etc/insserv.conf': %s", strerror(-r)); +- goto finish; +- } +- +- t = strstrip(l); +- if (*t != '$' && *t != '<') +- continue; +- +- parsed = strv_split(t,WHITESPACE); +- /* we ignore , not used, equivalent to X-Interactive */ +- if (parsed && !startswith_no_case (parsed[0], "")) { +- char *facility; +- Unit *u; +- if (sysv_translate_facility(parsed[0], NULL, &facility) < 0) +- continue; +- if ((u = manager_get_unit(mgr, facility)) && (u->meta.type == UNIT_TARGET)) { +- UnitDependency e; +- char *dep = NULL, *name, **j; +- +- STRV_FOREACH (j, parsed+1) { +- if (*j[0]=='+') { +- e = UNIT_WANTS; +- name = *j+1; +- } +- else { +- e = UNIT_REQUIRES; +- name = *j; +- } +- if (sysv_translate_facility(name, NULL, &dep) < 0) +- continue; +- +- r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true); +- free(dep); +- } +- } +- free(facility); +- } +- strv_free(parsed); +- } +-finish: +- if (f) +- fclose(f); +- +-} +-#endif +- + static int service_enumerate(Manager *m) { + char **p; + unsigned i; +@@ -3183,10 +3117,6 @@ static int service_enumerate(Manager *m) { + + r = 0; + +-#ifdef TARGET_SUSE +- sysv_facility_in_insserv_conf (m); +-#endif +- + finish: + free(path); + free(fpath); +-- +1.7.3.4 + diff --git a/systemd-gtk.changes b/systemd-gtk.changes index 59ee88b4..079c1cca 100644 --- a/systemd-gtk.changes +++ b/systemd-gtk.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Sep 9 09:28:54 UTC 2011 - fcrozat@suse.com + +- Add revert_insserv_conf_parsing.patch and systemd-insserv_conf: + remove insserv.conf parsing from systemd and use generator + instead. +- put back default.target creation at package install and remove + inittab generator, Yast2 is now able to create it. + ------------------------------------------------------------------- Thu Sep 1 09:25:40 UTC 2011 - fcrozat@novell.com diff --git a/systemd-inittab b/systemd-inittab deleted file mode 100644 index 7fc3de96..00000000 --- a/systemd-inittab +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Try to read default runlevel from the old inittab if it exists -runlevel=$(/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null) -if [ -n "$runlevel" -a -e /lib/systemd/system/runlevel$runlevel.target ] ; then - /bin/ln -sf /lib/systemd/system/runlevel$runlevel.target $1/default.target 2>&1 && exit 0 -fi -#failsafe -/bin/ln -sf /lib/systemd/system/graphical.target $1/default.target diff --git a/systemd-insserv_conf b/systemd-insserv_conf new file mode 100644 index 00000000..f77de73a --- /dev/null +++ b/systemd-insserv_conf @@ -0,0 +1,34 @@ +#!/bin/bash + +[ -r /etc/insserv.conf ] || exit 0 + +declare -A facilities +facilities["local_fs"]="local-fs.target" +facilities["localfs"]="local-fs.target" +facilities["named"]="nss-lookup.target" +facilities["network"]="network.target" +# done in systemd code +#facilities["portmap"]="rpcbind.target" +facilities["remote_fs"]="remote-fs.target" +facilities["syslog"]="syslog.target" +facilities["time"]="time-sync.target" + +while read line ; do + case "$line" in + \#*|"" ) continue;; + \<* ) continue;; + \$*) t=${line%% *} + target=${facilities[${t:1}]} + [ -z $target ] && continue + mkdir -p $1/$target.{requires,wants} + for dep in ${line##* } ; do + stripped_dep=${dep/boot./} + case "$stripped_dep" in + +*) ln -s -f /lib/systemd/system/${facilities[${stripped_dep:2}]:-${stripped_dep:1}.service} $1/$target.wants/ ;; + *) ln -s -f /lib/systemd/system/${facilities[${stripped_dep:1}]:-${stripped_dep}.service} $1/$target.wants/ ;; + esac + done + ;; + esac +done < /etc/insserv.conf + diff --git a/systemd.changes b/systemd.changes index 59ee88b4..079c1cca 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Sep 9 09:28:54 UTC 2011 - fcrozat@suse.com + +- Add revert_insserv_conf_parsing.patch and systemd-insserv_conf: + remove insserv.conf parsing from systemd and use generator + instead. +- put back default.target creation at package install and remove + inittab generator, Yast2 is now able to create it. + ------------------------------------------------------------------- Thu Sep 1 09:25:40 UTC 2011 - fcrozat@novell.com diff --git a/systemd.spec b/systemd.spec index 665fe7ee..f4eddd49 100644 --- a/systemd.spec +++ b/systemd.spec @@ -51,12 +51,13 @@ Source1: systemd-rpmlintrc Source2: localfs.service Source3: systemd-sysv-convert Source4: macros.systemd -Source5: systemd-inittab +Source5: systemd-insserv_conf Patch1: 0001-Add-bootsplash-handling-for-password-dialogs.patch # handle SUSE specific kbd settings Patch6: 0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch # don't start getty on tty1 until all password request are done Patch8: tty1.patch +Patch10: revert_insserv_conf_parsing.patch # Upstream First - Policy: # Never add any patches to this package without the upstream commit id @@ -100,7 +101,6 @@ Drop-in replacement of System V init tools. %package plymouth - License: GPLv2+ Group: System/Base Summary: Plymouth support for systemd @@ -117,6 +117,7 @@ Plymouth integration for systemd %patch6 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 %build autoreconf -fiv @@ -149,7 +150,6 @@ ln -s ../bin/systemctl %{buildroot}/sbin/telinit ln -s ../bin/systemctl %{buildroot}/sbin/runlevel rm -rf %{buildroot}/etc/systemd/system/*.target.wants rm -f %{buildroot}/etc/systemd/system/default.target -rm -f %{buildroot}/lib/systemd/system/default.target %if !%{build_plymouth} rm -f %{buildroot}/lib/systemd/system/plymouth-*.service rm -f %{buildroot}/lib/systemd/system/*.wants/plymouth-*.service @@ -186,6 +186,13 @@ ln -s systemd-random-seed-load.service %{buildroot}/lib/systemd/system/random.se /bin/systemd-machine-id-setup >/dev/null 2>&1 || : /bin/systemctl daemon-reexec >/dev/null 2>&1 || : +# Try to read default runlevel from the old inittab if it exists +if [ ! -e /etc/systemd/system/default.target ]; then + runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null) + if [ -n "$runlevel" ] ; then + /bin/ln -sf /lib/systemd/system/runlevel$runlevel.target /etc/systemd/system/default.target 2>&1 || : + fi +fi # Create default config in /etc at first install. # Later package updates should not overwrite these settings. if [ "$1" -eq 1 ]; then