mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-18 20:30:56 +00:00
ntp setup to handle sles12
This commit is contained in:
@ -290,11 +290,21 @@ sub process_request {
|
||||
print CFGFILE "$ntps\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
print CFGFILE "driftfile /etc/ntp.drift\n";
|
||||
print CFGFILE "tracefile /etc/ntp.trace\n";
|
||||
print CFGFILE "disable auth\n";
|
||||
print CFGFILE "broadcastclient\n";
|
||||
} else {
|
||||
print CFGFILE "driftfile /var/lib/ntp/drift\n";
|
||||
print CFGFILE "disable auth\n";
|
||||
}
|
||||
|
||||
#add xCAT mn/sn itself as a server
|
||||
print CFGFILE "server 127.127.1.0\n";
|
||||
print CFGFILE "fudge 127.127.1.0 stratum 10\n";
|
||||
|
||||
print CFGFILE "driftfile /var/lib/ntp/drift\n";
|
||||
close CFGFILE;
|
||||
|
||||
my $os = xCAT::Utils->osver("all");
|
||||
@ -313,7 +323,13 @@ sub process_request {
|
||||
if ($ntp_master) {
|
||||
my $cmd;
|
||||
if ($os =~ /sles/) {
|
||||
$cmd = "sntp -P no -r $ntp_master";
|
||||
if (-f "/usr/sbin/rcntpd") {
|
||||
$cmd = "rcntpd ntptimeset";
|
||||
} elsif (-f "/usr/sbin/rcntp") {
|
||||
$cmd = "rcntp ntptimeset";
|
||||
} else {
|
||||
$cmd = "sntp -P no -r $ntp_master";
|
||||
}
|
||||
} else {
|
||||
$cmd = "ntpdate -t5 $ntp_master";
|
||||
}
|
||||
|
@ -110,11 +110,19 @@ restrict 127.0.0.1" >>$conf_file
|
||||
fi
|
||||
#ntpdate program is deprecated on SuSE
|
||||
if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ]; then
|
||||
logger -t xcat "sntp -P no -r $master"
|
||||
sntp -P no -r $master
|
||||
if [ -f /usr/sbin/rcntpd ]; then
|
||||
cmd="rcntpd ntptimeset"
|
||||
elif [ -f /usr/sbin/rcntp ]; then
|
||||
cmd="rcntp ntptimeset"
|
||||
else
|
||||
cmd="sntp -P no -r $ntp_master"
|
||||
fi
|
||||
echo "$cmd"
|
||||
logger -t xcat "$cmd"
|
||||
eval $cmd
|
||||
if [ "$?" != "0" ];then
|
||||
echo " sntp -P no -r $master failed"
|
||||
logger -t xcat "sntp -P no -r $master failed"
|
||||
echo " $cmd failed"
|
||||
logger -t xcat "$cmd failed"
|
||||
fi
|
||||
else
|
||||
logger -t xcat "ntpdate -t5 $master "
|
||||
|
Reference in New Issue
Block a user