From 359e71fdf057920f505406d9ceaf89b7056cbdcd Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sun, 14 Apr 2013 17:55:31 +0200 Subject: [PATCH] ntp: Fix ownership of "/var/lib/ntp". The folder had the wrong owernship, so ntpd was not able to write to the containing file which may causes troubles and a lot of warnings in the log files. --- ntp/ntp.nm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ntp/ntp.nm b/ntp/ntp.nm index 2c97eeef8..9c8bb5666 100644 --- a/ntp/ntp.nm +++ b/ntp/ntp.nm @@ -6,7 +6,7 @@ name = ntp version = %{ver_major}.6p5 ver_major = 4.2 -release = 1 +release = 2 groups = System/Daemons url = http://www.ntp.org/ @@ -41,6 +41,9 @@ build ln -svf ../ntpstat-0.2 . %{MACRO_PATCHES} + + # Create ntp user and group. + %{create_user} end configure_options += \ @@ -116,9 +119,18 @@ build mkdir -pv %{unitdir}/ntp-units.d echo "ntpd.service" > %{unitdir}/ntp-units.d/60-ntpd.list + + # Fix ownership. + chown -R ntp:ntp %{BUILDROOT}%{sharedstatedir}/ntp end end +create_user + getent group ntp >/dev/null || groupadd -g 38 ntp || : + getent passwd ntp >/dev/null || useradd -u 38 -g 38 -s /sbin/nologin \ + -M -r -d %{sysconfdir}/ntp ntp || : +end + packages package %{name} requires @@ -162,9 +174,7 @@ packages end script prein - getent group ntp >/dev/null || groupadd -g 38 ntp || : - getent passwd ntp >/dev/null || useradd -u 38 -g 38 -s /sbin/nologin \ - -M -r -d %{sysconfdir}/ntp ntp || : + %{create_user} end script postin -- 2.47.3