Use systemd-sysusers for frr user and frrvty group
This complies with the new guidelines on user/group creation Reference: https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/#_dynamic_allocation
This commit is contained in:
parent
7880ef80b4
commit
9f5eed940b
4
frr-sysusers.conf
Normal file
4
frr-sysusers.conf
Normal 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
|
14
frr.spec
14
frr.spec
@ -11,6 +11,7 @@ License: GPLv2+
|
|||||||
URL: http://www.frrouting.org
|
URL: http://www.frrouting.org
|
||||||
Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
|
Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
|
||||||
Source1: %{name}-tmpfiles.conf
|
Source1: %{name}-tmpfiles.conf
|
||||||
|
Source2: %{name}-sysusers.conf
|
||||||
|
|
||||||
Patch0000: 0000-remove-babeld-and-ldpd.patch
|
Patch0000: 0000-remove-babeld-and-ldpd.patch
|
||||||
Patch0001: 0001-use-python3.patch
|
Patch0001: 0001-use-python3.patch
|
||||||
@ -50,11 +51,13 @@ BuildRequires: readline
|
|||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
BuildRequires: systemd-devel
|
BuildRequires: systemd-devel
|
||||||
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: texinfo
|
BuildRequires: texinfo
|
||||||
|
|
||||||
Requires: ncurses
|
Requires: ncurses
|
||||||
Requires: net-snmp
|
Requires: net-snmp
|
||||||
Requires(post): hostname
|
Requires(post): hostname
|
||||||
|
%{?sysusers_requires_compat}
|
||||||
Requires(post): systemd
|
Requires(post): systemd
|
||||||
Requires(postun): systemd
|
Requires(postun): systemd
|
||||||
Requires(preun): systemd
|
Requires(preun): systemd
|
||||||
@ -113,6 +116,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/{frr,rc.d/init.d,sysconfig,logrotate.d,pam.d
|
|||||||
|
|
||||||
mkdir -p -m 0755 %{buildroot}%{_libdir}/frr
|
mkdir -p -m 0755 %{buildroot}%{_libdir}/frr
|
||||||
mkdir -p %{buildroot}%{_tmpfilesdir}
|
mkdir -p %{buildroot}%{_tmpfilesdir}
|
||||||
|
mkdir -p %{buildroot}%{_sysusersdir}
|
||||||
|
|
||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
@ -120,6 +124,7 @@ mkdir -p %{buildroot}%{_tmpfilesdir}
|
|||||||
rm -rf %{buildroot}%{_infodir}/dir
|
rm -rf %{buildroot}%{_infodir}/dir
|
||||||
|
|
||||||
install -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
install -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
||||||
|
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
|
||||||
install -p -m 644 tools/etc/frr/daemons %{buildroot}%{_sysconfdir}/frr/daemons
|
install -p -m 644 tools/etc/frr/daemons %{buildroot}%{_sysconfdir}/frr/daemons
|
||||||
install -p -m 644 tools/frr.service %{buildroot}%{_unitdir}/frr.service
|
install -p -m 644 tools/frr.service %{buildroot}%{_unitdir}/frr.service
|
||||||
install -p -m 755 tools/frrinit.sh %{buildroot}%{frr_libdir}/frr
|
install -p -m 755 tools/frrinit.sh %{buildroot}%{frr_libdir}/frr
|
||||||
@ -138,11 +143,8 @@ rm %{buildroot}%{_libdir}/frr/*.so
|
|||||||
rm -r %{buildroot}%{_includedir}/frr/
|
rm -r %{buildroot}%{_includedir}/frr/
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
getent group frrvty >/dev/null 2>&1 || groupadd -r frrvty >/dev/null 2>&1 || :
|
%sysusers_create_compat %{SOURCE2}
|
||||||
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
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%systemd_post frr.service
|
%systemd_post frr.service
|
||||||
@ -200,11 +202,13 @@ fi
|
|||||||
%dir %{_datadir}/yang
|
%dir %{_datadir}/yang
|
||||||
%{_datadir}/yang/*.yang
|
%{_datadir}/yang/*.yang
|
||||||
%{_tmpfilesdir}/%{name}.conf
|
%{_tmpfilesdir}/%{name}.conf
|
||||||
|
%{_sysusersdir}/%{name}.conf
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Jul 07 2021 Neal Gompa <ngompa@datto.com> - 7.5.1-5
|
* Wed Jul 07 2021 Neal Gompa <ngompa@datto.com> - 7.5.1-5
|
||||||
- Clean up the spec file for legibility and modern spec standards
|
- Clean up the spec file for legibility and modern spec standards
|
||||||
- Remove unneeded info scriptlets
|
- Remove unneeded info scriptlets
|
||||||
|
- Use systemd-sysusers for frr user and frrvty group
|
||||||
|
|
||||||
* Wed Jul 07 2021 Michal Ruprich <mruprich@redhat.com> - 7.5.1-4
|
* Wed Jul 07 2021 Michal Ruprich <mruprich@redhat.com> - 7.5.1-4
|
||||||
- Rebuild for newer abseil-cpp
|
- Rebuild for newer abseil-cpp
|
||||||
|
Loading…
Reference in New Issue
Block a user