/usr/sbin/adjtimexconfig is in adjtimex 1.29-7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | #!/bin/sh
conffile=/etc/default/adjtimex
startfile=/etc/init.d/adjtimex
tmpfile=/tmp/adjtimex.adjust
echo -n "Comparing clocks (this will take 70 sec)..."
# Get the parameters
/sbin/adjtimex --print --tick 0 >$tmpfile 2>/dev/null
baseline=$(awk '/<= tick/{print ($1+$NF)/2}' $tmpfile)
hz=$(awk '/USER_HZ/{print $3}' $tmpfile)
/sbin/adjtimex --tick $baseline --frequency 0
/sbin/adjtimex --adjust --force-adjust >$tmpfile
echo "done."
ticks=$(tail -n 1 $tmpfile|awk '{print $6}')
freq=$(tail -n 1 $tmpfile|awk '{print $7}')
# cat $tmpfile
# echo hz=$hz baseline=$baseline ticks=$ticks freq=$freq
rm $tmpfile
adjt=$(awk "BEGIN{print (($ticks-$baseline)*$hz + $freq/65536.)*.0864}")
echo -n "Adjusting system time by ${adjt} sec/day to agree with CMOS clock..."
# Recreate $conffile if necessary
if [ -f $conffile ]; then
# echo "using existing $conffile";
true;
else
cat >$conffile <<EOF
# $conffile - configuration file for adjtimex(8)
#
# you may adjust these values manually or by calling /usr/sbin/adjtimexconfig
#
# This file is sourced by $startfile
#
TICK=$TICK
FREQ=$FREQ
EOF
fi
# Reset values in $conffile
sed -e "s/^TICK=.*/TICK=$ticks/" \
-e "s/^FREQ=.*/FREQ=$freq/" \
$conffile >$conffile.TMP && \
mv $conffile.TMP $conffile
# grep "TICK=" /etc/init.d/adjtimex | cut -d'#' -f1 > /tmp/adj.tick
# grep "FREQ=" /etc/init.d/adjtimex | cut -d'#' -f1 > /tmp/adj.freq
#
# TICKLINE="$(echo -n "TICK="$ticks" # old: "; cat /tmp/adj.tick)"
# FREQLINE="$(echo -n "FREQ="$freq" # old: "; cat /tmp/adj.freq)"
#
# cp /etc/init.d/adjtimex /etc/init.d/adjtimex.TMP
# sed -e "s/^TICK=.*/$TICKLINE/" -e "s/^FREQ=.*/$FREQLINE/" \
# < /etc/init.d/adjtimex.TMP > /etc/init.d/adjtimex
#
# if [ -s /etc/init.d/adjtimex ]
# then
# rm -f /etc/init.d/adjtimex.TMP
# fi
# rm -f /tmp/adj.tick /tmp/adj.freq $tmpfile
echo "done."
|