@@ -27,6 +27,7 @@ EXTRA_DIST += \
rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
rhel/usr_lib_systemd_system_openvswitch.service \
rhel/usr_lib_systemd_system_ovsdb-server.service \
+ rhel/usr_lib_systemd_system_ovs-vswitchd.service \
rhel/usr_lib_systemd_system_ovn-controller.service \
rhel/usr_lib_systemd_system_ovn-controller-vtep.service \
rhel/usr_lib_systemd_system_ovn-northd.service
@@ -60,10 +60,10 @@ fi
fi
done
-SERVICE_UNIT=/usr/lib/systemd/system/ovsdb-server.service
+SERVICE_UNIT=/usr/lib/systemd/system/openvswitch.service
if [ -f $SERVICE_UNIT ] && [ -x /usr/bin/systemctl ]; then
- if ! systemctl --quiet is-active ovsdb-server.service; then
- systemctl start ovsdb-server.service
+ if ! systemctl --quiet is-active openvswitch.service; then
+ systemctl start openvswitch.service
fi
else
if [ ! -f /var/lock/subsys/openvswitch ]; then
@@ -189,7 +189,7 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
install -p -D -m 0644 \
rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
-for service in openvswitch ovsdb-server \
+for service in openvswitch ovsdb-server ovs-vswitchd \
ovn-controller ovn-controller-vtep ovn-northd; do
install -p -D -m 0644 \
rhel/usr_lib_systemd_system_${service}.service \
@@ -417,6 +417,7 @@ fi
%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
%{_unitdir}/openvswitch.service
%{_unitdir}/ovsdb-server.service
+%{_unitdir}/ovs-vswitchd.service
%{_datadir}/openvswitch/scripts/openvswitch.init
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
@@ -1,11 +1,13 @@
[Unit]
Description=Open vSwitch
-After=syslog.target network.target ovsdb-server.service
-Requires=ovsdb-server.service
+PartOf=network.target
+BindsTo=ovsdb-server.service
+BindsTo=ovs-vswitchd.service
[Service]
Type=oneshot
ExecStart=/bin/true
+ExecReload=/bin/true
ExecStop=/bin/true
RemainAfterExit=yes
new file mode 100644
@@ -0,0 +1,18 @@
+[Unit]
+Description=Open vSwitch Forwarding Unit
+After=ovsdb-server.service
+Requires=ovsdb-server.service
+ReloadPropagatedFrom=ovsdb-server.service
+AssertPathIsReadWrite=/var/run/openvswitch/db.sock
+PartOf=openvswitch.service
+
+[Service]
+Type=forking
+EnvironmentFile=-/etc/sysconfig/openvswitch
+ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
+ --no-ovsdb-server --no-monitor --system-id=random \
+ start $OPTIONS
+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 \
+ restart $OPTIONS
@@ -1,15 +1,17 @@
[Unit]
-Description=Open vSwitch Internal Unit
+Description=Open vSwitch Database Unit
After=syslog.target
+ReloadPropagatedFrom=openvswitch.service
PartOf=openvswitch.service
-Wants=openvswitch.service
[Service]
-Type=oneshot
-RemainAfterExit=yes
+Type=forking
EnvironmentFile=-/etc/sysconfig/openvswitch
-ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start \
- --system-id=random $OPTIONS
-ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop
+ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
+ --no-ovs-vswitchd --no-monitor --system-id=random \
+ start $OPTIONS
+ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
+ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
+ --no-monitor restart $OPTIONS
RuntimeDirectory=openvswitch
RuntimeDirectoryMode=0755