diff --git a/davmail.spec b/davmail.spec index 9a0bdf9a..a7cdef25 100644 --- a/davmail.spec +++ b/davmail.spec @@ -109,6 +109,7 @@ install -D -m 644 src/init/davmail.service %{buildroot}%{_unitdir}/davmail.servi install -D -m 644 src/init/davmail@.service %{buildroot}%{_unitdir}/davmail@.service install -D -m 644 src/init/davmail-user.service %{buildroot}%{_userunitdir}/davmail.service install -D -m 644 src/init/daivmail.conf %{buildroot}%{_tmpfilesdir}/davmail.conf +install -D -m 644 src/init/daivmail_sysusers.conf %{buildroot}%{_sysusersdir}/davmail.conf %else install -m 0775 src/init/davmail-init $RPM_BUILD_ROOT%{_sysconfdir}/init.d/davmail ln -sf %{_sysconfdir}/init.d/davmail $RPM_BUILD_ROOT%{_sbindir}/rcdavmail @@ -132,10 +133,11 @@ install -m 0644 src/appstream/org.davmail.DavMail.appdata.xml $RPM_BUILD_ROOT%{_ rm -rf $RPM_BUILD_ROOT %pre +%if 0%{!?systemd_macros:1} /usr/sbin/groupadd -f -r davmail > /dev/null 2>&1 || : /usr/sbin/useradd -r -s /sbin/nologin -d /var/lib/davmail -M \ -g davmail davmail > /dev/null 2>&1 || : -%if %systemd_macros +%else %service_add_pre davmail.service %endif @@ -230,6 +232,7 @@ fi - Create initial log file with systemd-tmpfiles - Harden systemd service - Add systemd system sevice template unit +- Don't create user for systemd units use sysusers * Wed Jul 07 2021 Michal Suchanek - Tumbleweed no longer supports init.d services and fails build when installed diff --git a/src/init/davmail_sysusers.conf b/src/init/davmail_sysusers.conf new file mode 100644 index 00000000..a23c1629 --- /dev/null +++ b/src/init/davmail_sysusers.conf @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u davmail - "DavMail Exchange and Office 365 Gateway" - -