SHA256
1
0
forked from pool/systemd

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
This commit is contained in:
Frederic Crozat 2013-09-24 07:59:24 +00:00 committed by Git OBS Bridge
parent 239590f3b8
commit 5ad6dc99d4
4 changed files with 98 additions and 8 deletions

View File

@ -9,11 +9,11 @@ value only if expression !move_later is true.
src/libudev/libudev-enumerate.c | 2 +- src/libudev/libudev-enumerate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c Index: systemd-207/src/libudev/libudev-enumerate.c
index bc1e37d..8146f27 100644 ===================================================================
--- a/src/libudev/libudev-enumerate.c --- systemd-207.orig/src/libudev/libudev-enumerate.c
+++ b/src/libudev/libudev-enumerate.c +++ systemd-207/src/libudev/libudev-enumerate.c
@@ -300,7 +300,7 @@ _public_ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enume @@ -300,7 +300,7 @@ _public_ struct udev_list_entry *udev_en
/* skip to be delayed devices, and move the to /* skip to be delayed devices, and move the to
* the point where the prefix changes. We can * the point where the prefix changes. We can
* only move one item at a time. */ * 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); move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath);
if (move_later_prefix > 0) { if (move_later_prefix > 0) {
--
1.8.1.4

View File

@ -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: <systemd-devel-bounces+arvidjaar=gmail.com@lists.freedesktop.org>
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 <arvidjaar@gmail.com>; 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 <systemd-devel@lists.freedesktop.org>;
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 <jjk@jjacky.com>
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 <systemd-devel.lists.freedesktop.org>
List-Unsubscribe: <http://lists.freedesktop.org/mailman/options/systemd-devel>,
<mailto:systemd-devel-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/systemd-devel>
List-Post: <mailto:systemd-devel@lists.freedesktop.org>
List-Help: <mailto:systemd-devel-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/systemd-devel>,
<mailto:systemd-devel-request@lists.freedesktop.org?subject=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);
}
}

View File

@ -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 Mon Sep 23 13:11:08 CEST 2013 - fcrozat@suse.com

View File

@ -184,6 +184,8 @@ Patch53: 0006-swap-fix-reverse-dependencies.patch
Patch54: 0008-swap-create-.wants-symlink-to-auto-swap-devices.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] # 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 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 # udev patches
# PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch
@ -439,6 +441,7 @@ cp %{SOURCE7} m4/
%patch53 -p1 %patch53 -p1
%patch54 -p1 %patch54 -p1
%patch55 -p1 %patch55 -p1
%patch56 -p1
# udev patches # udev patches
%patch1001 -p1 %patch1001 -p1