From patchwork Fri May 3 07:05:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 1095007 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 44wgPc6w00z9s3l for ; Sat, 4 May 2019 04:18:59 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E94813A8A; Fri, 3 May 2019 18:18:54 +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 2361F39DF for ; Fri, 3 May 2019 18:18:12 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A01DB79 for ; Fri, 3 May 2019 18:18:11 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id n2so3072348pgg.13 for ; Fri, 03 May 2019 11:18:11 -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; bh=B1VljkpkU99wN0AR86aA6XGGbMuwMW5zPxx2DtDWrGw=; b=I28TPKnXh/sOOGYw+iWUkxXUJneBwhlnyO8s+TjJrZfcY9IzOyHVzuM30R3HQrQD24 AxB56r+n6DFMu9GMdV7cKuPDab1PBb/TSM6HV4cr/iPUCko2/dhJxDjLkBouTjznIdq5 +TILzRmylD+tPp1GKyPAOVzaWbjBddB3zkKiHf1GqeQ5yrouxogex4lBJtb0mamR4GDt pKSSfNUetSxIyL4r2Jbcea05s6WYJrRI6VQHJa0oYD177VXb0fL9XjVgJOQztuqXgnT6 8k7Z23L1wPn/Fq5ckQj3PSMDCXFxHP0wQWQjcWK9piBnrSja9TU1IzijS9/iDh63XFOM mJxQ== X-Gm-Message-State: APjAAAXRKOeAZxy6Byfn0sDkgdP15TatXsb0RbGPavJ1QCKxXkJ9nLL5 +TH27APfh477+sPMoGMivntcYHnJ X-Google-Smtp-Source: APXvYqycgpRYhp5cBUGkRK2hCMxDRf4Ovlv1EtbnoiYi/Kqvt2v2KULxuofRPLujz9hmdJc9O8OaLg== X-Received: by 2002:a63:1654:: with SMTP id 20mr12489473pgw.166.1556907490966; Fri, 03 May 2019 11:18:10 -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.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 May 2019 11:18:10 -0700 (PDT) From: Gurucharan Shetty To: dev@openvswitch.org Date: Fri, 3 May 2019 00:05:34 -0700 Message-Id: <1556867135-29383-1-git-send-email-guru@ovn.org> X-Mailer: git-send-email 1.9.1 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 1/2] fedora: Ability to auto enable openvswitch service. 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 We currently have rhel/openvswitch.spec.in that automatically enables openvswitch service when the package is installed using chkconfig. But fedora rpm may not enable openvswitch service automatically. The macro currently being used in fedora rpm (systemd_post) will look for preset files in /etc/systemd/system-preset/ to figure out whether openvswitch service needs to be automatically enabled. But, the fedora package does not provide such a file. The argument is that people may want to install the package for binaries and not necessarily to run OVS. If someone now wants to install the fedora package and automatically enable openvswitch, he will have to create a new package that OVS package depends on to install the preset file. This is unwieldy. This commit, provides a rpm build time option to enable the openvswitch service automatically. If you now run the below command, openvswitch service will be automatically enabled during package installation. make rpm-fedora RPMBUILD_OPT="--with autoenable" Signed-off-by: Gurucharan Shetty Acked-by: Ansis Atteka --- rhel/openvswitch-fedora.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index ce728b4..e8165f9 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -32,6 +32,9 @@ # This is enabled by default for versions of the distribution that # have Python 3 by default (Fedora > 22). %bcond_with build_python3 +# If there is a need to automatically enable the package after installation, +# specify the "--with autoenable" +%bcond_with autoenable # Enable PIE, bz#955181 %global _hardened_build 1 @@ -382,6 +385,7 @@ fi %endif %if 0%{?systemd_post:1} + # This may not enable openvswitch service or do daemon-reload. %systemd_post %{name}.service %else # Package install, not upgrade @@ -390,6 +394,11 @@ fi fi %endif +%if %{with autoenable} + systemctl daemon-reload + systemctl enable openvswitch +%endif + %post selinux-policy %selinux_modules_install -s targeted %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp