]> git.pld-linux.org Git - packages/ntp.git/commitdiff
- move drift to ntp user writable /var/lib/ntp
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 29 Jan 2010 07:41:57 +0000 (07:41 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ntp.conf -> 1.12
    ntp.spec -> 1.122

ntp.conf
ntp.spec

index 794c474dad237aa296c8f010e4e07b75313999f8..e6dcf264e6854bd89a1e1aa44914c6ae9cb24e6d 100644 (file)
--- a/ntp.conf
+++ b/ntp.conf
@@ -40,7 +40,7 @@ fudge 127.127.1.0 stratum 10
 # by creating a temporary in the same directory and then rename()'ing
 # it to the file.
 #
-driftfile /etc/ntp/drift
+driftfile /var/lib/ntp/drift
 multicastclient                        # listen on default 224.0.1.1
 broadcastdelay 0.008
 
index 1791517a9a0f4733eecee9c8c3da0f1fb5b5ee5d..b674638b5611527127331b222a5f8a58505bcba5 100644 (file)
--- a/ntp.spec
+++ b/ntp.spec
@@ -4,7 +4,7 @@ Summary(pl.UTF-8):      Narzędzia do synchronizacji czasu (Network Time Protocol)
 Summary(pt_BR.UTF-8):  Network Time Protocol versão 4
 Name:          ntp
 Version:       4.2.4p8
-Release:       3.6
+Release:       3.14
 License:       distributable
 Group:         Daemons
 Source0:       http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
@@ -264,9 +264,12 @@ cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
 cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
 cp -a man/*.1  $RPM_BUILD_ROOT%{_mandir}/man1
 
+install -d $RPM_BUILD_ROOT/var/lib/ntp
+touch $RPM_BUILD_ROOT/var/lib/ntp/drift
+
 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
 #!/bin/sh
-/sbin/service ntpdate cronsettime
+exec /sbin/service ntpdate cronsettime
 EOF
 
 %clean
@@ -284,7 +287,7 @@ rm -rf $RPM_BUILD_ROOT
 if [ "$1" = "0" ]; then
        %service ntpd stop
        /sbin/chkconfig --del ntpd
-       rm -f %{_sysconfdir}/drift
+       rm -f /var/lib/ntp/drift
 fi
 
 %postun -n ntp
@@ -313,7 +316,18 @@ if [ "$1" = "0" ]; then
        %groupremove ntp
 fi
 
+%triggerpostun -n ntpd -- ntpd < 4.2.4p8-3.14
+sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
+mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift
+mv -f /etc/ntp/drift /var/lib/ntp/drift
+%service -q ntpd restart
+
 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.1
+sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
+mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift
+mv -f /etc/ntp/drift /var/lib/ntp/drift
+%service -q ntpd restart
+
 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
        cp -f /etc/sysconfig/ntpdate{,.rpmnew}
@@ -342,6 +356,9 @@ fi
 %{_mandir}/man1/ntptime.1*
 %{_mandir}/man1/sntp.1*
 
+%dir %attr(770,root,ntp) /var/lib/ntp
+%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
+
 %files -n ntpdate
 %defattr(644,root,root,755)
 %doc COPYRIGHT
This page took 0.08863 seconds and 4 git commands to generate.