From cd1464522ddff7002a5ca5e40a2239b1cf4efe3be73e3432e65ca9a869153e35 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Fri, 5 Jul 2013 07:29:00 +0000 Subject: [PATCH] Accepting request 182265 from home:elvigia:branches:Base:System build fails due to rpmlint bug, nothing to do with this change at all OBS-URL: https://build.opensuse.org/request/show/182265 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=413 --- ...nt_dump-don-t-segfault-if-mount-is-n.patch | 34 +++++++++ ...ups-release-agent-when-shutting-down.patch | 74 +++++++++++++++++++ ...move-ancient-fallback-code-turn-conn.patch | 53 +++++++++++++ ...message-output-at-shutdown-when-quie.patch | 69 +++++++++++++++++ systemd-mini-rpmlintrc | 2 + systemd-mini.changes | 17 +++++ systemd-mini.spec | 14 +++- systemd.changes | 17 +++++ systemd.spec | 14 +++- 9 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch create mode 100644 0004-disable-the-cgroups-release-agent-when-shutting-down.patch create mode 100644 0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch create mode 100644 0006-suppress-status-message-output-at-shutdown-when-quie.patch diff --git a/0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch b/0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch new file mode 100644 index 00000000..7db90f64 --- /dev/null +++ b/0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch @@ -0,0 +1,34 @@ +From 1e4fc9b1d8449e87474b3af8a4ddab09fab27cd5 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 4 Jul 2013 11:01:47 +0200 +Subject: [PATCH 2/6] core/mount.c:mount_dump(): don't segfault, if mount is + not mounted anymore + +Don't segfault, if m->from_proc_self_mountinfo and m->from_fragment is +false. + +https://bugzilla.redhat.com/show_bug.cgi?id=957783#c9 +--- + src/core/mount.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/core/mount.c b/src/core/mount.c +index 3cc3e65..58a3f11 100644 +--- a/src/core/mount.c ++++ b/src/core/mount.c +@@ -822,9 +822,9 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) { + prefix, mount_state_to_string(m->state), + prefix, mount_result_to_string(m->result), + prefix, m->where, +- prefix, strna(p->what), +- prefix, strna(p->fstype), +- prefix, strna(p->options), ++ prefix, p ? strna(p->what) : "n/a", ++ prefix, p ? strna(p->fstype) : "n/a", ++ prefix, p ? strna(p->options) : "n/a", + prefix, yes_no(m->from_proc_self_mountinfo), + prefix, yes_no(m->from_fragment), + prefix, m->directory_mode); +-- +1.8.1.4 + diff --git a/0004-disable-the-cgroups-release-agent-when-shutting-down.patch b/0004-disable-the-cgroups-release-agent-when-shutting-down.patch new file mode 100644 index 00000000..52f7b574 --- /dev/null +++ b/0004-disable-the-cgroups-release-agent-when-shutting-down.patch @@ -0,0 +1,74 @@ +From ad929bcc27e2c6c1aa731053e45882686e9babab Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 4 Jul 2013 20:31:18 +0200 +Subject: [PATCH 4/6] disable the cgroups release agent when shutting down + +During shutdown, when we try to clean up all remaining processes, the +kernel will fork new agents every time a cgroup runs empty. These +new processes cause delays in the final SIGTERM, SIGKILL logic. + +Apart from that, this should also avoid that the kernel-forked binaries +cause unpredictably timed access to the filesystem which we might need to +unmount. +--- + src/core/main.c | 4 ++++ + src/shared/cgroup-util.c | 15 +++++++++++++++ + src/shared/cgroup-util.h | 1 + + 3 files changed, 20 insertions(+) + +diff --git a/src/core/main.c b/src/core/main.c +index 8b8e110..ada0f9d 100644 +--- a/src/core/main.c ++++ b/src/core/main.c +@@ -1942,6 +1942,10 @@ finish: + watchdog_close(true); + } + ++ /* avoid the creation of new processes forked by the kernel; at this ++ * point, we will not listen to the signals anyway */ ++ cg_uninstall_release_agent(SYSTEMD_CGROUP_CONTROLLER); ++ + execve(SYSTEMD_SHUTDOWN_BINARY_PATH, (char **) command_line, env_block); + free(env_block); + log_error("Failed to execute shutdown binary, freezing: %m"); +diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c +index 390259e..73013d1 100644 +--- a/src/shared/cgroup-util.c ++++ b/src/shared/cgroup-util.c +@@ -790,6 +790,21 @@ int cg_install_release_agent(const char *controller, const char *agent) { + return 0; + } + ++int cg_uninstall_release_agent(const char *controller) { ++ _cleanup_free_ char *fs = NULL; ++ int r; ++ ++ r = cg_get_path(controller, NULL, "release_agent", &fs); ++ if (r < 0) ++ return r; ++ ++ r = write_string_file(fs, ""); ++ if (r < 0) ++ return r; ++ ++ return 0; ++} ++ + int cg_is_empty(const char *controller, const char *path, bool ignore_self) { + _cleanup_fclose_ FILE *f = NULL; + pid_t pid = 0, self_pid; +diff --git a/src/shared/cgroup-util.h b/src/shared/cgroup-util.h +index c781aab..0fc93c1 100644 +--- a/src/shared/cgroup-util.h ++++ b/src/shared/cgroup-util.h +@@ -89,6 +89,7 @@ int cg_set_group_access(const char *controller, const char *path, mode_t mode, u + int cg_set_task_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid); + + int cg_install_release_agent(const char *controller, const char *agent); ++int cg_uninstall_release_agent(const char *controller); + + int cg_is_empty(const char *controller, const char *path, bool ignore_self); + int cg_is_empty_by_spec(const char *spec, bool ignore_self); +-- +1.8.1.4 + diff --git a/0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch b/0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch new file mode 100644 index 00000000..2f4b7254 --- /dev/null +++ b/0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch @@ -0,0 +1,53 @@ +From c1eba3008cac9e625b8bb774e9b44ceec8465980 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 4 Jul 2013 20:54:40 +0200 +Subject: [PATCH 5/6] cgroups-agent: remove ancient fallback code; turn + connection error into warning + +During re-execution and shutdown cgroups agents might not be able +to connect to systemd's private D-Bus socket, the printed error to +the console is misleding in that case, so turn it into a warning. +--- + src/cgroups-agent/cgroups-agent.c | 19 ++++++------------- + 1 file changed, 6 insertions(+), 13 deletions(-) + +diff --git a/src/cgroups-agent/cgroups-agent.c b/src/cgroups-agent/cgroups-agent.c +index 0e3d2b7..a47949a 100644 +--- a/src/cgroups-agent/cgroups-agent.c ++++ b/src/cgroups-agent/cgroups-agent.c +@@ -48,26 +48,19 @@ int main(int argc, char *argv[]) { + * this to avoid an activation loop when we start dbus when we + * are called when the dbus service is shut down. */ + +- if (!(bus = dbus_connection_open_private("unix:path=/run/systemd/private", &error))) { +-#ifndef NOLEGACY +- dbus_error_free(&error); +- +- /* Retry with the pre v21 socket name, to ease upgrades */ +- if (!(bus = dbus_connection_open_private("unix:abstract=/org/freedesktop/systemd1/private", &error))) { +-#endif +- log_error("Failed to get D-Bus connection: %s", bus_error_message(&error)); +- goto finish; +- } +-#ifndef NOLEGACY ++ bus = dbus_connection_open_private("unix:path=/run/systemd/private", &error); ++ if (!bus) { ++ log_warning("Failed to get D-Bus connection: %s", bus_error_message(&error)); ++ goto finish; + } +-#endif + + if (bus_check_peercred(bus) < 0) { + log_error("Bus owner not root."); + goto finish; + } + +- if (!(m = dbus_message_new_signal("/org/freedesktop/systemd1/agent", "org.freedesktop.systemd1.Agent", "Released"))) { ++ m = dbus_message_new_signal("/org/freedesktop/systemd1/agent", "org.freedesktop.systemd1.Agent", "Released"); ++ if (!m) { + log_error("Could not allocate signal message."); + goto finish; + } +-- +1.8.1.4 + diff --git a/0006-suppress-status-message-output-at-shutdown-when-quie.patch b/0006-suppress-status-message-output-at-shutdown-when-quie.patch new file mode 100644 index 00000000..8fb7ba23 --- /dev/null +++ b/0006-suppress-status-message-output-at-shutdown-when-quie.patch @@ -0,0 +1,69 @@ +From ec26be514ff3c5367b21f9881369080bda54fd2d Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 5 Jul 2013 00:32:05 +0200 +Subject: [PATCH 6/6] suppress status message output at shutdown when 'quiet' + is given + +--- + src/core/main.c | 4 ++-- + src/core/shutdown.c | 15 +++++++++++++++ + 2 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/src/core/main.c b/src/core/main.c +index ada0f9d..243855f 100644 +--- a/src/core/main.c ++++ b/src/core/main.c +@@ -1942,9 +1942,9 @@ finish: + watchdog_close(true); + } + +- /* avoid the creation of new processes forked by the kernel; at this ++ /* avoid the creation of new processes forked by the kernel; at this + * point, we will not listen to the signals anyway */ +- cg_uninstall_release_agent(SYSTEMD_CGROUP_CONTROLLER); ++ cg_uninstall_release_agent(SYSTEMD_CGROUP_CONTROLLER); + + execve(SYSTEMD_SHUTDOWN_BINARY_PATH, (char **) command_line, env_block); + free(env_block); +diff --git a/src/core/shutdown.c b/src/core/shutdown.c +index 2db761d..c02a14d 100644 +--- a/src/core/shutdown.c ++++ b/src/core/shutdown.c +@@ -39,6 +39,7 @@ + + #include "missing.h" + #include "log.h" ++#include "fileio.h" + #include "umount.h" + #include "util.h" + #include "mkdir.h" +@@ -130,12 +131,26 @@ static int pivot_to_new_root(void) { + } + + int main(int argc, char *argv[]) { ++ _cleanup_free_ char *line = NULL; + int cmd, r; + unsigned retries; + bool need_umount = true, need_swapoff = true, need_loop_detach = true, need_dm_detach = true; + bool in_container, use_watchdog = false; + char *arguments[3]; + ++ /* suppress shutdown status output if 'quiet' is used */ ++ r = read_one_line_file("/proc/cmdline", &line); ++ if (r >= 0) { ++ char *w, *state; ++ size_t l; ++ ++ FOREACH_WORD_QUOTED(w, l, line, state) ++ if (streq(w, "quiet")) { ++ log_set_max_level(LOG_WARNING); ++ break; ++ } ++ } ++ + log_parse_environment(); + log_set_target(LOG_TARGET_CONSOLE); /* syslog will die if not gone yet */ + log_open(); +-- +1.8.1.4 + diff --git a/systemd-mini-rpmlintrc b/systemd-mini-rpmlintrc index 219445d9..87518f9d 100644 --- a/systemd-mini-rpmlintrc +++ b/systemd-mini-rpmlintrc @@ -16,3 +16,5 @@ addFilter(".*libgudev-.*shlib-fixed-dependency.*") addFilter(".*suse-filelist-forbidden-systemd-userdirs.*") addFilter("libudev-mini.*shlib-policy-name-error.*") addFilter("nss-myhostname.*shlib-policy-name-error.*") +addFilter("systemd-logger.*useless-provides sysvinit(syslog).*") + diff --git a/systemd-mini.changes b/systemd-mini.changes index 55edb70e..0c55f43a 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Fri Jul 5 02:17:19 UTC 2013 - crrodriguez@opensuse.org + +- 0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch + fix segfault at shutdown +- 0004-disable-the-cgroups-release-agent-when-shutting-down.patch + disable the cgroups release agent when shutting down. +- 0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch + remove ancient fallback code; turn connection error into warning +- 006-suppress-status-message-output-at-shutdown-when-quie.patch + make shutdown honour "quiet" kernel cmdline. + +------------------------------------------------------------------- +Fri Jul 5 02:09:55 UTC 2013 - crrodriguez@opensuse.org + +- fix broken symlink, service is called systemd-random-seed now. + ------------------------------------------------------------------- Thu Jul 4 10:20:23 CEST 2013 - fcrozat@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 8b0fe7bc..cecc997d 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -156,6 +156,14 @@ Patch40: sysctl-handle-boot-sysctl.conf-kernel_release.patch # PATCH-FIX-OPENSUSE ensure-shortname-is-set-as-hostname-bnc-820213.patch bnc#820213 fcrozat@suse.com -- Do not set anything beyond first dot as hostname Patch41: ensure-shortname-is-set-as-hostname-bnc-820213.patch +# PATCH-FIX-UPSTREAM 0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch crrodriguez@opensuse.org -- fix segfault at shutdown +Patch42: 0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch +# PATCH-FIX-UPSTREAM 0004-disable-the-cgroups-release-agent-when-shutting-down.patch crrodriguez@opensuse.org -- disable the cgroups release agent when shutting down +Patch43: 0004-disable-the-cgroups-release-agent-when-shutting-down.patch +# PATCH-FIX-UPSTREAM 0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch crrodriguez@opensuse.org -- remove ancient fallback code; turn connection error into warning +Patch44: 0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch +# PATCH-FIX-UPSTREAM 006-suppress-status-message-output-at-shutdown-when-quie.patch crrodriguez@opensuse.org -- make shutdown honour "quiet" +Patch45: 0006-suppress-status-message-output-at-shutdown-when-quie.patch # Upstream First - Policy: # Never add any patches to this package without the upstream commit id # in the patch. Any patches added here without a very good reason to make @@ -401,6 +409,10 @@ cp %{SOURCE7} m4/ %patch39 -p1 %patch40 -p1 %patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 +%patch45 -p1 # udev patches %patch1001 -p1 @@ -512,7 +524,7 @@ ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/startpreload.service ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/stoppreload.service ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/earlyxdm.service ln -s systemd-sysctl.service %{buildroot}/%{_prefix}/lib/systemd/system/sysctl.service -ln -s systemd-random-seed-load.service %{buildroot}/%{_prefix}/lib/systemd/system/random.service +ln -s systemd-random-seed.service %{buildroot}/%{_prefix}/lib/systemd/system/random.service # don't mount /tmp as tmpfs for now rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount diff --git a/systemd.changes b/systemd.changes index 55edb70e..0c55f43a 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Fri Jul 5 02:17:19 UTC 2013 - crrodriguez@opensuse.org + +- 0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch + fix segfault at shutdown +- 0004-disable-the-cgroups-release-agent-when-shutting-down.patch + disable the cgroups release agent when shutting down. +- 0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch + remove ancient fallback code; turn connection error into warning +- 006-suppress-status-message-output-at-shutdown-when-quie.patch + make shutdown honour "quiet" kernel cmdline. + +------------------------------------------------------------------- +Fri Jul 5 02:09:55 UTC 2013 - crrodriguez@opensuse.org + +- fix broken symlink, service is called systemd-random-seed now. + ------------------------------------------------------------------- Thu Jul 4 10:20:23 CEST 2013 - fcrozat@suse.com diff --git a/systemd.spec b/systemd.spec index f6ef6e8e..3c347842 100644 --- a/systemd.spec +++ b/systemd.spec @@ -151,6 +151,14 @@ Patch40: sysctl-handle-boot-sysctl.conf-kernel_release.patch # PATCH-FIX-OPENSUSE ensure-shortname-is-set-as-hostname-bnc-820213.patch bnc#820213 fcrozat@suse.com -- Do not set anything beyond first dot as hostname Patch41: ensure-shortname-is-set-as-hostname-bnc-820213.patch +# PATCH-FIX-UPSTREAM 0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch crrodriguez@opensuse.org -- fix segfault at shutdown +Patch42: 0002-core-mount.c-mount_dump-don-t-segfault-if-mount-is-n.patch +# PATCH-FIX-UPSTREAM 0004-disable-the-cgroups-release-agent-when-shutting-down.patch crrodriguez@opensuse.org -- disable the cgroups release agent when shutting down +Patch43: 0004-disable-the-cgroups-release-agent-when-shutting-down.patch +# PATCH-FIX-UPSTREAM 0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch crrodriguez@opensuse.org -- remove ancient fallback code; turn connection error into warning +Patch44: 0005-cgroups-agent-remove-ancient-fallback-code-turn-conn.patch +# PATCH-FIX-UPSTREAM 006-suppress-status-message-output-at-shutdown-when-quie.patch crrodriguez@opensuse.org -- make shutdown honour "quiet" +Patch45: 0006-suppress-status-message-output-at-shutdown-when-quie.patch # Upstream First - Policy: # Never add any patches to this package without the upstream commit id # in the patch. Any patches added here without a very good reason to make @@ -396,6 +404,10 @@ cp %{SOURCE7} m4/ %patch39 -p1 %patch40 -p1 %patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 +%patch45 -p1 # udev patches %patch1001 -p1 @@ -507,7 +519,7 @@ ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/startpreload.service ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/stoppreload.service ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/earlyxdm.service ln -s systemd-sysctl.service %{buildroot}/%{_prefix}/lib/systemd/system/sysctl.service -ln -s systemd-random-seed-load.service %{buildroot}/%{_prefix}/lib/systemd/system/random.service +ln -s systemd-random-seed.service %{buildroot}/%{_prefix}/lib/systemd/system/random.service # don't mount /tmp as tmpfs for now rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount