Update the systemd units for ovn-controller and ovn-northd to support
passing additional arguments to the ovn-ctl scripts through environment
variables.  Also add some documentation to the top of these files that
describes how to specify these environment variables in systemd
configuration files.

Add similar documentation to the top of the ovn-controller-vtep system
unit to describe how to specify environment variables for options
passed to ovn-controller-vtep.

Signed-off-by: Russell Bryant <russ...@ovn.org>
Co-authored-by: Babu Shanmugam <bscha...@redhat.com>
Signed-off-by: Babu Shanmugam <bscha...@redhat.com>
---
 rhel/usr_lib_systemd_system_ovn-controller-vtep.service |  8 ++++++++
 rhel/usr_lib_systemd_system_ovn-controller.service      | 16 +++++++++-------
 rhel/usr_lib_systemd_system_ovn-northd.service          | 13 ++++++++++++-
 3 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/rhel/usr_lib_systemd_system_ovn-controller-vtep.service 
b/rhel/usr_lib_systemd_system_ovn-controller-vtep.service
index 867a906..3bd4331 100644
--- a/rhel/usr_lib_systemd_system_ovn-controller-vtep.service
+++ b/rhel/usr_lib_systemd_system_ovn-controller-vtep.service
@@ -1,3 +1,4 @@
+# See ovn-controller-vtep(8) for details about ovn-controller-vtep.
 #
 # You may override the following variables to customize ovn-controller-vtep
 # behavior:
@@ -12,6 +13,13 @@
 #             ovn-controller-vtep for more details on the format for the db
 #             location.
 #
+# To override these variables, you may create a configuration file
+# in the /etc/systemd/system/ovn-controller-vtep.d/ directory.  For example,
+# you could place the following contents in
+# /etc/systemd/system/ovn-controller-vtep.d/local.conf:
+#
+# [System]
+# Environment="OVN_DB=unix:/usr/local/var/run/openvswitch/db.sock" 
"VTEP_DB=unix:/usr/local/var/run/openvswitch/vtep.sock"
 
 [Unit]
 Description=OVN VTEP gateway controller daemon
diff --git a/rhel/usr_lib_systemd_system_ovn-controller.service 
b/rhel/usr_lib_systemd_system_ovn-controller.service
index 9bd2f66..ad1b146 100644
--- a/rhel/usr_lib_systemd_system_ovn-controller.service
+++ b/rhel/usr_lib_systemd_system_ovn-controller.service
@@ -1,11 +1,13 @@
+# See ovn-controller(8) for details about ovn-controller.
 #
-# You may override the following variables to customize ovn-controller 
behavior:
-#
-#   OVS_DB - Set this variable to the location of the ovsdb server that is
-#            serving the Open_vSwitch database for the local ovs-vswitchd.
-#            See the manpage for ovn-controller for more details on the
-#            format for the db location.
+# To customize the ovn-controller service, you may create a configuration file
+# in the /etc/systemd/system/ovn-controller.d/ directory.  For example, to 
specify
+# additional options to be passed to the "ovn-ctl start_controller" command, 
you
+# could place the following contents in
+# /etc/systemd/system/ovn-controller.d/local.conf:
 #
+# [System]
+# Environment="OVN_CONTROLLER_OPTS=--ovn-controller-log=-vconsole:emer 
-vsyslog:err -vfile:info"
 
 [Unit]
 Description=OVN controller daemon
@@ -16,5 +18,5 @@ After=openvswitch.service
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_controller
+ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_controller 
$OVN_CONTROLLER_OPTS
 ExecStop=/usr/share/openvswitch/scripts/ovn-ctl stop_controller
diff --git a/rhel/usr_lib_systemd_system_ovn-northd.service 
b/rhel/usr_lib_systemd_system_ovn-northd.service
index 5b3b03a..6e23eaa 100644
--- a/rhel/usr_lib_systemd_system_ovn-northd.service
+++ b/rhel/usr_lib_systemd_system_ovn-northd.service
@@ -1,3 +1,14 @@
+# See ovn-northd(8) for details about ovn-northd.
+#
+# To customize the ovn-northd service, you may create a configuration file
+# in the /etc/systemd/system/ovn-northd.d/ directory.  For example, to specify
+# additional options to be passed to the "ovn-ctl start_northd" command, you
+# could place the following contents in
+# /etc/systemd/system/ovn-northd.d/local.conf:
+#
+# [System]
+# 
Environment="OVN_NORTHD_OPTS=--db-nb-sock=/usr/local/var/run/openvswitch/ovnnb_db.sock
 --db-sb-sock=/usr/local/var/run/openvswitch/ovnsb_db.sock"
+
 [Unit]
 Description=OVN northd management daemon
 After=syslog.target
@@ -8,5 +19,5 @@ After=openvswitch.service
 Type=oneshot
 RemainAfterExit=yes
 Environment=OVS_RUNDIR=%t/openvswitch OVS_DBDIR=/var/lib/openvswitch
-ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_northd
+ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_northd $OVN_NORTHD_OPTS
 ExecStop=/usr/share/openvswitch/scripts/ovn-ctl stop_northd
-- 
2.9.3

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to