From patchwork Wed Sep 13 07:35:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 813202 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=) 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 3xsYQQ5byKz9sNw for ; Wed, 13 Sep 2017 17:37:02 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A16A2B4B; Wed, 13 Sep 2017 07:35:48 +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 CB818B1B for ; Wed, 13 Sep 2017 07:35:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D7172113 for ; Wed, 13 Sep 2017 07:35:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C5C87EA8B for ; Wed, 13 Sep 2017 07:35:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C5C87EA8B Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=tredaelli@redhat.com Received: from graphite.redhat.com (ovpn-116-78.ams2.redhat.com [10.36.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id C111B5C6D7 for ; Wed, 13 Sep 2017 07:35:44 +0000 (UTC) From: Timothy Redaelli To: dev@openvswitch.org Date: Wed, 13 Sep 2017 09:35:34 +0200 Message-Id: <6cc09b4922f4c7944ebb4e030fefac3380966233.1504871394.git.tredaelli@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 13 Sep 2017 07:35:45 +0000 (UTC) X-Spam-Status: No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v4 2/2] rhel: Add systemd support to delete transient ports only on boot 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 Using the dependencies feature of systemd ovs-delete-transient-ports.service is only started once and so transient ports are only deleted only the first time after boot. Acked-by: Aaron Conole Signed-off-by: Timothy Redaelli --- rhel/automake.mk | 1 + rhel/openvswitch-fedora.spec.in | 3 ++- rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service | 10 ++++++++++ rhel/usr_lib_systemd_system_ovsdb-server.service | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service diff --git a/rhel/automake.mk b/rhel/automake.mk index 1d1ac1a13..9336f0912 100644 --- a/rhel/automake.mk +++ b/rhel/automake.mk @@ -30,6 +30,7 @@ EXTRA_DIST += \ rhel/usr_lib_systemd_system_openvswitch.service \ rhel/usr_lib_systemd_system_ovsdb-server.service \ rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \ + rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service \ rhel/usr_lib_systemd_system_ovn-controller.service \ rhel/usr_lib_systemd_system_ovn-controller-vtep.service \ rhel/usr_lib_systemd_system_ovn-northd.service \ diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index dd79fa9a0..a08f369a3 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -259,7 +259,7 @@ install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \ install -p -D -m 0644 \ rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \ $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch -for service in openvswitch ovsdb-server ovs-vswitchd \ +for service in openvswitch ovsdb-server ovs-vswitchd ovs-delete-transient-ports \ ovn-controller ovn-controller-vtep ovn-northd; do install -p -D -m 0644 \ rhel/usr_lib_systemd_system_${service}.service \ @@ -528,6 +528,7 @@ fi %{_unitdir}/openvswitch.service %{_unitdir}/ovsdb-server.service %{_unitdir}/ovs-vswitchd.service +%{_unitdir}/ovs-delete-transient-ports.service %{_datadir}/openvswitch/scripts/openvswitch.init %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs diff --git a/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service new file mode 100644 index 000000000..4cd4d7f57 --- /dev/null +++ b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service @@ -0,0 +1,10 @@ +[Unit] +Description=Open vSwitch Delete Transient Ports +After=ovsdb-server.service +Before=ovs-vswitchd.service +AssertPathExists=/var/run/openvswitch/db.sock + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl delete-transient-ports diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service index 7acd25f78..5baac822d 100644 --- a/rhel/usr_lib_systemd_system_ovsdb-server.service +++ b/rhel/usr_lib_systemd_system_ovsdb-server.service @@ -2,6 +2,7 @@ Description=Open vSwitch Database Unit After=syslog.target network-pre.target Before=network.target network.service +Wants=ovs-delete-transient-ports.service ReloadPropagatedFrom=openvswitch.service PartOf=openvswitch.service