Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions systemvm/debian/opt/cloud/bin/setup/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sed -i "0,/^#server/s//$PATTERN\n#server/" $NTP_CONF_FILE
sed -i "0,/^#server/s//#server\n$PATTERN\n/" $NTP_CONF_FILE

no biggy, but this seems a little neater comment pertaining to the line below and not above.

done
systemctl enable ntp
else
Expand Down