]> git.hoellein.online Git - zenbook/commitdiff
committing changes in /etc after apt run
authorroot <root@localhost>
Thu, 2 May 2019 18:39:01 +0000 (20:39 +0200)
committerroot <root@localhost>
Thu, 2 May 2019 18:39:01 +0000 (20:39 +0200)
Package changes:
+ntpdate 1:4.2.8p10+dfsg-5ubuntu7.1 amd64

.etckeeper
default/ntpdate [new file with mode: 0644]
dhcp/dhclient-exit-hooks.d/ntpdate [new file with mode: 0644]
logcheck/ignore.d.server/ntpdate [new file with mode: 0644]
network/if-up.d/ntpdate [new file with mode: 0755]

index 6443cad2dfb94b8a3593240c95c9cfba00ee7c45..e1bf27734821283acb2687e9ce574bd817eef449 100755 (executable)
@@ -1279,6 +1279,7 @@ maybe chmod 0644 'default/networkd-dispatcher'
 maybe chmod 0644 'default/networking'
 maybe chmod 0644 'default/nss'
 maybe chmod 0644 'default/ntp'
+maybe chmod 0644 'default/ntpdate'
 maybe chmod 0644 'default/openvpn'
 maybe chmod 0644 'default/psad'
 maybe chmod 0644 'default/qemu-kvm'
@@ -1304,6 +1305,7 @@ maybe chmod 0644 'dhcp/dhclient-enter-hooks.d/resolvconf'
 maybe chmod 0755 'dhcp/dhclient-enter-hooks.d/resolved'
 maybe chmod 0755 'dhcp/dhclient-exit-hooks.d'
 maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/ntp'
+maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/ntpdate'
 maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes'
 maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/timesyncd'
 maybe chmod 0755 'dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd'
@@ -1949,6 +1951,7 @@ maybe chmod 0644 'logcheck/ignore.d.paranoid/cracklib-runtime'
 maybe chmod 0755 'logcheck/ignore.d.server'
 maybe chmod 0644 'logcheck/ignore.d.server/gpg-agent'
 maybe chmod 0644 'logcheck/ignore.d.server/libsasl2-modules'
+maybe chmod 0644 'logcheck/ignore.d.server/ntpdate'
 maybe chmod 0644 'logcheck/ignore.d.server/rkhunter'
 maybe chmod 0644 'logcheck/ignore.d.server/rsyslog'
 maybe chmod 0644 'login.defs'
@@ -2074,6 +2077,7 @@ maybe chmod 0755 'network/if-up.d/avahi-autoipd'
 maybe chmod 0755 'network/if-up.d/avahi-daemon'
 maybe chmod 0755 'network/if-up.d/ethtool'
 maybe chmod 0755 'network/if-up.d/ip'
+maybe chmod 0755 'network/if-up.d/ntpdate'
 maybe chmod 0755 'network/if-up.d/openssh-server'
 maybe chmod 0755 'network/if-up.d/openvpn'
 maybe chmod 0755 'network/if-up.d/postfix'
diff --git a/default/ntpdate b/default/ntpdate
new file mode 100644 (file)
index 0000000..f239b18
--- /dev/null
@@ -0,0 +1,13 @@
+# The settings in this file are used by the program ntpdate-debian, but not
+# by the upstream program ntpdate.
+
+# Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
+# so you only have to keep it in one place.
+NTPDATE_USE_NTP_CONF=yes
+
+# List of NTP servers to use  (Separate multiple servers with spaces.)
+# Not used if NTPDATE_USE_NTP_CONF is yes.
+NTPSERVERS="ntp.ubuntu.com"
+
+# Additional options to pass to ntpdate
+NTPOPTIONS=""
diff --git a/dhcp/dhclient-exit-hooks.d/ntpdate b/dhcp/dhclient-exit-hooks.d/ntpdate
new file mode 100644 (file)
index 0000000..09ab605
--- /dev/null
@@ -0,0 +1,45 @@
+NTPDATE_CONF=/etc/default/ntpdate
+NTPDATE_DHCP_CONF=/run/ntpdate.dhcp
+
+
+ntp_servers_setup_remove() {
+       rm -f $NTPDATE_DHCP_CONF
+}
+
+
+ntp_servers_setup_add() {
+       if [ -e $NTPDATE_DHCP_CONF ] && [ "$new_ntp_servers" = "$old_ntp_servers" ]; then
+               return
+       fi
+
+       if [ -z "$new_ntp_servers" ]; then
+               ntp_servers_setup_remove
+               return
+       fi
+
+       tmp=$(mktemp "$NTPDATE_DHCP_CONF.XXXXXX") || return
+       chmod --reference=$NTPDATE_CONF $tmp
+       chown --reference=$NTPDATE_CONF $tmp
+
+       (
+         echo "# NTP server entries received from DHCP server"
+         echo "NTPSERVERS='$new_ntp_servers'"
+       ) >>$tmp
+       
+       mv $tmp $NTPDATE_DHCP_CONF
+}
+
+
+ntp_servers_setup() {
+       case $reason in
+               BOUND|RENEW|REBIND|REBOOT)
+                       ntp_servers_setup_add
+                       ;;
+               EXPIRE|FAIL|RELEASE|STOP)
+                       ntp_servers_setup_remove
+                       ;;
+       esac
+}
+
+
+ntp_servers_setup
diff --git a/logcheck/ignore.d.server/ntpdate b/logcheck/ignore.d.server/ntpdate
new file mode 100644 (file)
index 0000000..bb65a51
--- /dev/null
@@ -0,0 +1 @@
+^\w{3} [ :0-9]{11} [._[:alnum:]-]+ ntpdate\[[0-9]+\]: (adjust|step) time server [0-9.]{7,15} offset -?[0-9.]+ sec$
diff --git a/network/if-up.d/ntpdate b/network/if-up.d/ntpdate
new file mode 100755 (executable)
index 0000000..7fdc338
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# This is a heuristic:  The idea is that if a static interface is brought
+# up, that is a major event, and we can put in some extra effort to fix
+# the system time.  Feel free to change this, especially if you regularly
+# bring up new network interfaces.
+if [ "$METHOD" = static ]; then
+       OPTS="-b"
+fi
+
+if [ "$METHOD" = loopback ] || [ "$METHOD" = none ]; then
+       exit 0
+fi
+
+# Check whether ntpdate was removed but not purged; it's useless to wait for 
+# it in that case.
+if [ ! -x /usr/sbin/ntpdate-debian ] && [ -d /usr/sbin ]; then
+       exit 0
+fi
+
+(
+
+# This is for the case that /usr will be mounted later.
+if [ -r /lib/udev/hotplug.functions ]; then
+       . /lib/udev/hotplug.functions
+       wait_for_file /usr/sbin/ntpdate-debian
+fi
+
+# Avoid running more than one at a time
+flock -n /run/lock/ntpdate /usr/sbin/ntpdate-debian -s $OPTS 2>/dev/null || :
+
+) &