diff options
Diffstat (limited to 'contrib/ntp/scripts/support')
23 files changed, 694 insertions, 0 deletions
diff --git a/contrib/ntp/scripts/support/README b/contrib/ntp/scripts/support/README new file mode 100644 index 000000000000..812965bd0955 --- /dev/null +++ b/contrib/ntp/scripts/support/README @@ -0,0 +1,73 @@ +The bin and etc directories contain several scripts (sh and perl) that +should ease startup and configuration of NTP sites. + + bin/monl is a monitoring script that prints out new, current and + old customers of an NTP timeserver when monitoring is + in effect. + monl has following options: + -i <regexp> (regular expression matchin IP addres to be ignored + -d <directory> where the current state is kept (default /tmp) + -v debug output + -n do not translate IP addresses into hostnames + <host> host to be analyzed + + monl uses xntpdc for information gathering and is thus + limited to the NTP version xntpdc is compiled for. + + bin/mvstats moves compresses and removes statistics files (useful mainly + for reference servers + + etc/install creates the locally needed directories for NTP (if not residung in /etc) + + etc/rc starts up daemon with configuration file and key file + etc/cron cron called monitor statistic (uses bin/monl) + etc/crontab crontab prototype for reference time servers + etc/setup sh script sourced by the other scripts for variable setup + +YOU MUST EDIT THESE FILES TO REFLECT YOUR LOCAL SETUP ! + +READ THIS BEFORE USING THE STARTUP SCRIPTS + +The startupscript etc/rc has been written for Suns and HPs. They are not +guaranteed to work elsewhere. Following assumptions have been made: + + All NTP related files reside in ONE directory having following structure: + + bin/* - all executables (daemon, control, date, scripts) + etc/* - startup scripts and cron scripts + conf/* - NTP configuration files + +The variable NTPROOT (etc/rc, etc/install) must be edited to reflect +the NTP directory (e.g. /usr/local/NTP) + +NTP config files are located via Suns arch command and have the name +conf/`arch`.`arch -k`. +These are the default configurations (usually clients). If a file with the name +conf/`arch`.`arch -k`.`hostname` is present this file will be preferred (Reference host, +gateway). If the arch command is not available no-arch is used. The arch command +is usually a shell script which echoes a string unique the the current machine +architecture. + +The tickadj command has its own conf/tickconf file which is used to set host +specific tickadj values. The line with DEFAULT specifies the default tickadj +parameters, all other lines consists of <hostname> <hostid> +<tickadj parameters>. These lines need only be entered if the specified host +needs parameters different from the default parameters. + +Reference clock support is provided for DCF77. If you need to initialize +certain things for reference clock support (e.g. loading STREAMS modules), +you need to edit etc/rc. + +The current config files of Erlangen are included in the conf directory. +They are just for reference, but might help you a bit in setting up a +synchronisation network. + +The advantage of keeping all config files centralized is the easier +administration. + +We replicate the NTP directory via NFS and rdist. + +When you have set up the local config files (YOUR OWN!) you can call +<NTPROOT>/etc/rc for daemon startup. + +For more information: time@informatik.uni-erlangen.de diff --git a/contrib/ntp/scripts/support/bin/monl b/contrib/ntp/scripts/support/bin/monl new file mode 100644 index 000000000000..f0c48dbf5f3f --- /dev/null +++ b/contrib/ntp/scripts/support/bin/monl @@ -0,0 +1,213 @@ +#!/local/bin/perl + +%service = ( 0, "unspec", + 1, "Active", + 2, "Passive", + 3, "Client", + 4, "Server", + 5, "Broadcast", + 6, "Control", + 7, "Private" ); +%nc = (); +@ignpat = (); +$noname = 0; +$verbose = 0; +$retries = 5; +$lastkey = 0; + +sub timedelta { + local($tm, $days, $h, $m, $s); + + $tm = @_[$[]; + $days = 0; + $days = sprintf("%dd+", $days) if $days = int($tm / (60*60*24)); + $days = "" unless $days; + $tm = $tm % (60*60*24); + $h = int($tm / (60*60)); + $tm = $tm % (60*60); + $m = int($tm / 60); + $s = $tm % 60; + + return sprintf("%s%02d:%02d:%02d", $days, $h, $m, $s); +} + +sub listentry { + local($host, $mode) = split("$;" , @_[$[]); + local($count, $version, $firsttime) = split("$;" , $_[$[+1]); + local($name); + + if (grep($host =~ m/$_/, @ignpat)) + { + print "ignored $host ...\n" if $verbose; + return; + } + + return if ! $count; + + if (defined($nc{$host})) + { + $name = $nc{$host}; + } + else + { + if ($noname) + { + $nc{$host} = $name = $host; + } + else + { + $name = (gethostbyaddr(pack("C4", split(/\./, $host)), 2))[$[]; + $nc{$host} = $name = $host if ! defined($name); + } + } + + printf ($fmt, ($lastkey eq $host) ? "" : $name, $service{$mode}, $count, $version, &timedelta($firsttime), $firsttime / $count); + + if (@_[$[+2]) + { + $hostcnt++ if $lastkey ne $host; + $packcnt += $count; + $maxtime = $firsttime if $firsttime > $maxtime; + } + + $lastkey = $host; +} + +while ($ARGV[$[] =~ /^-[nvid]$/) + { + if ($ARGV[$[] eq "-i") + { + shift; + push(@ignpat, shift) unless ! defined($ARGV[$[]); + } + elsif ($ARGV[$[] eq "-d") + { + shift; + $dir = shift unless ! defined($ARGV[$[]); + } + elsif ($ARGV[$[] eq "-n") + { + shift; + $noname = 1; + } + elsif ($ARGV[$[] eq "-v") + { + shift; + $verbose = 1; + } + } + +$dir = "/tmp" unless defined($dir); +$gone = 60*60*48; +$fmt = "%48s %10s %7d %7d %13s %14.3f\n"; +$sfmt = "%48s %10s %7s %7s %13s %14s\n"; +@lbl = ("Host", "Mode", "Count", "Version", "Time active", "Packetinterval"); + +if (!defined($ARGV[$[])) + { + $hostname = `hostname`; + chop($hostname); + unshift(@ARGV, $hostname); + } + +foreach $hostname (@ARGV) + { + $dbmfile = $dir . "/monlstats-" . $hostname; + $monl = "xntpdc -c 'hostnames no' -c monl $hostname | tail +3 |"; + $hostcnt = 0; + $packcnt = 0; + $maxtime = 0; + %Seen = (); + %New = (); + %Old = (); + + print "Monitor Status of $hostname\n\n"; + + $cnt = $retries; + do + { + open(MONL, $monl) || die("$monl failed $!"); + @monlout = <MONL>; + close(MONL); + } while (! @monlout && $cnt--); + + if (! @monlout) + { + print "not available.\n"; + next; + } + + dbmopen(Clients, $dbmfile, 0644) || die("dbmopen(.., $dbmfile, ...): $!"); + + foreach (@monlout) + { + chop; + split; + ($host, $count, $mode, $version, $lasttime, $firsttime) = + (@_[$[, $[+2 .. $[+4, $#_-1,$#_]); + + $Seen{$host, $mode} = 1; + + if (!defined($Clients{$host, $mode})) + { + if ($lasttime <= $gone) + { + ## got a new one + $Clients{$host, $mode} = $New{$host, $mode} = join("$;", $count, $version, $firsttime, $lasttime); + } + } + else + { + ## throw out the old ones + if ($lasttime > $gone) + { + $Old{$host, $mode} = $Clients{$host, $mode}; + delete $Clients{$host, $mode}; + } + else + { + $Clients{$host, $mode} = join("$;", $count, $version, $firsttime, $lasttime); + } + } + } + + grep(($Seen{$_} || ($Old{$_} = delete $Clients{$_})), keys(%Clients)); + + if (grep(($tmp = $_ , !grep($tmp =~ m/$_/, @ignpat)), keys(%New))) + { + print "New customers\n"; + print "-------------\n"; + printf $sfmt, @lbl; + grep( &listentry($_, $New{$_}, 1), sort(keys(%New)) ); + print "\n"; + } + + + if (grep((!defined($New{$_}) && ($tmp = $_, !grep($tmp =~ m/$_/, @ignpat))), keys(%Clients))) + { + print "Current customers\n"; + print "-----------------\n"; + printf $sfmt, @lbl; + grep( defined($New{$_}) || &listentry($_, $Clients{$_}, 1) , sort(keys(%Clients)) ); + print "\n"; + } + + if (grep(($tmp = $_, !grep($tmp =~ m/$_/, @ignpat)), keys(%Old))) + { + print "Discarded customers\n"; + print "-------------------\n"; + printf $sfmt, @lbl; + grep( &listentry($_, $Old{$_}, 0) , sort(keys(%Old)) ); + print "\n"; + } + + dbmclose(Clients); + + print "\nSummary:\n"; + print "--------\n"; + printf("Elapsed time: %13s\n", &timedelta($maxtime)); + printf(" Hosts: %13d\n", $hostcnt); + printf(" Packets: %13d\n", $packcnt); + printf(" Rate: %13.2f\n", $packcnt / $maxtime) if $maxtime; + print "\n"; + } diff --git a/contrib/ntp/scripts/support/bin/mvstats b/contrib/ntp/scripts/support/bin/mvstats new file mode 100644 index 000000000000..e33dc792e805 --- /dev/null +++ b/contrib/ntp/scripts/support/bin/mvstats @@ -0,0 +1,23 @@ +#!/bin/sh +# +# mvstats,v 3.1 1993/07/06 01:10:24 jbj Exp +# +# mvstats is called by cron for keeping the log files together +# usually only used on reference hosts +# +# Files reside in /var/NTP +# Files older than 2 days will be compressed, +# Files older than 64 days will be removed. +# +# mvstats,v +# Revision 3.1 1993/07/06 01:10:24 jbj +# XNTP release 3.1 +# +# +# Revision 1.1 1992/12/10 12:58:24 kardel +# Prerelease NTP V3 / DCF +# +# +cd /var/NTP +find . ! -name '*.Z' -mtime +2 -exec compress -f {} \; +find . -mtime +64 -exec rm -f {} \; diff --git a/contrib/ntp/scripts/support/conf/hp300.hp300 b/contrib/ntp/scripts/support/conf/hp300.hp300 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/hp300.hp300 diff --git a/contrib/ntp/scripts/support/conf/hp700.hp700 b/contrib/ntp/scripts/support/conf/hp700.hp700 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/hp700.hp700 diff --git a/contrib/ntp/scripts/support/conf/hp700.hp700.faui47 b/contrib/ntp/scripts/support/conf/hp700.hp700.faui47 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/hp700.hp700.faui47 diff --git a/contrib/ntp/scripts/support/conf/hp800.hp800 b/contrib/ntp/scripts/support/conf/hp800.hp800 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/hp800.hp800 diff --git a/contrib/ntp/scripts/support/conf/ntp.conf b/contrib/ntp/scripts/support/conf/ntp.conf new file mode 100644 index 000000000000..2d6bb8549c62 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/ntp.conf @@ -0,0 +1,3 @@ +# +# put your default configuration (e.g. broadcastclient) in here +# diff --git a/contrib/ntp/scripts/support/conf/sun3.sun3 b/contrib/ntp/scripts/support/conf/sun3.sun3 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun3.sun3 diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4.faui01 b/contrib/ntp/scripts/support/conf/sun4.sun4.faui01 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4.faui01 diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4.faui10 b/contrib/ntp/scripts/support/conf/sun4.sun4.faui10 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4.faui10 diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4.faui45 b/contrib/ntp/scripts/support/conf/sun4.sun4.faui45 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4.faui45 diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4c b/contrib/ntp/scripts/support/conf/sun4.sun4c new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4c diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4c.Lucifer b/contrib/ntp/scripts/support/conf/sun4.sun4c.Lucifer new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4c.Lucifer diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4m b/contrib/ntp/scripts/support/conf/sun4.sun4m new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4m diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4m.faui42 b/contrib/ntp/scripts/support/conf/sun4.sun4m.faui42 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4m.faui42 diff --git a/contrib/ntp/scripts/support/conf/sun4.sun4m.faui45m b/contrib/ntp/scripts/support/conf/sun4.sun4m.faui45m new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/sun4.sun4m.faui45m diff --git a/contrib/ntp/scripts/support/conf/tickconf b/contrib/ntp/scripts/support/conf/tickconf new file mode 100644 index 000000000000..b17dbe834743 --- /dev/null +++ b/contrib/ntp/scripts/support/conf/tickconf @@ -0,0 +1,19 @@ +DEFAULT -A -p -s -q +Lucifer 55406cfa -a 1 -p -s -q -t 10001 +faui45 24000f9b -a 1 -p -s -q +faui10 2440213c -a 1 -p -s -q +faui1b 54001418 -A -p -s -q -t 10001 +faui4p 5100344d -A -p -s -q -t 9999 +faui02g 1200be20 -A -p -s -q -t 9999 +faui02e 1200bbab -A -p -s -q -t 9999 +faui02f 1200bedb -A -p -s -q -t 9999 +faui03b 1200b92b -A -p -s -q -t 9999 +faui45m 726001ac -A -p -s -q -t 10001 +faui45o 72600272 -A -p -s -q -t 10001 +faui45p 7260028f -A -p -s -q -t 10001 +faui45r 72400cc7 -A -p -s -q -t 10001 +faui45s 726045be -A -p -s -q -t 10001 +faui45v 72604487 -A -p -s -q -t 10001 +faui45x 726044eb -A -p -s -q -t 10001 +faui45y 7260476d -A -p -s -q -t 10001 +faui45z 726045a1 -A -p -s -q -t 10001 diff --git a/contrib/ntp/scripts/support/etc/cron b/contrib/ntp/scripts/support/etc/cron new file mode 100644 index 000000000000..07ed18949835 --- /dev/null +++ b/contrib/ntp/scripts/support/etc/cron @@ -0,0 +1,18 @@ +#!/bin/sh +# +# cron,v 3.1 1993/07/06 01:10:50 jbj Exp +# +# called by cron for statistics gathering +# +# cron,v +# Revision 3.1 1993/07/06 01:10:50 jbj +# XNTP release 3.1 +# +# +# Revision 1.1 1992/12/10 12:59:18 kardel +# Prerelease NTP V3 / DCF +# +# +PATH="${PATH}:/local/NTP/bin" +export PATH +monl -d /local/NTP/monitor -i '127\.0\.0\.1' faui10 faui45 lucifer rackety.udel.edu diff --git a/contrib/ntp/scripts/support/etc/crontab b/contrib/ntp/scripts/support/etc/crontab new file mode 100644 index 000000000000..2b2d19ced76c --- /dev/null +++ b/contrib/ntp/scripts/support/etc/crontab @@ -0,0 +1,8 @@ +# +# NTP statistics periodic cleanup - REFERENCE SERVER ONLY +# +#55 23 * * * sh /local/NTP/etc/mvstats +# +# gather NTP client statistics - REFERENCE SERVER ONLY +# +0 8,18 * * * /local/NTP/etc/cron 2>/dev/null | /usr/ucb/mail -s "NTP statistics" time@informatik.uni-erlangen.de diff --git a/contrib/ntp/scripts/support/etc/install b/contrib/ntp/scripts/support/etc/install new file mode 100644 index 000000000000..169a7e5a06d7 --- /dev/null +++ b/contrib/ntp/scripts/support/etc/install @@ -0,0 +1,67 @@ +#!/bin/sh +# +# install,v 3.1 1993/07/06 01:10:53 jbj Exp +# +# install,v +# Revision 3.1 1993/07/06 01:10:53 jbj +# XNTP release 3.1 +# +# +# Revision 1.1 1992/12/10 12:59:21 kardel +# Prerelease NTP V3 / DCF +# +# Revision 1.1 1992/06/18 14:50:08 kardel +# Initial revision +# +# +NTPROOT=/local/NTP # SITE SPECIFIC: where NTP resides +# +# where the local NTP state files reside (xntp.drift) ussualle /etc +# this directory must not be shared as machine dependent data ist stored there +# +NTPDIR="/+private/local/NTP" +# +# get the initial setup +# +if [ ! -r $NTPROOT/etc/setup ]; then + echo "ERROR: $NTPROOT/etc/setup missing - incorrect installation." + exit 1 +else + . $NTPROOT/etc/setup +fi + +umask 022 # SITE SPECIFIC: local policy - watch out for NFS and "root" rights + +Mkdir() { + p="" + IFS="/" + set -- $@ + IFS=' +' + for pnc do + if [ ! -d "$p/$pnc" ]; then + ECHO -n "creating directory $p/$pnc" + if mkdir "$p/$pnc"; then + ECHO "" + else + ECHO " - FAILED" + break; + fi + fi + p="$p/$pnc" + done +} + +if [ ! -d "$NTPDIR" ]; then + ECHO "installing NTP private data area ($NTPDIR)" + if Mkdir "$NTPDIR"; then + chmod 755 "$NTPDIR" + ECHO "$NTPDIR created." + fi +else + ECHO "NTP already installed." + if [ -f "$NTPDIR/xntp.drift" ]; then + ECHO "currently saved drift value:" `cat "$NTPDIR/xntp.drift"` + fi +fi + diff --git a/contrib/ntp/scripts/support/etc/rc b/contrib/ntp/scripts/support/etc/rc new file mode 100644 index 000000000000..ef8834a69f7b --- /dev/null +++ b/contrib/ntp/scripts/support/etc/rc @@ -0,0 +1,198 @@ +#!/bin/sh +# NTP time synchronisation +# +# /src/NTP/REPOSITORY/v3/supportscripts/etc/rc,v 1.11 1993/07/09 13:17:00 kardel Exp +# +# rc,v +# Revision 1.11 1993/07/09 13:17:00 kardel +# local NTPROOT +# +# Revision 1.10 1993/07/09 11:37:29 kardel +# Initial restructured version + GPS support +# +# Revision 1.9 1993/06/23 14:10:36 kardel +# June 21st reconcilation +# +# Revision 1.7 1993/06/02 12:04:43 kardel +# May 28th reconcilation & clenaup +# +# +# non reference clock hosts will try to do an ntpdate on NTPSERVERS +# +NTPSERVERS="ntps1-0 ntps1-1 ntps2-0 ntps2-1" +NTPROOT=/local/NTP + +# +# get the initial setup +# +if [ ! -r $NTPROOT/etc/setup ]; then + echo "ERROR: $NTPROOT/etc/setup missing - incorrect installation." + exit 1 +else + . $NTPROOT/etc/setup +fi + +umask 022 # SITE SPECIFIC: local policy - watch out for NFS and "root" rights + +msg="" +# +# default configuration files are named $NTPROOT/conf/<ARCH>.<KARCH> +# +CF=$NTPROOT/conf/$ARCH.$KARCH # default configuration file +# +# Host specific config file (reference clocks) have the hostname tagged on +# +CFH="$CF"."$HOSTNAME" # specific configuration file +# +# where to find the tickadj command +# +KFIX=$NTPROOT/bin/tickadj # kernel variable fix +# +# where to find special tickadj parameters +# +TC=$NTPROOT/conf/tickconf # special tickadj parameters +# +# where to find the keys file (if not found $KEY.dumb will be used) +# +KEY=$NTPROOT/conf/ntp.keys # private key file +# +# the daemon +# +XD=$NTPROOT/bin/xntpd # NTP daemon +# +# HP adjtimed +# +ADJTIMED=$NTPROOT/bin/adjtimed # HP special (adjtime() emulation) +# +# ntpdate command +# +NTPDATE=$NTPROOT/bin/ntpdate + +# +# secondary timed support +# The word "TIMED" must be in the config file for timed to start +# Note that this times is a special version which does not ever set or +# adjust the time. Ask time@informatik.uni-erlangen.de for patches +# +TIMED=$NTPROOT/bin/timed # timed (Berkeley) secondary time service + # here used in a *HARMLESS* version + # to provide time to "inferior" systems +# +# ISREFHOST is a command that returns exit status 0 for a reference host +# Site specific: sample for dcf77 is given +# +ISREFHOST="[ -f $NTPROOT/.karch.$KARCH/sys/OBJ/parsestreams.o -a -f /dev/refclock-0 ]" +# +# SETUP_REFCLOCK +# +# what to do in order to set up a local reference clock +# usually this will load a STREAMS module or initialize other things +# needed +# +SETUP_REFCLOCK() { + if modstat | grep -s 'PARSE'; then + ECHO "loadable PARSER STREAMS module already loaded." + else + ECHO "attempting to load PARSER STREAMS module..." + MDLFILE="/tmp/mdl.$$" + if modload $NTPROOT/.karch.$KARCH/sys/OBJ/parsestreams.o -o $MDLFILE 2>&1; then + modstat + else + echo WARNING: load FAILED + fi | LOG + rm -f $MDLFILE + unset MDLFILE + fi +} + +kargs() { + MATCH=NO + HOSTID="`(hostid) 2>/dev/null || echo 000000`" + if [ -r "$TC" ]; then + exec 0< "$TC" + while [ "$MATCH" != "YES" ] && read HOST ID PARAM; do + if [ "$HOST" = "DEFAULT" ]; then + DEFAULT="$ID $PARAM" + else + if [ "$ID" = "$HOSTID" -o "$HOST" = "$HOSTNAME" ]; then + echo "$PARAM" + MATCH=YES + fi + fi + done + if [ "$MATCH" != "YES" ]; then + if [ -z "$DEFAULT" ]; then + echo "-A -p -s -q"; + else + echo "$DEFAULT"; + fi + fi + else + echo "-A -p -s -q"; + fi +} + +if [ -x $XD ]; then + if [ -x "$ADJTIMED" ]; then + $ADJTIMED && ECHO "adjusttimesupport: adjtimed." + fi + # + # WARNING: check ps command first, or you might kill things you don't want to + # + PID="`(ps -efa 2>/dev/null || ps auxww 2>/dev/null || echo "") | grep xntp | grep -v grep | awk '{ print $2 }'`" + + if [ ! -z "$PID" ]; then + ECHO "killing old NTP daemon (PID=$PID)" + # + # enable this after checking for correctness + # kill $PID + ECHO "should do a kill $PID, if this is the right PID - check rc script" + fi + # + # try an ntpdate when timeservers are configured + # + if [ ! -z "$NTPSERVERS" -a -x $NTPDATE ]; then + ECHO "NTP initial time setting" + $NTPDATE -v $NTPSERVERS | LOG + fi + # + # look for reference clock equipment + # + if $ISREFHOST; then + ECHO "REFERENCE CLOCK SUPPORT (initializing...)" + SETUP_REFCLOCK + fi + + if [ -r "$CFH" ]; then + CF="$CFH" + else + if [ ! -r "$KEY" ]; then + KEY="$KEY.dumb" + fi + fi + + ECHO "NTP configuration file: $CF" + ECHO -n "time daemon startup:" + + if [ -r "$CF" ]; then + if [ -x "$KFIX" ]; then + KARGS="`kargs`" + if [ ! -z "$KARGS" ]; then + $KFIX $KARGS && ECHO -n "tickadj $KARGS" + fi + fi + $XD -c "$CF" -k "$KEY" && ECHO -n ' xntpd' + if [ -x "$TIMED" ] && grep -s TIMED "$CF"; then + $TIMED -M -N && ECHO -n ' timed' + fi + else + msg="configuration file ($CF) not present." + fi +else + msg="daemon binary ($XD) not present." +fi +ECHO "." + +if [ "$msg" ]; then + NLECHO "WARNING: NO NTP time sychronisation: $msg" +fi diff --git a/contrib/ntp/scripts/support/etc/setup b/contrib/ntp/scripts/support/etc/setup new file mode 100644 index 000000000000..d4ea75ecfaa9 --- /dev/null +++ b/contrib/ntp/scripts/support/etc/setup @@ -0,0 +1,72 @@ +# +# setup,v 3.1 1993/07/06 01:10:55 jbj Exp +# +# /bin/sh sourced file for environment setup +# expects NTPROOT variable initialized +# +# if not set it will be initialized to /usr/local/NTP +# +# setup,v +# Revision 3.1 1993/07/06 01:10:55 jbj +# XNTP release 3.1 +# +# +# Revision 1.1 1992/12/10 12:59:25 kardel +# Prerelease NTP V3 / DCF +# +# Revision 1.1 1992/12/10 10:14:46 kardel +# Initial revision +# +# +NTPROOT=${NTPROOT-/usr/local/NTP} + +# +# we so use our own echos, as we somes want to substitute them with a +# file logging version durin the /etc/rc.local phase +# +set `type ECHO` + +PATH="${PATH}:$NTPROOT/bin" +export PATH + +if [ "$2" = "is" ]; then + : +else + # + # find out the way echos work (Rest of rc thinks BSD echo) + # + ECHOREP="`echo -n x`" + if [ "$ECHOREP" = "-n x" ]; then + ECHO () { + if [ "$1" = "-n" ]; then + shift + echo "$@\c" + else + echo "$@" + fi + } + #ECHO "System V style echo" + else + ECHO () { + echo "$@" + } + #ECHO "BSD style echo" + fi + + NLECHO () { + echo "$@" + } + + LOG () { + while read _line; do + ECHO "$_line" + done + } + # + # carefully find out some configuration Variables + # + ARCH="`(arch) 2>/dev/null || ((uname) > /dev/null && uname -a | awk '{ print $6; }') 2>/dev/null || echo 'no-arch'`" + KARCH="`(arch -k) 2>/dev/null || ((uname) > /dev/null && uname -a | awk '{ print $5 }') || echo 'no-arch'`" + HOSTNAME="`(hostname) 2>/dev/null || uname -n`" +fi + |