From 802ccbaf9d96c438d36a6ac2f8bcb0c4ad8cf063 Mon Sep 17 00:00:00 2001 From: zhouwenpei Date: Mon, 28 Aug 2023 15:19:52 +0800 Subject: [PATCH] clean up openswitch group and user --- openvswitch.spec | 36 +++++------------------------------- openvswitch.sysusers | 3 --- 2 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 openvswitch.sysusers diff --git a/openvswitch.spec b/openvswitch.spec index 7b09085..e7e23ca 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -13,11 +13,10 @@ Name: openvswitch Summary: Open vSwitch daemon/database/utilities URL: https://www.openvswitch.org/ Version: 2.17.5 -Release: 4 +Release: 5 License: ASL 2.0 and LGPLv2+ and SISSL Source0: https://www.openvswitch.org/releases/%{name}-%{version}.tar.gz -Source1: openvswitch.sysusers Patch0000: 0000-openvswitch-add-stack-protector-strong.patch Patch0002: 0002-Remove-unsupported-permission-names.patch @@ -188,8 +187,6 @@ install -d -m 0755 $RPM_BUILD_ROOT/run/openvswitch install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch -install -p -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysusersdir}/openvswitch.conf - install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \ $RPM_BUILD_ROOT%{_udevrulesdir}/91-vfio.rules @@ -305,28 +302,7 @@ done fi %endif -%pre -if ! getent group openvswith > /dev/null; then - groupadd --system openvswith -fi - -if ! getent passwd openvswith > /dev/null; then - useradd --system -g openvswith openvswith -fi - %post -%{_sbindir}/update-alternatives --install %{_sbindir}/ovs-vswitchd \ - ovs-vswitchd %{_sbindir}/ovs-vswitchd.nodpdk 10 -if [ $1 -eq 1 ]; then - sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch - - sed -i \ - 's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="root:root"@'\ - /etc/sysconfig/openvswitch -fi -chown -R openvswitch:openvswitch /etc/openvswitch -sed -i '/^\[Service\]/ a\Slice=system-ovs.slice' /usr/lib/systemd/system/ovs-vswitchd.service - %if 0%{?systemd_post:1} %systemd_post %{name}.service %else @@ -337,9 +313,6 @@ sed -i '/^\[Service\]/ a\Slice=system-ovs.slice' /usr/lib/systemd/system/ovs-vsw %endif %postun -if [ $1 -eq 0 ] ; then - %{_sbindir}/update-alternatives --remove ovs-vswitchd %{_sbindir}/ovs-vswitchd.nodpdk -fi %if 0%{?systemd_postun:1} %systemd_postun %{name}.service %else @@ -409,7 +382,6 @@ fi %endif %files -%defattr(-,openvswitch,openvswitch) %dir %{_sysconfdir}/openvswitch %{_sysconfdir}/openvswitch/default.conf %config %ghost %verify(not owner group md5 size mtime) %{_sysconfdir}/openvswitch/conf.db @@ -448,13 +420,15 @@ fi %{_udevrulesdir}/91-vfio.rules %doc LICENSE NOTICE README.rst NEWS rhel/README.RHEL.rst /var/lib/openvswitch -%attr(750,openvswitch,openvswitch) %verify(not owner group) /var/log/openvswitch +/var/log/openvswitch %ghost %attr(755,root,root) %verify(not owner group) /run/openvswitch %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs -%{_sysusersdir}/openvswitch.conf %changelog +* Mon Aug 28 2023 zhouwenpei - 2.17.5-5 +- sync pulls/150: clean up openswitch group and user + * Thu Aug 10 2023 zhangpan - 2.17.5-4 - fix build fail diff --git a/openvswitch.sysusers b/openvswitch.sysusers deleted file mode 100644 index 9a464c2..0000000 --- a/openvswitch.sysusers +++ /dev/null @@ -1,3 +0,0 @@ -#Type Name ID GECOS Home directory Shell -u openvswitch - "Open vSwitch Daemons" / /sbin/nologin -m openvswitch hugetlbfs -- Gitee