+if [ $1 -eq 1 ]; then
+ getent passwd openvswitch >/dev/null || \
+ useradd -r -d / -s /sbin/nologin -c "Open vSwitch Daemons" openvswitch
+
+ 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
+