diff mbox series

[ovs-dev,v1,12/12] rhel: Add ovn-br-controller sub package.

Message ID 20250811101037.918053-1-numans@ovn.org
State Changes Requested
Headers show
Series OVN Bridge Controller service. | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Numan Siddique Aug. 11, 2025, 10:10 a.m. UTC
From: Numan Siddique <numans@ovn.org>

Signed-off-by: Numan Siddique <numans@ovn.org>
---
 rhel/automake.mk                              |  4 ++-
 rhel/ovn-fedora.spec.in                       | 22 +++++++++++-
 ...b_systemd_system_ovn-br-controller.service | 35 +++++++++++++++++++
 rhel/usr_lib_systemd_system_ovn-br-db.service | 32 +++++++++++++++++
 4 files changed, 91 insertions(+), 2 deletions(-)
 create mode 100644 rhel/usr_lib_systemd_system_ovn-br-controller.service
 create mode 100644 rhel/usr_lib_systemd_system_ovn-br-db.service

Comments

Mark Michelson Aug. 21, 2025, 9:30 p.m. UTC | #1
Other than what was mentioned in patch 1 about moving some of this code 
to earlier patches:

Acked-by: Mark Michelson <mmichels@redhat.com>

On 8/11/25 6:10 AM, numans@ovn.org wrote:
> From: Numan Siddique <numans@ovn.org>
> 
> Signed-off-by: Numan Siddique <numans@ovn.org>
> ---
>   rhel/automake.mk                              |  4 ++-
>   rhel/ovn-fedora.spec.in                       | 22 +++++++++++-
>   ...b_systemd_system_ovn-br-controller.service | 35 +++++++++++++++++++
>   rhel/usr_lib_systemd_system_ovn-br-db.service | 32 +++++++++++++++++
>   4 files changed, 91 insertions(+), 2 deletions(-)
>   create mode 100644 rhel/usr_lib_systemd_system_ovn-br-controller.service
>   create mode 100644 rhel/usr_lib_systemd_system_ovn-br-db.service
> 
> diff --git a/rhel/automake.mk b/rhel/automake.mk
> index 445dcd2fd4..c4ebf89d8a 100644
> --- a/rhel/automake.mk
> +++ b/rhel/automake.mk
> @@ -18,7 +18,9 @@ EXTRA_DIST += \
>   	rhel/usr_lib_systemd_system_ovn-northd.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
> +	rhel/usr_share_ovn_scripts_systemd_sysconfig.template \
> +	rhel/usr_lib_systemd_system_ovn-br-controller.service \
> +	rhel/usr_lib_systemd_system_ovn-br-db.service
>   
>   update_rhel_spec = \
>     $(AM_V_GEN)($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
> diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
> index 670f1ca9eb..c9c67c1d63 100644
> --- a/rhel/ovn-fedora.spec.in
> +++ b/rhel/ovn-fedora.spec.in
> @@ -119,6 +119,14 @@ Provides: openvswitch-ovn-docker = %{?epoch:%{epoch}:}%{version}-%{release}
>   %description docker
>   Docker network plugins for OVN.
>   
> +%package br-controller
> +Summary: Open Virtual Network support
> +License: ASL 2.0
> +Requires: ovn
> +
> +%description br-controller
> +OVN bridge controller
> +
>   %prep
>   %autosetup -n ovn-%{version} -a 10 -p 1
>   
> @@ -165,7 +173,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 ovn-ic-db ovn-db@; do
> +for service in ovn-controller ovn-controller-vtep ovn-northd ovn-ic ovn-ic-db ovn-db@ ovn-br-controller ovn-br-db; do
>           install -p -D -m 0644 \
>                           rhel/usr_lib_systemd_system_${service}.service \
>                           $RPM_BUILD_ROOT%{_unitdir}/${service}.service
> @@ -549,7 +557,19 @@ fi
>   %{_mandir}/man8/ovn-controller-vtep.8*
>   %{_unitdir}/ovn-controller-vtep.service
>   
> +%files br-controller
> +%{_bindir}/ovn-br-controller
> +%{_bindir}/ovn-brctl
> +%{_mandir}/man8/ovn-br-controller.8*
> +%{_mandir}/man5/ovn-br.5*
> +%config %{_datadir}/ovn/ovn-br.ovsschema
> +%{_unitdir}/ovn-br-controller.service
> +%{_unitdir}/ovn-br-db.service
> +
>   %changelog
> +* Thu Jul 24 2025 Numan Siddique <numans@ovn.org>
> +- Added ovn-br-controller systemd-units.
> +
>   * Wed Jan 11 2023 Vladislav Odintsov <odivlad@gmail.com>
>   - Added ovn-db@.service systemd-unit.
>   
> diff --git a/rhel/usr_lib_systemd_system_ovn-br-controller.service b/rhel/usr_lib_systemd_system_ovn-br-controller.service
> new file mode 100644
> index 0000000000..ce59ebec02
> --- /dev/null
> +++ b/rhel/usr_lib_systemd_system_ovn-br-controller.service
> @@ -0,0 +1,35 @@
> +# See ovn-br-controller(8) for details about ovn-br-controller.
> +#
> +# To customize the ovn-br-controller service, you may create a configuration file
> +# in the /etc/systemd/system/ovn-br-controller.d/ directory.  For example, to specify
> +# additional options to be passed to the "ovn-ctl start_ovnbr_controller" command, you
> +# could place the following contents in
> +# /etc/systemd/system/ovn-br-controller.d/local.conf:
> +#
> +#   [System]
> +#   Environment="OVNBR_CONTROLLER_OPTS=--ovnbr-controller-log=-vconsole:emer -vsyslog:err -vfile:info"
> +#
> +# Alternatively, you may specify environment variables in the file /etc/sysconfig/ovn-controller:
> +#
> +#   OVNBR_CONTROLLER_OPTS="--ovnbr-controller-log=-vconsole:emer -vsyslog:err -vfile:info"
> +
> +[Unit]
> +Description=OVN Bridge controller daemon
> +After=syslog.target
> +Requires=openvswitch.service
> +After=openvswitch.service
> +
> +[Service]
> +Type=forking
> +PIDFile=/var/run/ovn/ovn-br-controller.pid
> +Restart=on-failure
> +Environment=OVN_RUNDIR=%t/ovn OVS_RUNDIR=%t/openvswitch
> +EnvironmentFile=-/etc/sysconfig/ovn
> +EnvironmentFile=-/etc/sysconfig/ovn-br-controller
> +ExecStart=/usr/share/ovn/scripts/ovn-ctl --no-monitor \
> +           --ovn-user=${OVN_USER_ID} \
> +          start_ovnbr_controller $OVNBR_CONTROLLER_OPTS
> +ExecStop=/usr/share/ovn/scripts/ovn-ctl stop_ovnbr_controller
> +
> +[Install]
> +WantedBy=multi-user.target
> \ No newline at end of file
> diff --git a/rhel/usr_lib_systemd_system_ovn-br-db.service b/rhel/usr_lib_systemd_system_ovn-br-db.service
> new file mode 100644
> index 0000000000..6de2a22f1e
> --- /dev/null
> +++ b/rhel/usr_lib_systemd_system_ovn-br-db.service
> @@ -0,0 +1,32 @@
> +# See ovn-br(8) for details about ovn-br.
> +#
> +# To customize the ovn-br-db service, you may create a configuration file
> +# in the /etc/systemd/system/ovn-br-db.d/ directory.  For example, to specify
> +# additional options to be passed to the "ovn-ctl start_ovnbr_ovsdb" command, you
> +# could place the following contents in
> +# /etc/systemd/system/ovn-br-db.d/local.conf:
> +#
> +#   [System]
> +#   Environment="OVN_BR_DB_OPTS=--db-br-create-insecure-remote=yes"
> +#
> +# Alternatively, you may specify environment variables in the file /etc/sysconfig/ovn-br-db:
> +#
> +#   OVN_BR_DB_OPTS="--db-br-create-insecure-remote=yes"
> +
> +[Unit]
> +Description=OVN Bridge Controller OVSDB server
> +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/ovn-br-db
> +ExecStartPre=-/usr/bin/chown -R ${OVN_USER_ID} ${OVN_DBDIR}
> +ExecStart=/usr/share/ovn/scripts/ovn-ctl \
> +          --ovn-user=${OVN_USER_ID} start_ovnbr_ovsdb $OVN_BR_DB_OPTS
> +ExecStop=/usr/share/ovn/scripts/ovn-ctl stop_ovnbr_ovsdb
> +
> +[Install]
> +WantedBy=multi-user.target
diff mbox series

Patch

diff --git a/rhel/automake.mk b/rhel/automake.mk
index 445dcd2fd4..c4ebf89d8a 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -18,7 +18,9 @@  EXTRA_DIST += \
 	rhel/usr_lib_systemd_system_ovn-northd.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
+	rhel/usr_share_ovn_scripts_systemd_sysconfig.template \
+	rhel/usr_lib_systemd_system_ovn-br-controller.service \
+	rhel/usr_lib_systemd_system_ovn-br-db.service
 
 update_rhel_spec = \
   $(AM_V_GEN)($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
index 670f1ca9eb..c9c67c1d63 100644
--- a/rhel/ovn-fedora.spec.in
+++ b/rhel/ovn-fedora.spec.in
@@ -119,6 +119,14 @@  Provides: openvswitch-ovn-docker = %{?epoch:%{epoch}:}%{version}-%{release}
 %description docker
 Docker network plugins for OVN.
 
+%package br-controller
+Summary: Open Virtual Network support
+License: ASL 2.0
+Requires: ovn
+
+%description br-controller
+OVN bridge controller
+
 %prep
 %autosetup -n ovn-%{version} -a 10 -p 1
 
@@ -165,7 +173,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 ovn-ic-db ovn-db@; do
+for service in ovn-controller ovn-controller-vtep ovn-northd ovn-ic ovn-ic-db ovn-db@ ovn-br-controller ovn-br-db; do
         install -p -D -m 0644 \
                         rhel/usr_lib_systemd_system_${service}.service \
                         $RPM_BUILD_ROOT%{_unitdir}/${service}.service
@@ -549,7 +557,19 @@  fi
 %{_mandir}/man8/ovn-controller-vtep.8*
 %{_unitdir}/ovn-controller-vtep.service
 
+%files br-controller
+%{_bindir}/ovn-br-controller
+%{_bindir}/ovn-brctl
+%{_mandir}/man8/ovn-br-controller.8*
+%{_mandir}/man5/ovn-br.5*
+%config %{_datadir}/ovn/ovn-br.ovsschema
+%{_unitdir}/ovn-br-controller.service
+%{_unitdir}/ovn-br-db.service
+
 %changelog
+* Thu Jul 24 2025 Numan Siddique <numans@ovn.org>
+- Added ovn-br-controller systemd-units.
+
 * Wed Jan 11 2023 Vladislav Odintsov <odivlad@gmail.com>
 - Added ovn-db@.service systemd-unit.
 
diff --git a/rhel/usr_lib_systemd_system_ovn-br-controller.service b/rhel/usr_lib_systemd_system_ovn-br-controller.service
new file mode 100644
index 0000000000..ce59ebec02
--- /dev/null
+++ b/rhel/usr_lib_systemd_system_ovn-br-controller.service
@@ -0,0 +1,35 @@ 
+# See ovn-br-controller(8) for details about ovn-br-controller.
+#
+# To customize the ovn-br-controller service, you may create a configuration file
+# in the /etc/systemd/system/ovn-br-controller.d/ directory.  For example, to specify
+# additional options to be passed to the "ovn-ctl start_ovnbr_controller" command, you
+# could place the following contents in
+# /etc/systemd/system/ovn-br-controller.d/local.conf:
+#
+#   [System]
+#   Environment="OVNBR_CONTROLLER_OPTS=--ovnbr-controller-log=-vconsole:emer -vsyslog:err -vfile:info"
+#
+# Alternatively, you may specify environment variables in the file /etc/sysconfig/ovn-controller:
+#
+#   OVNBR_CONTROLLER_OPTS="--ovnbr-controller-log=-vconsole:emer -vsyslog:err -vfile:info"
+
+[Unit]
+Description=OVN Bridge controller daemon
+After=syslog.target
+Requires=openvswitch.service
+After=openvswitch.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/ovn/ovn-br-controller.pid
+Restart=on-failure
+Environment=OVN_RUNDIR=%t/ovn OVS_RUNDIR=%t/openvswitch
+EnvironmentFile=-/etc/sysconfig/ovn
+EnvironmentFile=-/etc/sysconfig/ovn-br-controller
+ExecStart=/usr/share/ovn/scripts/ovn-ctl --no-monitor \
+           --ovn-user=${OVN_USER_ID} \
+          start_ovnbr_controller $OVNBR_CONTROLLER_OPTS
+ExecStop=/usr/share/ovn/scripts/ovn-ctl stop_ovnbr_controller
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/rhel/usr_lib_systemd_system_ovn-br-db.service b/rhel/usr_lib_systemd_system_ovn-br-db.service
new file mode 100644
index 0000000000..6de2a22f1e
--- /dev/null
+++ b/rhel/usr_lib_systemd_system_ovn-br-db.service
@@ -0,0 +1,32 @@ 
+# See ovn-br(8) for details about ovn-br.
+#
+# To customize the ovn-br-db service, you may create a configuration file
+# in the /etc/systemd/system/ovn-br-db.d/ directory.  For example, to specify
+# additional options to be passed to the "ovn-ctl start_ovnbr_ovsdb" command, you
+# could place the following contents in
+# /etc/systemd/system/ovn-br-db.d/local.conf:
+#
+#   [System]
+#   Environment="OVN_BR_DB_OPTS=--db-br-create-insecure-remote=yes"
+#
+# Alternatively, you may specify environment variables in the file /etc/sysconfig/ovn-br-db:
+#
+#   OVN_BR_DB_OPTS="--db-br-create-insecure-remote=yes"
+
+[Unit]
+Description=OVN Bridge Controller OVSDB server
+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/ovn-br-db
+ExecStartPre=-/usr/bin/chown -R ${OVN_USER_ID} ${OVN_DBDIR}
+ExecStart=/usr/share/ovn/scripts/ovn-ctl \
+          --ovn-user=${OVN_USER_ID} start_ovnbr_ovsdb $OVN_BR_DB_OPTS
+ExecStop=/usr/share/ovn/scripts/ovn-ctl stop_ovnbr_ovsdb
+
+[Install]
+WantedBy=multi-user.target