From ac480f5e95d5ce9cf4eea323313f5d015281c4496f137f57b2d0a176f382c302 Mon Sep 17 00:00:00 2001 From: Reinhard Max Date: Mon, 7 Jun 2021 11:01:00 +0000 Subject: [PATCH] Accepting request 896868 from home:gmbr3:Active - Change to using systemd-sysusers - Remove otherproviders, not needed anymore OBS-URL: https://build.opensuse.org/request/show/896868 OBS-URL: https://build.opensuse.org/package/show/network:time/chrony?expand=0&rev=99 --- chrony.changes | 6 ++++++ chrony.spec | 20 ++++++++++++-------- system-user-chrony.conf | 2 ++ 3 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 system-user-chrony.conf diff --git a/chrony.changes b/chrony.changes index c00f0fa..6f32bfc 100644 --- a/chrony.changes +++ b/chrony.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 2 09:10:41 UTC 2021 - Callum Farmer + +- Change to using systemd-sysusers +- Remove otherproviders, not needed anymore + ------------------------------------------------------------------- Tue Jun 1 12:53:23 UTC 2021 - Reinhard Max diff --git a/chrony.spec b/chrony.spec index c360ade..c91d5be 100644 --- a/chrony.spec +++ b/chrony.spec @@ -45,6 +45,7 @@ Source10: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/c Source11: chrony-tmpfiles Source12: pool.conf.suse Source13: pool.conf.opensuse +Source14: system-user-chrony.conf Source99: series # PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch0: chrony-config.patch @@ -65,10 +66,10 @@ BuildRequires: pps-tools-devel BuildRequires: timezone BuildRequires: pkgconfig(systemd) BuildRequires: rubygem(asciidoctor) +BuildRequires: sysuser-tools Recommends: logrotate Requires(post): %fillup_prereq -Requires(pre): %{_sbindir}/groupadd -Requires(pre): %{_sbindir}/useradd +%sysusers_requires Requires: %name-pool Recommends: %name-pool-nonempty Provides: ntp-daemon @@ -105,7 +106,7 @@ Summary: Chrony preconfiguration for SUSE Group: Productivity/Networking/Other Provides: %name-pool = %version Provides: %name-pool-nonempty -Conflicts: otherproviders(%name-pool) +Conflicts: %name-pool Requires: %name = %version BuildArch: noarch RemovePathPostfixes: .suse @@ -119,7 +120,7 @@ Summary: Chrony preconfiguration for openSUSE Group: Productivity/Networking/Other Provides: %name-pool = %version Provides: %name-pool-nonempty -Conflicts: otherproviders(%name-pool) +Conflicts: %name-pool Requires: %name = %version BuildArch: noarch Supplements: (chrony and branding-openSUSE) @@ -133,7 +134,7 @@ default. Summary: Empty pool preconfiguration for chrony Group: Productivity/Networking/Other Provides: %name-pool = %version -Conflicts: otherproviders(%name-pool) +Conflicts: %name-pool Requires: %name = %version BuildArch: noarch Supplements: (chrony and branding-SLE) @@ -183,6 +184,7 @@ export LDFLAGS="-pie -Wl,-z,relro,-z,now" --with-sendmail=%{_sbindir}/sendmail \ --enable-ntp-signd make %{?_smp_mflags} all docs +%sysusers_generate_pre %{SOURCE14} chrony %install %make_install @@ -229,6 +231,9 @@ touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc} install -Dpm 644 %{SOURCE12} %{SOURCE13} %{buildroot}/etc/chrony.d touch %{buildroot}/etc/chrony.d/pool.conf.empty +mkdir -p %{buildroot}%{_sysusersdir} +install -m 0644 %{SOURCE14} %{buildroot}%{_sysusersdir}/ + %if %{with testsuite} %ifnarch %ix86 %check @@ -240,9 +245,7 @@ make %{?_smp_mflags} check %endif %endif -%pre -getent group %{name} >/dev/null || groupadd -r %{name} -getent passwd %{name} >/dev/null || useradd -r -g %{name} -d "%{_localstatedir}/lib/chrony" -s /bin/false -c "Chrony Daemon" %{name} +%pre -f chrony.pre %service_add_pre chronyd.service chrony-wait.service %preun @@ -268,6 +271,7 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d "%{_localstatedir}/ %dir %{_sysconfdir}/dhcp/ %dir %{_sysconfdir}/dhcp/dhclient.d/ %{_sysconfdir}/dhcp/dhclient.d/chrony.sh +%{_sysusersdir}/system-user-chrony.conf %{_bindir}/chronyc %{_sbindir}/chronyd %{_libexecdir}/%name diff --git a/system-user-chrony.conf b/system-user-chrony.conf new file mode 100644 index 0000000..0ddfc02 --- /dev/null +++ b/system-user-chrony.conf @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u chrony - "Chrony Daemon" /var/lib/chrony -