public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/chrony] rawhide: create ghosted directories by tmpfiles instead of chronyd service
@ 2026-08-18 12:35 Miroslav Lichvar
  0 siblings, 0 replies; only message in thread
From: Miroslav Lichvar @ 2026-08-18 12:35 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/chrony
            Branch : rawhide
            Commit : f3e16374df1e88498ebb87f649c8dcc0f459d548
            Author : Miroslav Lichvar <mlichvar@redhat.com>
            Date   : 2026-08-18T14:31:22+02:00
            Stats  : +9/-23 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/chrony/c/f3e16374df1e88498ebb87f649c8dcc0f459d548?branch=rawhide

            Log:
            create ghosted directories by tmpfiles instead of chronyd service

The /var/lib/chrony and /var/log/chrony directories specified in
tmpfiles.d will be created even if the chronyd service doesn't start
(same as before the directories got the rpm %ghost flag), which is
needed by the linuxptp timemaster service starting chronyd from its own
process and having the chrony lib dir in its ReadWritePaths.

---
diff --git a/chrony-servicedirs.patch b/chrony-servicedirs.patch
deleted file mode 100644
index e806dc9..0000000
--- a/chrony-servicedirs.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff -up chrony-4.7/examples/chronyd.service.servicedirs chrony-4.7/examples/chronyd.service
---- chrony-4.7/examples/chronyd.service.servicedirs	2025-06-11 15:06:19.000000000 +0200
-+++ chrony-4.7/examples/chronyd.service	2025-07-10 12:06:57.354215498 +0200
-@@ -10,7 +10,13 @@ Type=notify
- PIDFile=/run/chrony/chronyd.pid
- Environment="OPTIONS="
- EnvironmentFile=-/etc/sysconfig/chronyd
--ExecStart=/usr/sbin/chronyd -n $OPTIONS
-+ExecStart=!/usr/sbin/chronyd -n $OPTIONS
-+
-+User=chrony
-+LogsDirectory=chrony
-+LogsDirectoryMode=0750
-+StateDirectory=chrony
-+StateDirectoryMode=0750
- 
- CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
- CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_KILL CAP_LEASE CAP_LINUX_IMMUTABLE

diff --git a/chrony.spec b/chrony.spec
index d0eca08..50bc44b 100644
--- a/chrony.spec
+++ b/chrony.spec
@@ -20,13 +20,12 @@ Source1:        https://chrony-project.org/releases/chrony-%{version}%{?prerelea
 Source2:        https://chrony-project.org/gpgkey-8F375C7E8D0EE125A3D3BD51537E2B76F7680DAC.asc
 Source3:        chrony.dhclient
 Source4:        chrony.sysusers
+Source5:        chrony.tmpfiles
 # simulator for test suite
 Source10:       https://gitlab.com/chrony/clknetsim/-/archive/master/clknetsim-%{clknetsim_ver}.tar.gz
 
 # add distribution-specific bits to DHCP dispatcher
 Patch1:         chrony-nm-dispatcher-dhcp.patch
-# let systemd create /var/lib/chrony and /var/log/chrony
-Patch2:         chrony-servicedirs.patch
 
 BuildRequires:  libcap-devel libedit-devel nettle-devel pps-tools-devel
 BuildRequires:  gcc gcc-c++ make bison systemd gnupg2
@@ -69,7 +68,7 @@ md5sum -c <<-EOF | (! grep -v 'OK$')
         6a3178c4670de7de393d9365e2793740  examples/chrony.logrotate
         c3992e2f985550739cd1cd95f98c9548  examples/chrony.nm-dispatcher.dhcp
         4e85d36595727318535af3387411070c  examples/chrony.nm-dispatcher.onoffline
-        607c82f56639486f52c31105632909eb  examples/chronyd.service
+        274a44cd51981d6d4d3a44dfc92c94ab  examples/chronyd.service
         5ddbb8a8055f587cb6b0b462ca73ea46  examples/chronyd-restricted.service
 EOF
 
@@ -120,8 +119,7 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{sysconfig,logrotate.d}
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{lib,log}/chrony
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d
-mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
-mkdir -p $RPM_BUILD_ROOT%{_sysusersdir}
+mkdir -p $RPM_BUILD_ROOT{%{_libexecdir},%{_sysusersdir},%{_tmpfilesdir}}
 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/NetworkManager/dispatcher.d
 mkdir -p $RPM_BUILD_ROOT{%{_unitdir},%{_prefix}/lib/systemd/ntp-units.d}
 
@@ -144,6 +142,8 @@ install -m 644 -p examples/chrony-wait.service \
         $RPM_BUILD_ROOT%{_unitdir}/chrony-wait.service
 install -m 644 -p %{SOURCE4} \
         $RPM_BUILD_ROOT%{_sysusersdir}/chrony.conf
+install -m 644 -p %{SOURCE5} \
+        $RPM_BUILD_ROOT%{_tmpfilesdir}/chrony.conf
 
 cat > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/chronyd <<EOF
 # Command-line options for chronyd
@@ -199,6 +199,7 @@ fi
 %{_prefix}/lib/systemd/ntp-units.d/*.list
 %{_unitdir}/chrony*.service
 %{_sysusersdir}/chrony.conf
+%{_tmpfilesdir}/chrony.conf
 %{_mandir}/man[158]/%{name}*.[158]*
 %ghost %dir %attr(750,chrony,chrony) %{_localstatedir}/lib/chrony
 %ghost %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony/drift

diff --git a/chrony.tmpfiles b/chrony.tmpfiles
new file mode 100644
index 0000000..5b65f64
--- /dev/null
+++ b/chrony.tmpfiles
@@ -0,0 +1,3 @@
+#Type Path            Mode User   Group  Age Argument
+d     /var/lib/chrony 0750 chrony chrony -   -
+d     /var/log/chrony 0750 chrony chrony -   -

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-18 12:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-18 12:35 [rpms/chrony] rawhide: create ghosted directories by tmpfiles instead of chronyd service Miroslav Lichvar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox