public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/chrony] rawhide: create ghosted directories by tmpfiles instead of chronyd service
Date: Tue, 18 Aug 2026 12:35:37 GMT	[thread overview]
Message-ID: <178705653794.1.14870777632162382042.rpms-chrony-f3e16374df1e@fedoraproject.org> (raw)

            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 -   -

                 reply	other threads:[~2026-08-18 12:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178705653794.1.14870777632162382042.rpms-chrony-f3e16374df1e@fedoraproject.org \
    --to=mlichvar@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox