From 5ad6dc99d465f47213264ebcf3ee485beb188763354bb8f9ef37d6a3e491b5a5 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Tue, 24 Sep 2013 07:59:24 +0000 Subject: [PATCH] Accepting request 200219 from home:arvidjaar:bnc:841544 Resynced to Base:System to fix merge conflicts - Fix-timeout-when-stopping-Type-notify-service.patch Make sure MAINPID is watched when it becomes known (bnc#841544) OBS-URL: https://build.opensuse.org/request/show/200219 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=443 --- 0007-libudev-fix-move_later-comparison.patch | 13 ++- ...ut-when-stopping-Type-notify-service.patch | 84 +++++++++++++++++++ systemd.changes | 6 ++ systemd.spec | 3 + 4 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 Fix-timeout-when-stopping-Type-notify-service.patch diff --git a/0007-libudev-fix-move_later-comparison.patch b/0007-libudev-fix-move_later-comparison.patch index e1e4d002..aa792e0c 100644 --- a/0007-libudev-fix-move_later-comparison.patch +++ b/0007-libudev-fix-move_later-comparison.patch @@ -9,11 +9,11 @@ value only if expression !move_later is true. src/libudev/libudev-enumerate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c -index bc1e37d..8146f27 100644 ---- a/src/libudev/libudev-enumerate.c -+++ b/src/libudev/libudev-enumerate.c -@@ -300,7 +300,7 @@ _public_ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enume +Index: systemd-207/src/libudev/libudev-enumerate.c +=================================================================== +--- systemd-207.orig/src/libudev/libudev-enumerate.c ++++ systemd-207/src/libudev/libudev-enumerate.c +@@ -300,7 +300,7 @@ _public_ struct udev_list_entry *udev_en /* skip to be delayed devices, and move the to * the point where the prefix changes. We can * only move one item at a time. */ @@ -22,6 +22,3 @@ index bc1e37d..8146f27 100644 move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath); if (move_later_prefix > 0) { --- -1.8.1.4 - diff --git a/Fix-timeout-when-stopping-Type-notify-service.patch b/Fix-timeout-when-stopping-Type-notify-service.patch new file mode 100644 index 00000000..3d03d380 --- /dev/null +++ b/Fix-timeout-when-stopping-Type-notify-service.patch @@ -0,0 +1,84 @@ +Delivered-To: arvidjaar@gmail.com +Received: by 10.216.219.133 with SMTP id m5csp322525wep; + Fri, 20 Sep 2013 13:55:10 -0700 (PDT) +X-Received: by 10.66.171.204 with SMTP id aw12mr10856961pac.7.1379710509504; + Fri, 20 Sep 2013 13:55:09 -0700 (PDT) +Return-Path: +Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) + by mx.google.com with ESMTP id mj9si13683512pab.248.1969.12.31.16.00.00; + Fri, 20 Sep 2013 13:55:09 -0700 (PDT) +Received-SPF: pass (google.com: domain of systemd-devel-bounces+arvidjaar=gmail.com@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; +Authentication-Results: mx.google.com; + spf=pass (google.com: domain of systemd-devel-bounces+arvidjaar=gmail.com@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mail=systemd-devel-bounces+arvidjaar=gmail.com@lists.freedesktop.org +Received: from gabe.freedesktop.org (localhost [127.0.0.1]) + by gabe.freedesktop.org (Postfix) with ESMTP id D7BD0E5F24 + for ; Fri, 20 Sep 2013 13:55:06 -0700 (PDT) +X-Original-To: systemd-devel@lists.freedesktop.org +Delivered-To: systemd-devel@lists.freedesktop.org +Received: from mail.jjacky.com (unknown [23.29.69.116]) + by gabe.freedesktop.org (Postfix) with ESMTP id E3B2FE5DF6 + for ; + Fri, 20 Sep 2013 13:54:34 -0700 (PDT) +Received: from arch.local (arch.tks [10.42.0.6]) + by mail.jjacky.com (Postfix) with ESMTP id 2F68E18084A; + Fri, 20 Sep 2013 22:54:11 +0200 (CEST) +From: Olivier Brunel +To: systemd-devel@lists.freedesktop.org +Date: Fri, 20 Sep 2013 22:53:52 +0200 +Message-Id: <1379710432-4195-1-git-send-email-jjk@jjacky.com> +X-Mailer: git-send-email 1.8.4 +Subject: [systemd-devel] [PATCH] Fix timeout when stopping Type=notify + service +X-BeenThere: systemd-devel@lists.freedesktop.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: systemd Development Mailing List +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Sender: systemd-devel-bounces+arvidjaar=gmail.com@lists.freedesktop.org +Errors-To: systemd-devel-bounces+arvidjaar=gmail.com@lists.freedesktop.org + +Since 41efeaec a call to service_unwatch_main_pid() is done from +service_set_main_pid(), which is called upon receiving message MAINPID= + +This had the side effect of not watching pid anymore, and would result in a +useless timeout when stopping the service, as the unit wouldn't be identified +from the pid, so not marked stopped which would result in systemd thinking this +was a timeout. +--- +I'm not exactly familiar with systemd's internals, so this might not be the +correct way to fix this, please correct me if it isn't. + + src/core/service.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +Index: systemd-207/src/core/service.c +=================================================================== +--- systemd-207.orig/src/core/service.c ++++ systemd-207/src/core/service.c +@@ -3461,9 +3461,17 @@ static void service_notify_message(Unit + log_warning_unit(u->id, + "Failed to parse notification message %s", e); + else { ++ int r; ++ + log_debug_unit(u->id, + "%s: got %s", u->id, e); + service_set_main_pid(s, pid); ++ r = unit_watch_pid(u, pid); ++ if (r < 0) ++ /* FIXME: we need to do something here */ ++ log_warning_unit(u->id, ++ "Failed to watch PID %lu from service %s", ++ (unsigned long) pid, u->id); + } + } + diff --git a/systemd.changes b/systemd.changes index cb75b260..83f80aac 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 23 13:09:06 UTC 2013 - arvidjaar@gmail.com + +- Fix-timeout-when-stopping-Type-notify-service.patch + Make sure MAINPID is watched when it becomes known (bnc#841544) + ------------------------------------------------------------------- Mon Sep 23 13:11:08 CEST 2013 - fcrozat@suse.com diff --git a/systemd.spec b/systemd.spec index da86bcaa..cddb2f25 100644 --- a/systemd.spec +++ b/systemd.spec @@ -184,6 +184,8 @@ Patch53: 0006-swap-fix-reverse-dependencies.patch Patch54: 0008-swap-create-.wants-symlink-to-auto-swap-devices.patch # PATCH-FIX-UPSTREAM 0009-polkit-Avoid-race-condition-in-scraping-proc.patch VUL-0: polkit: process subject race condition [bnc#835827] Patch55: 0009-polkit-Avoid-race-condition-in-scraping-proc.patch +# PATCH-FIX-UPSTREAM Fix-timeout-when-stopping-Type-notify-service.patch -- watch MAINPID after it becomed known [bnc#841544] +Patch56: Fix-timeout-when-stopping-Type-notify-service.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -439,6 +441,7 @@ cp %{SOURCE7} m4/ %patch53 -p1 %patch54 -p1 %patch55 -p1 +%patch56 -p1 # udev patches %patch1001 -p1