fedora package: fix systemd ordering and deps.
[sliver-openvswitch.git] / rhel / etc_sysconfig_network-scripts_ifup-ovs
index 017346d..3f31c30 100755 (executable)
@@ -60,7 +60,16 @@ fi
        fi
 done
 
-[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start
+SERVICE_UNIT=/usr/lib/systemd/system/openvswitch-nonetwork.service
+if [ -f $SERVICE_UNIT ] && [ -x /usr/bin/systemctl ]; then
+       if ! systemctl --quiet is-active openvswitch-nonetwork.service; then
+               systemctl start openvswitch-nonetwork.service
+       fi
+else
+       if [ ! -f /var/lock/subsys/openvswitch ]; then
+               /sbin/service openvswitch start
+       fi
+fi
 
 case "$TYPE" in
        OVSBridge)