From patchwork Wed Jan 27 17:58:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1432282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQrtz6HJVz9sSs for ; Thu, 28 Jan 2021 04:58:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B7D2486B16; Wed, 27 Jan 2021 17:58:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pCNn1Y8Oe+L4; Wed, 27 Jan 2021 17:58:31 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id B97A286B06; Wed, 27 Jan 2021 17:58:31 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9CBBEC08A1; Wed, 27 Jan 2021 17:58:31 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5FF82C013A for ; Wed, 27 Jan 2021 17:58:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4BC6D86090 for ; Wed, 27 Jan 2021 17:58:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 862rRmJruaFk for ; Wed, 27 Jan 2021 17:58:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 2C46086081 for ; Wed, 27 Jan 2021 17:58:28 +0000 (UTC) X-Originating-IP: 27.7.95.130 Received: from nusiddiq.home.org.com (unknown [27.7.95.130]) (Authenticated sender: numans@ovn.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 3DA222000B; Wed, 27 Jan 2021 17:58:22 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Wed, 27 Jan 2021 23:28:17 +0530 Message-Id: <20210127175817.1558945-1-numans@ovn.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Cc: Vladislav Odintsov Subject: [ovs-dev] [PATCH ovn] rhel: Add systemd-unit for ovsdb-server-ic X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Vladislav Odintsov New ovsdb-server-ic.service systemd-unit manages OVN_IC_Northbound and OVN_IC_Southbound OVSDB server processes. Signed-off-by: Vladislav Odintsov --- rhel/automake.mk | 1 + rhel/ovn-fedora.spec.in | 28 +++++++++++++++- rhel/usr_lib_systemd_system_ovn-ic.service | 1 - ...lib_systemd_system_ovsdb-server-ic.service | 32 +++++++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 rhel/usr_lib_systemd_system_ovsdb-server-ic.service diff --git a/rhel/automake.mk b/rhel/automake.mk index 0e8795feb3..16d1b618b1 100644 --- a/rhel/automake.mk +++ b/rhel/automake.mk @@ -15,6 +15,7 @@ EXTRA_DIST += \ rhel/usr_lib_systemd_system_ovn-controller-vtep.service \ rhel/usr_lib_systemd_system_ovn-ic.service \ rhel/usr_lib_systemd_system_ovn-northd.service \ + rhel/usr_lib_systemd_system_ovsdb-server-ic.service \ rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \ rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml \ rhel/usr_share_ovn_scripts_systemd_sysconfig.template diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in index 6938deee6a..8890e33db9 100644 --- a/rhel/ovn-fedora.spec.in +++ b/rhel/ovn-fedora.spec.in @@ -169,7 +169,7 @@ install -p -D -m 0644 \ rhel/usr_share_ovn_scripts_systemd_sysconfig.template \ $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/ovn -for service in ovn-controller ovn-controller-vtep ovn-northd ovn-ic; do +for service in ovn-controller ovn-controller-vtep ovn-northd ovn-ic ovsdb-server-ic; do install -p -D -m 0644 \ rhel/usr_lib_systemd_system_${service}.service \ $RPM_BUILD_ROOT%{_unitdir}/${service}.service @@ -291,6 +291,16 @@ fi fi %endif +%if 0%{?systemd_preun:1} + %systemd_preun ovsdb-server-ic.service +%else + if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable ovsdb-server-ic.service >/dev/null 2>&1 || : + /bin/systemctl stop ovsdb-server-ic.service >/dev/null 2>&1 || : + fi +%endif + %preun host %if 0%{?systemd_preun:1} %systemd_preun ovn-controller.service @@ -341,6 +351,15 @@ fi fi %endif +%if 0%{?systemd_post:1} + %systemd_post ovsdb-server-ic.service +%else + # Package install, not upgrade + if [ $1 -eq 1 ]; then + /bin/systemctl daemon-reload >dev/null || : + fi +%endif + %post host %if 0%{?systemd_post:1} %systemd_post ovn-controller.service @@ -385,6 +404,12 @@ fi fi %endif +%if 0%{?systemd_postun:1} + %systemd_postun ovsdb-server-ic.service +%else + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%endif + %postun host %if 0%{?systemd_postun_with_restart:1} %systemd_postun_with_restart ovn-controller.service @@ -484,6 +509,7 @@ fi %config %{_datadir}/ovn/ovn-ic-nb.ovsschema %config %{_datadir}/ovn/ovn-ic-sb.ovsschema %{_unitdir}/ovn-ic.service +%{_unitdir}/ovsdb-server-ic.service %files host %{_bindir}/ovn-controller diff --git a/rhel/usr_lib_systemd_system_ovn-ic.service b/rhel/usr_lib_systemd_system_ovn-ic.service index 46ca0cff12..2507a11e40 100644 --- a/rhel/usr_lib_systemd_system_ovn-ic.service +++ b/rhel/usr_lib_systemd_system_ovn-ic.service @@ -23,7 +23,6 @@ RemainAfterExit=yes Environment=OVN_RUNDIR=%t/ovn OVN_DBDIR=/var/lib/ovn EnvironmentFile=-/etc/sysconfig/ovn EnvironmentFile=-/etc/sysconfig/ovn-ic -ExecStartPre=-/usr/bin/chown -R ${OVN_USER_ID} ${OVN_DBDIR} ExecStart=/usr/share/ovn/scripts/ovn-ctl \ --ovn-user=${OVN_USER_ID} start_ic $OVN_IC_OPTS ExecStop=/usr/share/ovn/scripts/ovn-ctl stop_ic diff --git a/rhel/usr_lib_systemd_system_ovsdb-server-ic.service b/rhel/usr_lib_systemd_system_ovsdb-server-ic.service new file mode 100644 index 0000000000..c1ed0341a2 --- /dev/null +++ b/rhel/usr_lib_systemd_system_ovsdb-server-ic.service @@ -0,0 +1,32 @@ +# See ovn-ic(8) for details about ovn-ic. +# +# To customize the ovsdb-server-ic service, you may create a configuration file +# in the /etc/systemd/system/ovsdb-server-ic.d/ directory. For example, to specify +# additional options to be passed to the "ovn-ctl start_ic_ovsdb" command, you +# could place the following contents in +# /etc/systemd/system/ovsdb-server-ic.d/local.conf: +# +# [System] +# Environment="OVSDB_SERVER_IC=--db-ic-nb-create-insecure-remote=yes --db-ic-sb-create-insecure-remote=yes" +# +# Alternatively, you may specify environment variables in the file /etc/sysconfig/ovsdb-server-ic: +# +# OVSDB_SERVER_IC=--db-ic-nb-create-insecure-remote=yes --db-ic-sb-create-insecure-remote=yes" + +[Unit] +Description=OVN global (IC) northbound and southbound OVSDB servers +After=syslog.target + +[Service] +Type=oneshot +RemainAfterExit=yes +Environment=OVN_RUNDIR=%t/ovn OVN_DBDIR=/var/lib/ovn +EnvironmentFile=-/etc/sysconfig/ovn +EnvironmentFile=-/etc/sysconfig/ovsdb-server-ic +ExecStartPre=-/usr/bin/chown -R ${OVN_USER_ID} ${OVN_DBDIR} +ExecStart=/usr/share/ovn/scripts/ovn-ctl \ + --ovn-user=${OVN_USER_ID} start_ic_ovsdb $OVSDB_SERVER_IC +ExecStop=/usr/share/ovn/scripts/ovn-ctl stop_ic_ovsdb + +[Install] +WantedBy=multi-user.target