« Cobalt-Logキャッシュのクリア | メイン | Cobalt-メーリングリストの返信先変 »
2005年7月15日
Cobalt-Raq550の時刻同期(NTP)
SunCobalt RaQ550にてntpdが起動してない事発覚。
Sausalitoの中をちらちら眺めていると、
/usr/sausalito/handlers/base/time/ntp.pl が癌である模様。
Sauce::Service::service_toggle_init($ntpd, $ntpAddress);
# this is used by other objects
my @oids = $cce->find('System');
if ($#oids > -1) {
my $new = $ntpAddress ? 1 : 0;
my $old = $time_obj->{ntpEnabled} ? 1 : 0;
if ($old != $new) {
$cce->set($oids[0], 'Time', { 'ntpEnabled' => $new });
}
}
$cce->bye('SUCCESS');
exit 0;
ここで/usr/sausalito/perl/Sauce/Service.pmのservice_toggle_init()に 渡されているのか。
フムフム。
で次に$ntpAddressを$newにいれるのね...。
しかしこのままだとntpサーバのアドレスが入っているだけでわ?
意味無しでわ?
■ 即席patch
diff -Naur ntp.pl ntp.pl.fix
--- ntp.pl Thu Dec 5 17:32:40 2002
+++ ntp.pl.fix Thu Dec 5 17:37:31 2002
@@ -40,7 +40,6 @@
`echo '$ntpAddress' > $tickers`;
}
}
-Sauce::Service::service_toggle_init($ntpd, $ntpAddress);
# this is used by other objects
my @oids = $cce->find('System');
@@ -51,7 +50,7 @@
$cce->set($oids[0], 'Time', { 'ntpEnabled' => $new });
}
}
-
+Sauce::Service::service_toggle_init($ntpd, $ntpAddress);
$cce->bye('SUCCESS');
exit 0;
/usr/sausalito/handlers/base/time にコピーして、
patch -p0 < ntp-fix.patch
としておくか。
でもよく考えると、パッチなど作成しなくても 変更箇所が2行だけなので、直接viとかで編集してみることに・・・・
オリジナルファイルのバックアップをまず取って^^
/usr/sausalito/handlers/base/time/ntp.pl
43|Sauce::Service::service_toggle_init($ntpd, $ntpAddress);
44|
45|# this is used by other objects
46|my @oids = $cce->find('System');
47|if ($#oids > -1) {
48| my $new = $ntpAddress ? 1 : 0;
49| my $old = $time_obj->{ntpEnabled} ? 1 : 0;
50| if ($old != $new) {
51| $cce->set($oids[0], 'Time', { 'ntpEnabled' => $new });
52| }
53|}
54|$cce->bye('SUCCESS');
55|exit 0;
この43行目を切り取って53と54行の間にペーストするだけでOK。
43|
44|# this is used by other objects
45|my @oids = $cce->find('System');
46|if ($#oids > -1) {
47| my $new = $ntpAddress ? 1 : 0;
48| my $old = $time_obj->{ntpEnabled} ? 1 : 0;
49| if ($old != $new) {
50| $cce->set($oids[0], 'Time', { 'ntpEnabled' => $new });
51| }
52|}
53|Sauce::Service::service_toggle_init($ntpd, $ntpAddress);
54|$cce->bye('SUCCESS');
55|exit 0;
次に /etc/ntp.conf を編集して
14|#server 127.127.1.0 # local clock
15|server clock.nc.fukuoka-u.ac.jp
16|server clock.tl.fukuoka-u.ac.jp
17|#fudge 127.127.1.0 stratum 13
15と16行を追加。
どこのNTPサーバが良いかは
http://yotaro.bird.to/feedback/misc/NTP_list.html
などで探してみればOK。^^
投稿者 AJ : 2005年7月15日 12:55
トラックバック
このエントリーのトラックバックURL:
http://www.factory-aj.com/cgi/mtctrl/mt-tb.cgi/163