mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix configuration of ntp server list in systemVMs (#5160)
This commit is contained in:
parent
d82909318f
commit
aa809727a8
@ -263,7 +263,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
|
||||
private final GlobalLock _allocLock = GlobalLock.getInternLock(getAllocLockName());
|
||||
|
||||
static final ConfigKey<String> NTPServerConfig = new ConfigKey<String>(String.class, "ntp.server.list", "Advanced", null,
|
||||
"Comma separated list of NTP servers to configure in Secondary storage VM", false, ConfigKey.Scope.Global, null);
|
||||
"Comma separated list of NTP servers to configure in Secondary storage VM", true, ConfigKey.Scope.Global, null);
|
||||
|
||||
static final ConfigKey<Integer> MaxNumberOfSsvmsForMigration = new ConfigKey<Integer>("Advanced", Integer.class, "max.ssvm.count", "5",
|
||||
"Number of additional SSVMs to handle migration of data objects concurrently", true, ConfigKey.Scope.Global);
|
||||
|
||||
@ -567,14 +567,12 @@ setup_ntp() {
|
||||
if [ -f $NTP_CONF_FILE ]
|
||||
then
|
||||
IFS=',' read -a server_list <<< "$NTP_SERVER_LIST"
|
||||
sed -i "/^server /d" $NTP_CONF_FILE
|
||||
for (( iterator=${#server_list[@]}-1 ; iterator>=0 ; iterator-- ))
|
||||
do
|
||||
server=$(echo ${server_list[iterator]} | tr -d '\r')
|
||||
PATTERN="server $server"
|
||||
if grep -q "^$PATTERN$" $NTP_CONF_FILE ; then
|
||||
sed -i "/^$PATTERN$/d" $NTP_CONF_FILE
|
||||
fi
|
||||
sed -i "0,/^server/s//$PATTERN\nserver/" $NTP_CONF_FILE
|
||||
sed -i "0,/^#server/s//$PATTERN\n#server/" $NTP_CONF_FILE
|
||||
done
|
||||
systemctl enable ntp
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user