From fea2a95bd93b8d09de3d8e47b16e9344185e36a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= Date: Thu, 18 Sep 2025 12:49:15 +0200 Subject: [PATCH] Use systemd-tmpfiles for /var/spool/at directories Replace RPM scriptlets with systemd-tmpfiles to create /var/spool/at structure, fixing Image Mode compatibility and bootc container lint warnings. Resolves: RHEL-110320 --- at-tmpfiles.conf | 7 +++++++ at.spec | 28 ++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 at-tmpfiles.conf diff --git a/at-tmpfiles.conf b/at-tmpfiles.conf new file mode 100644 index 0000000..914985e --- /dev/null +++ b/at-tmpfiles.conf @@ -0,0 +1,7 @@ +# at - Tmpfiles configuration for at daemon +# Create /var/spool/at directory structure for the at daemon + +d /var/spool/at 0700 root root - - +d /var/spool/at/spool 0700 root root - - +f /var/spool/at/.SEQ 0600 root root - - + diff --git a/at.spec b/at.spec index 5b89172..9c82efc 100644 --- a/at.spec +++ b/at.spec @@ -3,7 +3,7 @@ Summary: Job spooling tools Name: at Version: 3.2.5 -Release: 13%{?dist} +Release: 14%{?dist} # http://packages.debian.org/changelogs/pool/main/a/at/current/copyright # + install-sh is MIT license with changes under Public Domain License: GPL-3.0-or-later AND GPL-2.0-or-later AND ISC @@ -12,6 +12,7 @@ URL: http://ftp.debian.org/debian/pool/main/a/at Source: http://software.calhariz.com/at/at_%{version}.orig.tar.gz # git upstream source git://git.debian.org/git/collab-maint/at.git Source1: pam_atd +Source2: at-tmpfiles.conf Source3: atd.sysconf Source5: atd.systemd @@ -38,6 +39,7 @@ BuildRequires: flex flex-static bison autoconf BuildRequires: libselinux-devel >= 1.27.9 BuildRequires: perl(Test::Harness) BuildRequires: perl(Test::More) +BuildRequires: systemd-rpm-macros %if %{with pam} BuildRequires: pam-devel @@ -115,18 +117,24 @@ install -m 644 %{SOURCE3} %{buildroot}/etc/sysconfig/atd mkdir -p %{buildroot}/%{_unitdir}/ install -m 644 %{SOURCE5} %{buildroot}/%{_unitdir}/atd.service +# install tmpfiles configuration +mkdir -p %{buildroot}%{_tmpfilesdir} +install -m 644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/at.conf + # remove unpackaged files from the buildroot rm -r %{buildroot}%{_prefix}/doc +# Remove .SEQ file created by make install - tmpfiles will create it +rm -f %{buildroot}%{_localstatedir}/spool/at/.SEQ %check make test %post -touch %{_localstatedir}/spool/at/.SEQ -chmod 600 %{_localstatedir}/spool/at/.SEQ -chown root:root %{_localstatedir}/spool/at/.SEQ %systemd_post atd.service +# Create directories and files using tmpfiles +%tmpfiles_create at.conf + %preun %systemd_preun atd.service @@ -151,10 +159,10 @@ chown root:root %{_localstatedir}/spool/at/.SEQ %doc README timespec ChangeLog %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/at.deny %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/atd -%attr(0700,root,root) %dir %{_localstatedir}/spool/at -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %{_localstatedir}/spool/at/.SEQ -%attr(0700,root,root) %dir %{_localstatedir}/spool/at/spool %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/atd +%attr(0700,root,root) %dir %{_localstatedir}/spool/at +%attr(0700,root,root) %dir %{_localstatedir}/spool/at/spool +%{_tmpfilesdir}/at.conf %{_sbindir}/atrun %attr(0755,root,root) %{_sbindir}/atd %{_mandir}/man*/* @@ -162,10 +170,14 @@ chown root:root %{_localstatedir}/spool/at/.SEQ %{_bindir}/atrm %{_bindir}/atq %attr(4755,root,root) %{_bindir}/at -%{_datadir}/at/batch-job +%{_datadir}/at/ %attr(0644,root,root) /%{_unitdir}/atd.service %changelog +* Fri Sep 19 2025 Ondřej Pohořelský - 3.2.5-14 +- Use systemd-tmpfiles for /var/spool/at directories +- Resolves: RHEL-110320 + * Mon Jun 30 2025 Ondřej Pohořelský - 3.2.5-13 - Add patch to fix past date handling - Resolves: RHEL-100334