diff --git a/rpcbind.spec b/rpcbind.spec index 0676bb2..67ec55f 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -18,7 +18,7 @@ Conflicts: man-pages < 2.43-12 BuildRequires: make BuildRequires: automake, autoconf, libtool, systemd, systemd-devel BuildRequires: libtirpc-devel, quota-devel -Requires(pre): coreutils +Requires(pre): coreutils shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd coreutils @@ -45,11 +45,6 @@ RPC calls on a server on that machine. %prep %autosetup -p1 -# Create a sysusers.d config file -cat >rpcbind.sysusers.conf </dev/null || groupadd -f -g 32 -r rpc +if ! getent passwd rpc >/dev/null ; then + if ! getent passwd 32 >/dev/null ; then + useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind \ + -g rpc -M -s /sbin/nologin -o -u 32 rpc > /dev/null 2>&1 + else + useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind \ + -g rpc -M -s /sbin/nologin rpc > /dev/null 2>&1 + fi +fi %post %systemd_post rpcbind.service rpcbind.socket @@ -89,16 +96,15 @@ install -m0644 -D rpcbind.sysusers.conf %{buildroot}%{_sysusersdir}/rpcbind.conf %preun %systemd_preun rpcbind.service rpcbind.socket -# NOTE: We only restart rpcbind.socket in the %postun scriptlet in order to -# avoid the race described in: -# -# https://github.com/systemd/systemd/issues/13271 -# https://github.com/systemd/systemd/issues/8102 -# -# Restarting rpcbind.socket causes rpcbind.service to be restarted automatically -# due to "Requires=rpcbind.socket" in the rpcbind.service unit file. %postun -%systemd_postun_with_restart rpcbind.socket +%systemd_postun_with_restart rpcbind.service rpcbind.socket + +%triggerin -- rpcbind > 0.2.2-2.0 +if systemctl -q is-enabled rpcbind.socket +then + /bin/systemctl reenable rpcbind.socket >/dev/null 2>&1 || : + /bin/systemctl restart rpcbind.socket >/dev/null 2>&1 || : +fi %files %license COPYING @@ -115,30 +121,11 @@ install -m0644 -D rpcbind.sysusers.conf %{buildroot}%{_sysusersdir}/rpcbind.conf %{_unitdir}/%{name}.socket %{_tmpfilesdir}/%{name}.conf %attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir} -%{_sysusersdir}/rpcbind.conf %changelog * Sat Jul 26 2025 Steve Dickson 1.2.8-0 - Updated to latest upstream release: rpcbind-1_2_8 (bz 2300081) -* Fri Jul 25 2025 Fedora Release Engineering - 1.2.7-2.rc1.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Wed May 7 2025 Scott Mayhew - 1.2.7-2.rc1 -- Fix rpm scriptlets to remove excessive restarts during upgrade - -* Wed Jan 29 2025 Zbigniew Jędrzejewski-Szmek - 1.2.7-1.rc1.4 -- Add sysusers.d config file to allow rpm to create users/groups automatically - -* Sat Jan 18 2025 Fedora Release Engineering - 1.2.7-1.rc1.3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Tue Jan 14 2025 Panu Matilainen - 1.2.7-1.rc1.2 -- Add provides for the manually created rpc user and group - -* Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek - 1.2.7-1.rc1.1 -- Rebuilt for the bin-sbin merge (2nd attempt) - * Mon Sep 9 2024 Steve Dickson 1.2.8-rc1 - Updated to latest upstream RC release: rpcbind-1_2_8-rc1