Skip to content

Commit daf4da4

Browse files
authored
Merge pull request #2485 from Varying-Vagrant-Vagrants/fix/earlier-ntpupdate
Run ntpupdate if it's available, and at a much earlier stage
2 parents 27be9be + 0b3e2b8 commit daf4da4

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ permalink: /docs/en-US/changelog/
4444
* Warnings that you're missing vagrant plugins no longer show when running vagrant plugin commands
4545
* Force the Virtual Machine to 64bit on VirtualBox to avoid infinite loops on 32bit architectures
4646
* Force the installation and update of grunt and grunt-cli so that old grunt is always overwritten when updated
47+
* Sync clocks before provisioning if ntpdate is available to avoid Apt mirror time issues
4748
* Fixed cloning the dashboard git repository with unknown remote branches
4849

4950
## 3.6.2 ( 2021 March 17th )

config/homebin/vagrant_up

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ fi
2929

3030
vvv_info " * Restarting Nginx"
3131
sudo service nginx restart
32+
3233
vvv_info " * Restarting MariaDB"
3334
sudo service mysql restart
34-
vvv_info " * Syncing clocks"
35-
sudo ntpdate -u ntp.ubuntu.com
35+
36+
if [ -x "$(command -v ntpdate)" ]; then
37+
vvv_info " * Syncing clocks"
38+
sudo ntpdate -u ntp.ubuntu.com
39+
else
40+
vvv_info " - skipping ntpdate clock sync, not installed yet"
41+
fi
3642

3743
mkdir -p /vagrant/failed_provisioners
3844
if [ -z "$(ls -A /vagrant/failed_provisioners/)" ]; then

provision/provision.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ rm -f /vagrant/version
1818
rm -f /vagrant/vvv-custom.yml
1919
rm -f /vagrant/config.yml
2020

21+
if [ -x "$(command -v ntpdate)" ]; then
22+
echo " * Syncing clocks"
23+
sudo ntpdate -u ntp.ubuntu.com
24+
else
25+
echo " - skipping ntpdate clock sync, not installed yet"
26+
fi
27+
2128
touch /vagrant/provisioned_at
2229
echo $(date "+%Y.%m.%d_%H-%M-%S") > /vagrant/provisioned_at
2330

0 commit comments

Comments
 (0)