[ovs-dev,v1] rhel: retain OVS_CTL_OPTS for systemd service files

Message ID 1536954563-103152-1-git-send-email-martinxu9.ovs@gmail.com
State New
Headers show
Series
  • [ovs-dev,v1] rhel: retain OVS_CTL_OPTS for systemd service files
Related show

Commit Message

Martin Xu Sept. 14, 2018, 7:49 p.m.
OVS init.d script calls ovs-ctl with $OVS_CTL_OPTS defined in the
config file. This variable is replaced by OPTIONS in systemd service
files. This patch addes $OVS_CTL_OPTS back to be passed along with $OPTIONS
for backward compatibility.

VMware-BZ: #2036847

Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Aaron Conole <aconole@redhat.com>
---
 rhel/usr_lib_systemd_system_ovs-vswitchd.service.in           | 4 ++--
 rhel/usr_lib_systemd_system_ovsdb-server.service              | 4 ++--
 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template | 5 +++++
 3 files changed, 9 insertions(+), 4 deletions(-)

Patch

diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
index 11b34c6..e4dbdf3 100644
--- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
+++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
@@ -21,10 +21,10 @@  ExecStartPre=-/usr/bin/chmod 0775 /dev/hugepages
 ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
           --no-ovsdb-server --no-monitor --system-id=random \
           ${OVSUSER} \
-          start $OPTIONS
+          start $OPTIONS $OVS_CTL_OPTS
 ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop
 ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server \
           --no-monitor --system-id=random \
           ${OVSUSER} \
-          restart $OPTIONS
+          restart $OPTIONS $OVS_CTL_OPTS
 TimeoutSec=300
diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service
index 70da1ec..09f946b 100644
--- a/rhel/usr_lib_systemd_system_ovsdb-server.service
+++ b/rhel/usr_lib_systemd_system_ovsdb-server.service
@@ -16,10 +16,10 @@  EnvironmentFile=-/run/openvswitch/useropts
 ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
           --no-ovs-vswitchd --no-monitor --system-id=random \
           ${OVSUSER} \
-          start $OPTIONS
+          start $OPTIONS $OVS_CTL_OPTS
 ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
 ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
            ${OVSUSER} \
-           --no-monitor restart $OPTIONS
+           --no-monitor restart $OPTIONS $OVS_CTL_OPTS
 RuntimeDirectory=openvswitch
 RuntimeDirectoryMode=0755
diff --git a/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template b/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
index 9364454..0ce5b6b 100644
--- a/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
+++ b/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
@@ -23,5 +23,10 @@ 
 #
 OPTIONS=""
 
+# OVS_CTL_OPTS: Extra options to pass along with OPTIONS to ovs-ctl.
+# This flag is retained for backward compatibility. For example,
+# user can specify --ovs-vswitchd-wrapper=valgrind.
+# OVS_CTL_OPTS=
+
 # Uncomment and set the OVS User/Group value
 #OVS_USER_ID="openvswitch:openvswitch"