Initial commit
This commit is contained in:
17
chrony/10-main.conf
Normal file
17
chrony/10-main.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
# Time drift stats history
|
||||
driftfile /var/lib/chrony/drift
|
||||
|
||||
# Log here
|
||||
logdir /var/log/chrony
|
||||
|
||||
# Lock process in memory, disable swapping
|
||||
lock_all
|
||||
|
||||
# For quickier time sync during boot-up process
|
||||
makestep 1.0 3
|
||||
|
||||
# Sync time to system clock
|
||||
rtcsync
|
||||
|
||||
# No remote control/monitoring
|
||||
cmdport 0
|
||||
1
chrony/50-sources.conf
Normal file
1
chrony/50-sources.conf
Normal file
@@ -0,0 +1 @@
|
||||
pool pool.ntp.org iburst
|
||||
20
chrony/README
Normal file
20
chrony/README
Normal file
@@ -0,0 +1,20 @@
|
||||
chrony is a versatile implementation of the Network Time Protocol (NTP). It can
|
||||
synchronise the system clock with NTP servers, reference clocks (e.g. GPS
|
||||
receiver), and manual input using wristwatch and keyboard. It can also operate
|
||||
as an NTPv4 (RFC 5905) server and peer to provide a time service to other
|
||||
computers in the network.
|
||||
|
||||
It is designed to perform well in a wide range of conditions, including
|
||||
intermittent network connections, heavily congested networks, changing
|
||||
temperatures (ordinary computer clocks are sensitive to temperature), and
|
||||
systems that do not run continuosly, or run on a virtual machine.
|
||||
|
||||
Typical accuracy between two machines synchronised over the Internet is within
|
||||
a few milliseconds; on a LAN, accuracy is typically in tens of microseconds.
|
||||
With hardware timestamping, or a hardware reference clock, sub-microsecond
|
||||
accuracy may be possible.
|
||||
|
||||
Two programs are included in chrony, chronyd is a daemon that can be started
|
||||
at boot time and chronyc is a command-line interface program which can be used
|
||||
to monitor chronyd’s performance and to change various operating parameters
|
||||
whilst it is running.
|
||||
119
chrony/chrony.SlackBuild
Normal file
119
chrony/chrony.SlackBuild
Normal file
@@ -0,0 +1,119 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Slackware build script for chrony
|
||||
|
||||
# Copyright 2015-2018 Richard Ellis (USA)
|
||||
# Copyright 2020 Sergei Fedosoff <eleksir@gmail.com>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=chrony
|
||||
VERSION=${VERSION:-4.2}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_EXs}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i586 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/EXs}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i586" ]; then
|
||||
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \+ -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
|
||||
|
||||
CC=${CC:-gcc} \
|
||||
CFLAGS="$SLKCFLAGS -flto -rdynamic" \
|
||||
CXXFLAGS="$SLKCFLAGS -flto -rdynamic" \
|
||||
LDFLAGS="-flto -rdynamic -Wl,--export-dynamic -Wl,-E -Wl,--no-as-needed -Wl,-O2 -Wl,-s" \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--mandir=/usr/man \
|
||||
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
||||
--with-user=ntp \
|
||||
--enable-ntp-signd \
|
||||
--with-pidfile=/run/chrony/chrony.pid \
|
||||
--with-hwclockfile=/etc/adjtime \
|
||||
--with-rtcdevice=/dev/rtc \
|
||||
--chronyvardir=/var/lib/chrony \
|
||||
--chronyrundir=/run/chrony \
|
||||
--with-sendmail=/usr/sbin/sendmail
|
||||
|
||||
make -j$(nproc)
|
||||
make install DESTDIR=$PKG
|
||||
|
||||
install -Dpm 0644 $CWD/chrony.conf $PKG/etc/chrony.conf.new
|
||||
install -Dpm 0644 $CWD/10-main.conf $PKG/etc/chrony.d/10-main.conf.new
|
||||
install -Dpm 0644 $CWD/50-sources.conf $PKG/etc/chrony.d/50-sources.conf.new
|
||||
install -Dpm 0644 $CWD/rc.chrony $PKG/etc/rc.d/rc.chrony.new
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
find $PKG/usr/man -type f -exec gzip -9 {} \+
|
||||
|
||||
for i in $( find $PKG/usr/man -type l ); do
|
||||
ln -s $( readlink $i ).gz $i.gz
|
||||
rm $i
|
||||
done
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a contrib/ examples/ COPYING FAQ INSTALL NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
||||
1
chrony/chrony.conf
Normal file
1
chrony/chrony.conf
Normal file
@@ -0,0 +1 @@
|
||||
confdir /etc/chrony.d
|
||||
10
chrony/chrony.info
Normal file
10
chrony/chrony.info
Normal file
@@ -0,0 +1,10 @@
|
||||
PRGNAM="chrony"
|
||||
VERSION="4.2"
|
||||
HOMEPAGE="https://chrony.tuxfamily.org/"
|
||||
DOWNLOAD="https://download.tuxfamily.org/chrony/chrony-4.2.tar.gz"
|
||||
MD5SUM="07282f8e76a4399d6c17009bb6345614"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
MAINTAINER="Sergei Fedosoff"
|
||||
EMAIL="eleksir@gmail.com"
|
||||
25
chrony/doinst.sh
Normal file
25
chrony/doinst.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
config() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
if [ ! -r $OLD ]; then
|
||||
mv $NEW $OLD
|
||||
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
||||
rm $NEW
|
||||
fi
|
||||
}
|
||||
|
||||
preserve_perms() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
if [ -e $OLD ]; then
|
||||
cp -a $OLD ${NEW}.incoming
|
||||
cat $NEW > ${NEW}.incoming
|
||||
mv ${NEW}.incoming $NEW
|
||||
fi
|
||||
config $NEW
|
||||
}
|
||||
|
||||
config etc/chrony.conf.new
|
||||
config etc/chrony.d/10-main.conf.new
|
||||
config etc/chrony.d/50-sources.conf.new
|
||||
preserve_perms etc/rc.d/rc.chrony.new
|
||||
86
chrony/rc.chrony
Normal file
86
chrony/rc.chrony
Normal file
@@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
DAEMON=/usr/sbin/chronyd
|
||||
RUNDIR=/run/chrony
|
||||
VARDIR=/var/lib/chrony
|
||||
LOGDIR=/var/log/chrony
|
||||
PIDFILE=${RUNDIR}/chrony.pid
|
||||
USER=ntp
|
||||
GROUP=ntp
|
||||
|
||||
# Start/stop/restart chrony daemon.
|
||||
__start() {
|
||||
if [ -e $RUNDIR ]; then
|
||||
chown -R ${USER}:${GROUP} $RUNDIR
|
||||
else
|
||||
install -dm 0750 -o $USER -g $GROUP $RUNDIR
|
||||
fi
|
||||
|
||||
if [ -e $VARDIR ]; then
|
||||
chown -R ${USER}:${GROUP} $VARDIR
|
||||
else
|
||||
install -dm 0755 -o $USER -g $GROUP $VARDIR
|
||||
fi
|
||||
|
||||
if [ -e $LOGDIR ]; then
|
||||
chown -R ${USER}:${GROUP} $LOGDIR
|
||||
else
|
||||
install -dm 0755 -o $USER -g $GROUP $LOGDIR
|
||||
fi
|
||||
|
||||
if [ -e ${VARDIR}/drift ]; then
|
||||
:
|
||||
else
|
||||
touch ${VARDIR}/drift
|
||||
fi
|
||||
|
||||
chown ${USER}:${GROUP} ${VARDIR}/drift
|
||||
|
||||
if [ -x $DAEMON ]; then
|
||||
echo "Starting NTP daemon: $DAEMON -m"
|
||||
$DAEMON -m
|
||||
fi
|
||||
}
|
||||
|
||||
__stop() {
|
||||
echo "Stopping NTP daemon: $DAEMON -m"
|
||||
if [ -r $PIDFILE ]; then
|
||||
kill $(cat $PIDFILE)
|
||||
else
|
||||
echo "Chronyd is not running"
|
||||
fi
|
||||
}
|
||||
|
||||
__restart() {
|
||||
__stop
|
||||
|
||||
for i in 1 2 3; do
|
||||
if [ -r $PIDFILE ]; then
|
||||
# ash/dash/nash builtin echo just ignoring -n option
|
||||
/usr/bin/echo -n "."
|
||||
sleep 1
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
__start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'start')
|
||||
__start
|
||||
;;
|
||||
'stop')
|
||||
__stop
|
||||
;;
|
||||
'restart')
|
||||
__restart
|
||||
;;
|
||||
*)
|
||||
echo "usage $0 start|stop|restart"
|
||||
esac
|
||||
19
chrony/slack-desc
Normal file
19
chrony/slack-desc
Normal file
@@ -0,0 +1,19 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
chrony: chrony (maintains accuracy of the real time clock via NTP)
|
||||
chrony:
|
||||
chrony: chrony is a versatile implementation of the Network Time Protocol.
|
||||
chrony: It can synchronise the system clock with NTP servers, reference
|
||||
chrony: clocks (e.g. GPS receiver), and manual input using wristwatch and
|
||||
chrony: keyboard. It can also operate as an NTPv4 (RFC 5905) server and peer
|
||||
chrony: to provide a time service to other computers in the network.
|
||||
chrony:
|
||||
chrony: Homepage: https://chrony.tuxfamily.org/
|
||||
chrony:
|
||||
chrony:
|
||||
Reference in New Issue
Block a user