Create amavis user with systemd sysusers

This commit is contained in:
Juan Orti Alcaine 2021-10-26 14:36:47 +02:00
commit f5f12fa9c7
2 changed files with 10 additions and 6 deletions

View file

@ -3,7 +3,7 @@
Summary: Email filter with virus scanner and spamassassin support
Name: amavis
Version: 2.12.2
Release: 1%{?dist}
Release: 2%{?dist}
# LDAP schema is GFDL, some helpers are BSD, core is GPLv2+
License: GPLv2+ and BSD and GFDL
URL: https://gitlab.com/amavis/amavis
@ -14,6 +14,7 @@ Source5: README.quarantine
Source8: amavisd-tmpfiles.conf
Source9: amavisd.service
Source10: amavisd-snmp.service
Source11: amavis.sysusers
Patch0: amavis-2.12.1-conf.patch
BuildArch: noarch
%if 0%{?fedora}
@ -179,12 +180,10 @@ mkdir -p %{buildroot}%{_rundir}/{clamd.amavisd,amavisd}
install -D -m 644 %{SOURCE8} %{buildroot}%{_tmpfilesdir}/amavisd.conf
install -p -D -m 0644 %{SOURCE11} %{buildroot}%{_sysusersdir}/amavis.conf
%pre
getent group amavis > /dev/null || %{_sbindir}/groupadd -r amavis
getent passwd amavis > /dev/null || \
%{_sbindir}/useradd -r -g amavis -d %{_localstatedir}/spool/amavisd -s /sbin/nologin \
-c "User for amavis" amavis
exit 0
%sysusers_create_compat %{SOURCE11}
%preun
%systemd_preun amavisd.service
@ -228,6 +227,7 @@ exit 0
%dir %attr(750,amavis,amavis) %{_localstatedir}/spool/amavisd/db
%dir %attr(750,amavis,amavis) %{_localstatedir}/spool/amavisd/quarantine
%{_tmpfilesdir}/amavisd.conf
%{_sysusersdir}/amavis.conf
%dir %attr(755,amavis,amavis) %{_rundir}/amavisd
%dir %attr(770,amavis,clamupdate) %{_rundir}/clamd.amavisd
@ -244,6 +244,9 @@ exit 0
%doc README_FILES test-messages amavisd.conf-* amavisd-custom.conf
%changelog
* Tue Oct 26 2021 Juan Orti Alcaine <jortialc@redhat.com> - 2.12.2-2
- Create amavis user with systemd sysusers
* Fri Oct 22 2021 Juan Orti Alcaine <jortialc@redhat.com> - 2.12.2-1
- Version 2.12.2 (#2013555)

1
amavis.sysusers Normal file
View file

@ -0,0 +1 @@
u amavis - "Amavis email content filter" /var/spool/amavisd