Additional information can be found in :doc:`general`.
+.. note::
+ If you are running using the Fedora or Red Hat package, the Open vSwitch
+ daemon will run as a non-root user. This implies that you must have a
+ working IOMMU. Visit the `RHEL README`__ for additional information.
+
+__ https://github.com/openvswitch/ovs/blob/master/rhel/README.RHEL.rst
+
Setup
-----
IETF NSH draft - https://datatracker.ietf.org/doc/draft-ietf-sfc-nsh/
- Fedora Packaging:
* OVN services are no longer restarted automatically after upgrade.
+ * ovs-vswitchd and ovsdb-server run as non-root users by default.
- Add --cleanup option to command 'ovs-appctl exit' (see ovs-vswitchd(8)).
- L3 tunneling:
* Use new tunnel port option "packet_type" to configure L2 vs. L3.
running.
+Non-root User Support
+-----------------------
+Fedora and RHEL support running the Open vSwitch daemons as a non-root user.
+By default, a fresh installation will create an *openvswitch* user, along
+with any additional support groups needed (such as *hugetlbfs* for DPDK
+support).
+
+This is controlled by modifying the ``OVS_USER_ID`` option. Setting this
+to 'root:root', or commenting the variable out will revert this behavior.
+
+
Reporting Bugs
--------------
Requires(post): /usr/bin/getent
Requires(post): /usr/sbin/useradd
Requires(post): /usr/bin/sed
+%if %{with dpdk}
+Requires(post): /usr/sbin/usermod
+Requires(post): /usr/sbin/groupadd
+%endif
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch
+%if %{with dpdk}
+ getent group hugetlbfs >/dev/null || \
+ groupadd hugetlbfs
+ usermod -a -G hugetlbfs openvswitch
+ sed -i \
+ 's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs"@'\
+ /etc/sysconfig/openvswitch
+%endif
+
# In the case of upgrade, this is not needed.
chown -R openvswitch:openvswitch /etc/openvswitch
fi
[Service]
Type=forking
Restart=on-failure
+Environment=HOME=/var/run/openvswitch
EnvironmentFile=/etc/openvswitch/default.conf
EnvironmentFile=-/etc/sysconfig/openvswitch
+@begin_dpdk@
+ExecStartPre=/usr/bin/chown :hugetlbfs /dev/hugepages
+ExecStartPre=/usr/bin/chmod 0775 /dev/hugepages
+@end_dpdk@
ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
--no-ovsdb-server --no-monitor --system-id=random \
--ovs-user=${OVS_USER_ID} \