]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
ntp: Fix ownership of "/var/lib/ntp".
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 14 Apr 2013 15:55:31 +0000 (17:55 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 14 Apr 2013 15:55:31 +0000 (17:55 +0200)
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

index 2c97eeef805ac94a932875a150288523aa3ff4b3..9c8bb566698de4e88b2f04e072e094fb86e71be9 100644 (file)
@@ -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