From patchwork Fri May 3 07:05:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 1095008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wgQB36YKz9s00 for ; Sat, 4 May 2019 04:19:30 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CB99A3A6B; Fri, 3 May 2019 18:18:55 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 23A8B39DF for ; Fri, 3 May 2019 18:18:15 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 91BCE79 for ; Fri, 3 May 2019 18:18:12 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id 188so3263424pfd.8 for ; Fri, 03 May 2019 11:18:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ZOdRy7BQTQLnsj4vMR08+JcBjg5eqQ1aCEzAcd25ufk=; b=En1OggEbBr+HQ3kLLGlHk1wMjFUHR5X3Vn+j5LzUG6C2muHGY3jI1fn66jdxA/djHU 8CDJnJk0Rh8dlC+ChfStfWjgnoehU6JzLIv1krGuLWoYLLKAlA80iLxVtwmqZ4J7hqCi aa0c/pxOxmsLOM5/ntTMZPALjgrqg72l5mEe8GlWZxG/WIBytuEKMQAW5reUAj6pgerJ Y/rvWQ6zqaLPefhgoyLqx0OIjzgTff9Lp5uNaZgv2HxQ2cVySnl+MHr3o8TqJCYwdAg5 egdGNycDYekUz5knx84cjiY8fFQklbAv1/gr91Ry4FrJe8WXriKbXozJytvxmkxjgJr7 O6pw== X-Gm-Message-State: APjAAAUZrQwn9q3yPjkORr+sVzs0NDLgqmPvYyrFeRPUZMPWzCmEWJVq cxe9McEgiUT7MXwrv/75S7q3ERVg X-Google-Smtp-Source: APXvYqzNNfTfrXcYQQMf4CVfJEKNAcKfojKbfWfyq9h5DHWdYzTfuR0yqQUJQ2eXqJgc++za/dWYNg== X-Received: by 2002:a65:610a:: with SMTP id z10mr12322744pgu.54.1556907491954; Fri, 03 May 2019 11:18:11 -0700 (PDT) Received: from kube-master.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id h13sm427397pgk.55.2019.05.03.11.18.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 May 2019 11:18:11 -0700 (PDT) From: Gurucharan Shetty To: dev@openvswitch.org Date: Fri, 3 May 2019 00:05:35 -0700 Message-Id: <1556867135-29383-2-git-send-email-guru@ovn.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556867135-29383-1-git-send-email-guru@ovn.org> References: <1556867135-29383-1-git-send-email-guru@ovn.org> X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_06_12, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 2/2] fedora: Handle upgrades from rhel package. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Currently we have rhel/openvswitch.spec.in that provides sysv scripts. The fedora package provides systemd scripts. If one upgrades openvswitch package from sysv to systemd, you will end up in a situation where old OVS daemons are running, but systemd does not know about it. One "restart" is needed for systemd to see the old daemons. Another "restart" or "force-reload-kmod" is needed to actually use the new daemons. This commit, just takes care of the first restart. The "real" restart/force-reload-kmod will still have to be done outside the package installation. Signed-off-by: Gurucharan Shetty Acked-by: Ansis Atteka --- rhel/openvswitch-fedora.spec.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index e8165f9..d41d11c 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -364,6 +364,12 @@ getent passwd openvswitch >/dev/null || \ usermod -a -G hugetlbfs openvswitch %endif %endif + +%if %{with autoenable} + if [ -x "/etc/init.d/openvswitch" ]; then + touch %{_tmppath}/ovs-upgrade-from-sysv + fi +%endif exit 0 %post @@ -397,6 +403,14 @@ fi %if %{with autoenable} systemctl daemon-reload systemctl enable openvswitch + # Handle upgrades to this package from the OVS repo's rhel packages. + # One "restart" is needed for newer systemd files to see the old running + # daemons. Another "restart" (outside the package postinst script) is + # needed to actually run new daemons. + if [ -e "%{_tmppath}/ovs-upgrade-from-sysv" ]; then + systemctl restart openvswitch + rm "%{_tmppath}/ovs-upgrade-from-sysv" + fi %endif %post selinux-policy