committing changes in /etc made by "apt install ntp"

Packages with configuration changes:
+ntp 1:4.2.8p15+dfsg-1 armhf

Package changes:
+libevent-core-2.1-7 2.1.12-stable-1 armhf
+libevent-pthreads-2.1-7 2.1.12-stable-1 armhf
+libopts25 1:5.18.16-4 armhf
+ntp 1:4.2.8p15+dfsg-1 armhf
+sntp 1:4.2.8p15+dfsg-1 armhf
This commit is contained in:
2021-12-01 13:23:48 +01:00
parent 93f791975d
commit 1a5fdc7d59
23 changed files with 378 additions and 0 deletions
+15
View File
@@ -62,6 +62,9 @@ maybe chmod 0644 'ImageMagick-6/type-ghostscript.xml'
maybe chmod 0644 'ImageMagick-6/type-urw-base35.xml'
maybe chmod 0644 'ImageMagick-6/type-windows.xml'
maybe chmod 0644 'ImageMagick-6/type.xml'
maybe chmod 0755 'NetworkManager'
maybe chmod 0755 'NetworkManager/dispatcher.d'
maybe chmod 0755 'NetworkManager/dispatcher.d/ntp'
maybe chmod 0755 'X11'
maybe chmod 0755 'X11/Xsession.d'
maybe chmod 0644 'X11/Xsession.d/20dbus_xdg-runtime'
@@ -70,10 +73,17 @@ maybe chmod 0755 'X11/xkb'
maybe chmod 0644 'adduser.conf'
maybe chmod 0755 'alternatives'
maybe chmod 0644 'alternatives/README'
maybe chmod 0755 'apparmor'
maybe chmod 0755 'apparmor.d'
maybe chmod 0755 'apparmor.d/local'
maybe chmod 0644 'apparmor.d/local/usr.bin.man'
maybe chmod 0644 'apparmor.d/local/usr.sbin.ntpd'
maybe chmod 0755 'apparmor.d/tunables'
maybe chmod 0644 'apparmor.d/tunables/ntpd'
maybe chmod 0644 'apparmor.d/usr.bin.man'
maybe chmod 0644 'apparmor.d/usr.sbin.ntpd'
maybe chmod 0755 'apparmor/init'
maybe chmod 0755 'apparmor/init/network-interface-security'
maybe chmod 0755 'apt'
maybe chmod 0755 'apt/apt.conf.d'
maybe chmod 0644 'apt/apt.conf.d/01autoremove'
@@ -163,6 +173,7 @@ maybe chmod 0755 'cron.daily/dpkg'
maybe chmod 0755 'cron.daily/etckeeper'
maybe chmod 0755 'cron.daily/logrotate'
maybe chmod 0755 'cron.daily/man-db'
maybe chmod 0755 'cron.daily/ntp'
maybe chmod 0755 'cron.hourly'
maybe chmod 0644 'cron.hourly/.placeholder'
maybe chmod 0755 'cron.hourly/fake-hwclock'
@@ -199,6 +210,7 @@ maybe chmod 0644 'default/netfilter-persistent'
maybe chmod 0644 'default/networking'
maybe chmod 0644 'default/nfs-common'
maybe chmod 0644 'default/nss'
maybe chmod 0644 'default/ntp'
maybe chmod 0644 'default/raspberrypi-kernel'
maybe chmod 0644 'default/rng-tools-debian'
maybe chmod 0644 'default/rpcbind'
@@ -213,6 +225,7 @@ maybe chmod 0644 'dhcp/debug'
maybe chmod 0755 'dhcp/dhclient-enter-hooks.d'
maybe chmod 0644 'dhcp/dhclient-enter-hooks.d/resolvconf'
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/rfc3442-classless-routes'
maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/timesyncd'
maybe chmod 0644 'dhcp/dhclient.conf'
@@ -355,6 +368,7 @@ maybe chmod 0755 'init.d/kmod'
maybe chmod 0755 'init.d/netfilter-persistent'
maybe chmod 0755 'init.d/networking'
maybe chmod 0755 'init.d/nfs-common'
maybe chmod 0755 'init.d/ntp'
maybe chmod 0755 'init.d/paxctld'
maybe chmod 0755 'init.d/procps'
maybe chmod 0755 'init.d/raspi-config'
@@ -474,6 +488,7 @@ maybe chmod 0644 'network/interfaces.new'
maybe chmod 0644 'networks'
maybe chmod 0755 'nftables.conf'
maybe chmod 0644 'nsswitch.conf'
maybe chmod 0644 'ntp.conf'
maybe chmod 0755 'opt'
maybe chmod 0644 'pam.conf'
maybe chmod 0755 'pam.d'
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
old_ntp_servers="unknown and invalid"
new_ntp_servers=$DHCP4_NTP_SERVERS
case "$2" in
up|vpn-up) reason=BOUND; ;;
down|vpn-down) reason=RELEASE; ;;
*) exit 0; ;;
esac
test -f /etc/dhcp/dhclient-exit-hooks.d/ntp || exit 0
. /etc/dhcp/dhclient-exit-hooks.d/ntp
View File
+15
View File
@@ -0,0 +1,15 @@
# vim:syntax=apparmor
# ------------------------------------------------------------------
#
# Copyright (C) 2002-2005 Novell/SUSE
# Copyright (C) 2011 Canonical, Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
#Add your ntpd devices here eg. if you have a DCF clock
# @{NTPD_DEVICE}="/dev/ttyS1"
@{NTPD_DEVICE}="/dev/null"
+86
View File
@@ -0,0 +1,86 @@
# vim:syntax=apparmor
# Updated for Ubuntu by: Jamie Strandboge <jamie@canonical.com>
# ------------------------------------------------------------------
#
# Copyright (C) 2002-2005 Novell/SUSE
# Copyright (C) 2009-2012 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
#include <tunables/global>
#include <tunables/ntpd>
/usr/sbin/ntpd flags=(attach_disconnected) {
#include <abstractions/base>
#include <abstractions/nameservice>
#include <abstractions/user-tmp>
capability ipc_lock,
capability net_bind_service,
capability setgid,
capability setuid,
capability sys_chroot,
capability sys_resource,
capability sys_time,
capability sys_nice,
# ntp uses AF_INET, AF_INET6 and AF_UNSPEC
network dgram,
network stream,
@{PROC}/net/if_inet6 r,
@{PROC}/*/net/if_inet6 r,
@{NTPD_DEVICE} rw,
# pps devices are almost exclusively used with NTP
/dev/pps[0-9]* rw,
/{,s}bin/ r,
/usr/{,s}bin/ r,
/usr/local/{,s}bin/ r,
/usr/sbin/ntpd rmix,
/etc/ntp.conf r,
/etc/ntp.conf.dhcp r,
/etc/ntpd.conf r,
/etc/ntpd.conf.tmp r,
/run/ntp.conf.dhcp r,
/etc/ntp.keys r,
/etc/ntp/** r,
/etc/ntp.drift rwl,
/etc/ntp.drift.TEMP rwl,
/etc/ntp/drift* rwl,
/var/lib/ntp/*drift rw,
/var/lib/ntp/*drift.TEMP rw,
/var/log/ntp w,
/var/log/ntp.log w,
/var/log/ntpd w,
/var/log/ntpstats/clockstats* rwl,
/var/log/ntpstats/loopstats* rwl,
/var/log/ntpstats/peerstats* rwl,
/var/log/ntpstats/protostats* rwl,
/var/log/ntpstats/rawstats* rwl,
/var/log/ntpstats/sysstats* rwl,
/{,var/}run/ntpd.pid w,
# to be able to check for running ntpdate
/run/lock/ntpdate wk,
# To sign replies to MS-SNTP clients by the smbd daemon /var/lib/samba
/var/lib/samba/ntp_signd/socket rw,
# For use with clocks that report via shared memory (e.g. gpsd),
# you may need to give ntpd access to all of shared memory, though
# this can be considered dangerous. See https://launchpad.net/bugs/722815
# for details. To enable, add this to local/usr.sbin.ntpd:
# capability ipc_owner,
# Site-specific additions and overrides. See local/README for details.
#include <local/usr.sbin.ntpd>
}
@@ -0,0 +1 @@
../../../apparmor.d/usr.sbin.ntpd
Executable
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
# The default Debian ntp.conf enables logging of various statistics to
# the /var/log/ntpstats directory. The daemon automatically changes
# to a new datestamped set of files at midnight, so all we need to do
# is delete old ones, and compress the ones we're keeping so disk
# usage is controlled.
statsdir=$(cat /etc/ntp.conf | grep -v '^#' | sed -nr 's/^statsdir[[:space:]]+([^[:space:]]+).*$/\1/p')
if [ -n "$statsdir" ] && [ -d "$statsdir" ]; then
# only keep a week's depth of these. Delete only files exactly
# within the directory and do not descend into subdirectories
# to avoid security risks on platforms where find is not using
# fts-library.
find "$statsdir" -maxdepth 1 -type f -name "*stats*" -mtime +7 -delete
# compress whatever is left to save space but make sure to really
# do it only in the expected directory.
cd "$statsdir" || exit 1
ls -d -- *stats.???????? > /dev/null 2>&1
if [ $? -eq 0 ]; then
# Note that gzip won't compress the file names that
# are hard links to the live/current files, so this
# compresses yesterday and previous, leaving the live
# log alone. We suppress the warnings gzip issues
# about not compressing the linked file.
gzip --best --quiet -- *stats.????????
return=$?
case $return in
2)
exit 0 # squash all warnings
;;
*)
exit $return # but let real errors through
;;
esac
fi
fi
+1
View File
@@ -0,0 +1 @@
NTPD_OPTS='-g'
+64
View File
@@ -0,0 +1,64 @@
NTP_CONF=/etc/ntp.conf
NTP_DHCP_CONF=/run/ntp.conf.dhcp
ntp_server_restart() {
invoke-rc.d ntp try-restart
}
ntp_servers_setup_remove() {
if [ ! -e $NTP_DHCP_CONF ]; then
return
fi
rm -f $NTP_DHCP_CONF
ntp_server_restart
}
ntp_servers_setup_add() {
if [ -e $NTP_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 "$NTP_DHCP_CONF.XXXXXX") || return
chmod --reference=$NTP_CONF $tmp
chown --reference=$NTP_CONF $tmp
(
echo "# This file was copied from $NTP_CONF with the server options changed"
echo "# to reflect the information sent by the DHCP server. Any changes made"
echo "# here will be lost at the next DHCP event. Edit $NTP_CONF instead."
echo
echo "# NTP server entries received from DHCP server"
for server in $new_ntp_servers; do
echo "server $server iburst"
done
echo
sed '/^[[:space:]]*\(server\|peer\|pool\)[[:space:]]/d' $NTP_CONF
) >>$tmp
mv $tmp $NTP_DHCP_CONF
ntp_server_restart
}
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
+1
View File
@@ -57,3 +57,4 @@ gpio:x:997:pi
systemd-coredump:x:996:
wheel:x:1001:pi
docker:x:995:
ntp:x:114:
+1
View File
@@ -56,3 +56,4 @@ i2c:x:998:pi
gpio:x:997:pi
systemd-coredump:x:996:
wheel:x:1001:pi
docker:x:995:
+1
View File
@@ -57,3 +57,4 @@ gpio:!::pi
systemd-coredump:!*::
wheel:!::pi
docker:!::
ntp:!::
+1
View File
@@ -56,3 +56,4 @@ i2c:!::pi
gpio:!::pi
systemd-coredump:!*::
wheel:!::pi
docker:!::
Executable
+72
View File
@@ -0,0 +1,72 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: ntp
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Start NTP daemon
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions
DAEMON=/usr/sbin/ntpd
PIDFILE=/var/run/ntpd.pid
test -x $DAEMON || exit 0
if [ -r /etc/default/ntp ]; then
. /etc/default/ntp
fi
if [ -e /run/ntp.conf.dhcp ]; then
NTPD_OPTS="$NTPD_OPTS -c /run/ntp.conf.dhcp"
fi
RUNASUSER=ntp
UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true
if test "$(uname -s)" = "Linux"; then
NTPD_OPTS="$NTPD_OPTS -u $UGID"
fi
case $1 in
start)
log_daemon_msg "Starting NTP server" "ntpd"
if [ -z "$UGID" ]; then
log_failure_msg "user \"$RUNASUSER\" does not exist"
exit 1
fi
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping NTP server" "ntpd"
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --retry=TERM/30/KILL/5 --exec $DAEMON
log_end_msg $?
rm -f $PIDFILE
;;
restart|force-reload)
$0 stop && sleep 2 && $0 start
;;
try-restart)
if $0 status >/dev/null; then
$0 restart
else
exit 0
fi
;;
reload)
exit 3
;;
status)
status_of_proc $DAEMON "NTP server"
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 2
;;
esac
+60
View File
@@ -0,0 +1,60 @@
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Leap seconds definition provided by tzdata
leapfile /usr/share/zoneinfo/leap-seconds.list
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
pool 0.debian.pool.ntp.org iburst
pool 1.debian.pool.ntp.org iburst
pool 2.debian.pool.ntp.org iburst
pool 3.debian.pool.ntp.org iburst
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Needed for adding pool entries
restrict source notrap nomodify noquery
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
+1
View File
@@ -27,3 +27,4 @@ statd:x:106:65534::/var/lib/nfs:/usr/sbin/nologin
sshd:x:107:65534::/run/sshd:/usr/sbin/nologin
avahi:x:108:113:Avahi mDNS daemon,,,:/run/avahi-daemon:/usr/sbin/nologin
systemd-coredump:x:996:996:systemd Core Dumper:/:/usr/sbin/nologin
ntp:x:109:114::/nonexistent:/usr/sbin/nologin
+2
View File
@@ -26,3 +26,5 @@ _rpc:x:105:65534::/run/rpcbind:/usr/sbin/nologin
statd:x:106:65534::/var/lib/nfs:/usr/sbin/nologin
sshd:x:107:65534::/run/sshd:/usr/sbin/nologin
avahi:x:108:113:Avahi mDNS daemon,,,:/run/avahi-daemon:/usr/sbin/nologin
systemd-coredump:x:996:996:systemd Core Dumper:/:/usr/sbin/nologin
ntp:x:109:114::/nonexistent:/usr/sbin/nologin
+1
View File
@@ -0,0 +1 @@
../init.d/ntp
+1
View File
@@ -0,0 +1 @@
../init.d/ntp
+1
View File
@@ -0,0 +1 @@
../init.d/ntp
+1
View File
@@ -0,0 +1 @@
../init.d/ntp
+1
View File
@@ -0,0 +1 @@
/lib/systemd/system/ntp.service
+1
View File
@@ -0,0 +1 @@
/dev/null