--- /dev/null
+[Unit]
+Description=Open vSwitch Delete Transient Ports
+After=ovsdb-server.service
+Before=ovs-vswitchd.service
+AssertPathExists=/var/run/openvswitch/db.sock
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/share/openvswitch/scripts/ovs-ctl delete-transient-ports
--- /dev/null
+[Unit]
+Description=Open vSwitch Daemon
+Documentation=man:ovs-vswitchd
+Wants=network.target
+Before=network.target network.service
+Requires=ovsdb-server.service
+After=ovsdb-server.service network-pre.target systemd-udev-settle.service
+ReloadPropagatedFrom=ovsdb-server.service
+AssertPathIsReadWrite=/var/run/openvswitch/db.sock
+
+[Service]
+Type=forking
+Restart=on-failure
+Environment=HOME=/var/run/openvswitch
+EnvironmentFile=-/run/openvswitch/useropts
+EnvironmentFile=-/etc/conf.d/ovs-vswitchd
+ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
+ --no-ovsdb-server --no-monitor --system-id=random \
+ ${OVSUSER} 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 ${OVSUSER} restart $OPTIONS
+TimeoutSec=300
+
+[Install]
+WantedBy=multi-user.target
--- /dev/null
+[Unit]
+Description=Open vSwitch Database Unit
+Documentation=man:ovsdb-server
+After=syslog.target network-pre.target
+Before=network.target network.service
+Wants=ovs-delete-transient-ports.service
+
+[Service]
+Type=forking
+Restart=on-failure
+EnvironmentFile=-/etc/conf.d/ovsdb-server
+ExecStartPre=/bin/chown ${OVS_USER_ID} /var/run/openvswitch /var/log/openvswitch
+ExecStartPre=/bin/sh -c 'rm -f /run/openvswitch/useropts; if [ "$${OVS_USER_ID/:*/}" != "root" ]; then /usr/bin/echo "OVSUSER=--ovs-user=${OVS_USER_ID}" > /run/openvswitch/useropts; fi'
+EnvironmentFile=-/run/openvswitch/useropts
+ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
+ --no-ovs-vswitchd --no-monitor --system-id=random \
+ ${OVSUSER} \
+ start $OPTIONS
+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
+RuntimeDirectory=openvswitch
+RuntimeDirectoryMode=0755
CERTIFICATE="db:Open_vSwitch,SSL,certificate"
BOOTSTRAP_CA_CERT="db:Open_vSwitch,SSL,ca_cert"
+# Default user
+OVS_USER_ID="root:root"
+
# Alternative path for the database (default is /etc/openvswitch/conf.db)
# DATABASE="/etc/openvswitch/conf.db"
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
newinitd "${FILESDIR}/ovsdb-server-r1" ovsdb-server
newinitd "${FILESDIR}/ovs-vswitchd-r1" ovs-vswitchd
- systemd_dounit "${FILESDIR}/ovsdb-server.service"
- systemd_dounit "${FILESDIR}/ovs-vswitchd.service"
+ systemd_newunit "${FILESDIR}/ovsdb-server2.service" ovsdb-server.service
+ systemd_newunit "${FILESDIR}/ovs-vswitchd2.service" ovs-vswitchd.service
+ systemd_newunit rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service ovs-delete-transient-ports.service
systemd_newtmpfilesd "${FILESDIR}/openvswitch.tmpfiles" openvswitch.conf
insinto /etc/logrotate.d
fi
done
+ # only needed on non-systemd, but helps anyway
elog "Use the following command to create an initial database for ovsdb-server:"
elog " emerge --config =${CATEGORY}/${PF}"
elog "(will create a database in /var/lib/openvswitch/conf.db)"