Resolves: #2095404 - frr use systemd-sysusers

This commit is contained in:
Michal Ruprich 2022-06-14 09:37:25 +02:00
parent 9e42da4fec
commit fc9c8e6add
2 changed files with 14 additions and 6 deletions

4
frr-sysusers.conf Normal file
View File

@ -0,0 +1,4 @@
#Type Name ID GECOS Home directory Shell
g frrvty -
u frr - "FRRouting routing suite" /var/run/frr /sbin/nologin
m frr frrvty

View File

@ -5,12 +5,13 @@
Name: frr
Version: 8.2.2
Release: 3%{?checkout}%{?dist}
Release: 4%{?checkout}%{?dist}
Summary: Routing daemon
License: GPLv2+
URL: http://www.frrouting.org
Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-tmpfiles.conf
Source2: frr-sysusers.conf
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison >= 2.7
@ -126,6 +127,8 @@ install -p -m 644 redhat/frr.logrotate %{buildroot}/etc/logrotate.d/frr
install -p -m 644 redhat/frr.pam %{buildroot}/etc/pam.d/frr
install -d -m 775 %{buildroot}/run/frr
install -p -D -m 0644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysusersdir}/frr.conf
# Delete libtool archives
find %{buildroot} -type f -name "*.la" -delete -print
@ -134,11 +137,8 @@ rm %{buildroot}%{_libdir}/frr/*.so
rm -r %{buildroot}%{_includedir}/frr/
%pre
getent group frrvty >/dev/null 2>&1 || groupadd -r frrvty >/dev/null 2>&1 || :
getent group frr >/dev/null 2>&1 || groupadd -r frr >/dev/null 2>&1 || :
getent passwd frr >/dev/null 2>&1 || useradd -M -r -g frr -s /sbin/nologin \
-c "FRRouting routing suite" -d %{_localstatedir}/run/frr frr || :
usermod -aG frrvty frr
%sysusers_create_compat %{SOURCE2}
exit 0
%post
%systemd_post frr.service
@ -205,8 +205,12 @@ make check PYTHON=%{__python3}
%dir /usr/share/yang
/usr/share/yang/*.yang
%{_tmpfilesdir}/%{name}.conf
%{_sysusersdir}/frr.conf
%changelog
* Tue Jun 14 2022 Michal Ruprich - 8.2.2-4
- Resolves: #2095404 - frr use systemd-sysusers
* Tue May 24 2022 Michal Ruprich <mruprich@redhat.com> - 8.2.2-3
- Resolves: #2081304 - Enhanced TMT testing for centos-stream