以下は古野電機からもらったプログラマーズマニュアル XNTP インストール説 明書 Solaris 版による.
dipswitch | 機能 | default |
---|---|---|
1 | FF の出力 | OFF |
2 | CD 信号 | ON |
BINDIR = /fs/local/libexec/xntp
/opt/SUNWspro/bin/make -R makeconfigを実行した. これで生成された Config は
RANLIB= : DEFS= -DSTREAM -DSYS_SOLARIS -DADJTIME_IS_ACCURATE -DUSE_CLOCK_SETTIME -DSYSCALL_BUG CLOCKDEFS= -DACTS -DATOM -DAS2201 -DCHU -DDATUM -DHEATH -DHPGPS -DIRIG -DLEITCH -DLOCAL_CLOCK -DMSFEES -DMX4200 -DNMEA -DPST -DTPRO -DTRAK -DTRUETIME -DWWVB -DPTB -DUSNO AUTHDEFS= -DDES -DMD5 DAEMONLIBS= RESLIB= COPTS= -O ADJLIB= COMPAT= -lsocket -lnsl -lelf -lposix4 -lkvm INSTALL= $(TOP)scripts/install.sh COMPILER= gcc LIBDEFS= -DXNTP_BIG_ENDIAN DEFS_INCLUDE= -DMCAST # # Default Config.local file. Edit only if you know what you are doing. # DEFS_LOCAL= -DDEBUG -DREFCLOCK -DPARSE -DCLOCK_TS800 -DCLOCK_ -DLOCAL_CLOCK BINDIR= /fs/local/libexec/xntpであった.
all: @if [ 1 ]; then \ $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" KARCH="`(arch -k) 2>/dev/null || uname -a | awk '{ print $5 }'`" -f Makefile.kernel parse; \
/opt/SUNWspro/bin/make -Rを実行. この時
../parse/libparse.a(parse_conf.o)(.data+0x0): undefined reference to `clock_ts820' *** Error code 1 make: Fatal error: Command failed for target `xntpd' Current working directory /usr/users/tatebe/src/xntp3.5f/xntpd *** Error code 1 make: Fatal error: Command failed for target `xntpd/xntpd'といって止まる. これで parse/Makefile を作るのだそうだ. これ だけ作らせればいいのに.
install parse /kernel/strmod/parseとなっていたが, これではうまく行かなかった.
ln -s /dev/ttya /dev/refclock-0 ln -s /dev/ttyb /dev/refclock-1
server 127.127.8.0 # /dev/refclock-0
% /fs/local/libexec/xntp/tickadj -As No tickadj kernal variable tick = 10000 us, dosynctodr is on calculated hz = 100.00 Hz zeroing dosynctodr: done!と出てしまう. おかしい. reboot する必要があるのか? それとも kernel module がきちんと入っていないのか. どなたか詳しい人はいませんでしょう か?
もう一度実行しても
No tickadj kernal variable tick = 10000 us, dosynctodr is off calculated hz = 100.00 Hz zeroing dosynctodr: done!やっぱりだめみたい.
# /fs/local/libexec/ntpd/ntpdate dia 19 Sep 11:34:58 ntpdate[11909]: step time server 192.50.77.164 offset 48.173773 secデーモンを走らせる.
# /fs/local/libexec/ntpd/xntpd -l /var/adm/xntpd.logが, /var/adm/xntpd.log には,
# cat /var/adm/xntpd.log 19 Sep 11:59:13 xntpd[12601]: logging to file /var/adm/xntpd.log 19 Sep 11:59:13 xntpd[12601]: xntpd version=3.5f; Fri Sep 19 10:19:17 JST 1997 (1) 19 Sep 11:59:13 xntpd[12601]: tickadj = 625, tick = 10000, tvu_maxslew = 61875 19 Sep 11:59:13 xntpd[12601]: precision = 31 usec 19 Sep 11:59:13 xntpd[12601]: PARSE receiver #0: stream_init: ioctl(fd, I_PUSH, "parse"): Invalid argument 19 Sep 11:59:13 xntpd[12601]: PARSE receiver #0: ppsclock_init: ioctl(fd, I_PUSH, "ppsclock"): Invalid argument 19 Sep 12:00:18 xntpd[12601]: PARSE receiver #0: interval for following error message class is at least 00:01:00 19 Sep 12:00:18 xntpd[12601]: PARSE receiver #0: no data from device within poll interval (check receiver / cableling)と出る. おっ, おかしい. どうやら etlhpc には Time Server がつ いていないようだ. ちゃんちゃん.
# cp parse /kernel/strmod # chmod +x /kernel/strmod/parse # vi /etc/ntp.conf # /fs/local/libexec/xntp/tickadj -As # /fs/local/libexec/ntpd/ntpdate dia # /fs/local/libexec/ntpd/xntpd -l /var/adm/xntpd.logをそれぞれ実行. /var/adm/xntpd.log には
1 Dec 15:06:46 xntpd[20142]: logging to file /var/adm/xntpd.log 1 Dec 15:06:46 xntpd[20142]: xntpd version=3.5f; Fri Sep 19 10:19:17 JST 1997 (1) 1 Dec 15:06:46 xntpd[20142]: tickadj = 625, tick = 10000, tvu_maxslew = 61875 1 Dec 15:06:46 xntpd[20142]: precision = 8 usec 1 Dec 15:06:46 xntpd[20142]: PARSE receiver #0: interval for following error message class is at least 00:01:00 1 Dec 15:06:46 xntpd[20142]: PARSE receiver #0: FAILED TIMECODE: "$GPGGA,060647,3603.702,N,14008.148" (check receiver configuration / cableling)と出るが, しばらくして,
1 Dec 15:11:03 xntpd[20142]: synchronized to GENERIC(0), stratum=0と出て動いているようである. さらに, 起動時に xntpd を走らせるため,
--- /etc/init.d/xntpd --- #!/bin/sh # server1='phase.etl.go.jp' server2='' xntpd_log='/var/adm/xntpd.log' killproc() { # kill the named process(es) pid=`/usr/bin/ps -e | /usr/bin/grep $1 | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` [ "$pid" != "" ] && kill $pid } # # Start/stop daemon # case "$1" in 'start') if [ -x /fs/local/libexec/xntp/xntpd ]; then if [ -x /fs/local/libexec/xntp/ntpdate ]; then #echo "Starting NTP daemon, takes about 1 minute... " # The following line is unnecessary if you turn off # dosynctodr in /etc/system. /fs/local/libexec/xntp/tickadj -s /fs/local/libexec/xntp/ntpdate -v $server1 $server2 (sleep 60 ; /fs/local/libexec/xntp/xntpd -l $xntpd_log ) & fi fi ;; 'stop') killproc xntpd # kill daemon ;; *) echo "Usage: /etc/init.d/xntpd { start | stop }" ;; esacの作成を行い, /etc/rc2.d から link を張った.
# (cd /etc/rc2.d; ln ../init.d/xntpd S99xntpd)また, 同様のことを phase でも設定した. あとは, 立ち上げ時に (LANG 問題も含め)うまく動いてくれるかと言うことだけである.