New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trigger b2d to run ntpdate on OSX/WIndows resume events #290

Closed
amattn opened this Issue Mar 19, 2014 · 63 comments

Comments

Projects
None yet
@amattn
Contributor

amattn commented Mar 19, 2014

Mac OS X, when the laptop is closed/sleeping, the b2d VM clock does not tick.

Is it possible to get ntp or some other mechanism of keeping the clock correct in place?

@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Mar 19, 2014

Contributor

ntp has been built into b2d for some time now

Contributor

steeve commented Mar 19, 2014

ntp has been built into b2d for some time now

@amattn

This comment has been minimized.

Show comment
Hide comment
@amattn

amattn Mar 20, 2014

Contributor

@steeve Thanks for the update.

The original issue description still stands that if my Mac OS X laptop goes to sleep while the b2d VM is running, when the laptop wakes up, all the clocks are wrong in the VM and in the containers.

I just poked around a bit and looking at the current version the ntpclient is in the VM, but there is no /etc/ntp.conf and no /var/lib/ntp... furthermore, looking at /mnt/sda1/var/lib/boot2docker/log/ntpclient.log shows this:

running ntpclient -s -h pool.ntp.org in background
pool.ntp.org: Resolver internal error

a quick man tells me that -s means to set the clock just once and not keep running and check at intervals.

Is this expected?

removing -s means that ntpclient should ping the pool once every 600 seconds by default...

Contributor

amattn commented Mar 20, 2014

@steeve Thanks for the update.

The original issue description still stands that if my Mac OS X laptop goes to sleep while the b2d VM is running, when the laptop wakes up, all the clocks are wrong in the VM and in the containers.

I just poked around a bit and looking at the current version the ntpclient is in the VM, but there is no /etc/ntp.conf and no /var/lib/ntp... furthermore, looking at /mnt/sda1/var/lib/boot2docker/log/ntpclient.log shows this:

running ntpclient -s -h pool.ntp.org in background
pool.ntp.org: Resolver internal error

a quick man tells me that -s means to set the clock just once and not keep running and check at intervals.

Is this expected?

removing -s means that ntpclient should ping the pool once every 600 seconds by default...

@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve
Contributor

steeve commented Mar 20, 2014

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Mar 21, 2014

Contributor

The problem with the clock of the virtual box VM is known and the only perfect solution is the vbox guest additions but this is no accepted option.

We should look into the option to run the ntpclient on resume - there is a hook to add scripts:
http://wiki.ubuntuusers.de/pm-utils

Contributor

aheissenberger commented Mar 21, 2014

The problem with the clock of the virtual box VM is known and the only perfect solution is the vbox guest additions but this is no accepted option.

We should look into the option to run the ntpclient on resume - there is a hook to add scripts:
http://wiki.ubuntuusers.de/pm-utils

@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Mar 21, 2014

Contributor

Andreas: I have a PR open for the vbguest modules, turns out they are quite small

Contributor

steeve commented Mar 21, 2014

Andreas: I have a PR open for the vbguest modules, turns out they are quite small

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Mar 21, 2014

Contributor

@steeve I had a look at it and spend two days on trying to get them compiled but failed :-(

Contributor

aheissenberger commented Mar 21, 2014

@steeve I had a look at it and spend two days on trying to get them compiled but failed :-(

@jeberly

This comment has been minimized.

Show comment
Hide comment
@jeberly

jeberly Mar 31, 2014

+1 for finding a sensible solution to this. I get this on my docker app pushing to s3 after sleep/resume. "The difference between the request time and the current time is too large." Advice on best short term work around?

jeberly commented Mar 31, 2014

+1 for finding a sensible solution to this. I get this on my docker app pushing to s3 after sleep/resume. "The difference between the request time and the current time is too large." Advice on best short term work around?

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Apr 1, 2014

Contributor

this should be fixed by adding the vbox guest additions #284
https://www.virtualbox.org/manual/ch09.html#changetimesync

Contributor

aheissenberger commented Apr 1, 2014

this should be fixed by adding the vbox guest additions #284
https://www.virtualbox.org/manual/ch09.html#changetimesync

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Apr 3, 2014

Contributor

sadly, that won't fix it for everyone, just vbox users

Contributor

SvenDowideit commented Apr 3, 2014

sadly, that won't fix it for everyone, just vbox users

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Apr 3, 2014

Contributor

@SvenDowideit this is a Problem only related to vbox users - there is no sleep/resume on real hardware with clock problems.

Contributor

aheissenberger commented Apr 3, 2014

@SvenDowideit this is a Problem only related to vbox users - there is no sleep/resume on real hardware with clock problems.

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Apr 3, 2014

Contributor

@aheissenberger there are lots more visualization platforms than vbox - and b2d works on them too.

Contributor

SvenDowideit commented Apr 3, 2014

@aheissenberger there are lots more visualization platforms than vbox - and b2d works on them too.

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Apr 7, 2014

Contributor

actually - I wonder if we can use the acpi events to trigger ntpdate - rather than needing a virtualisation specific solution.

Contributor

SvenDowideit commented Apr 7, 2014

actually - I wonder if we can use the acpi events to trigger ntpdate - rather than needing a virtualisation specific solution.

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Apr 23, 2014

Contributor

👍 we are already using acpid anyway for clean shutdown, imho this is the right solution.

question is: does vbox send acpi signals when the host goes to sleep?

Contributor

steeve commented Apr 23, 2014

👍 we are already using acpid anyway for clean shutdown, imho this is the right solution.

question is: does vbox send acpi signals when the host goes to sleep?

@Jud

This comment has been minimized.

Show comment
Hide comment
@Jud

Jud Jun 1, 2014

Any update on this issue? I'm running containers that depend on semi-accurate time (bitcoin testnet client) and any time my laptop sleeps, I need to ssh into the boot2docker vm and run ntpdate. Sometimes I get an Internal Resolver Error and need to restart the VM.

Jud commented Jun 1, 2014

Any update on this issue? I'm running containers that depend on semi-accurate time (bitcoin testnet client) and any time my laptop sleeps, I need to ssh into the boot2docker vm and run ntpdate. Sometimes I get an Internal Resolver Error and need to restart the VM.

@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Jun 4, 2014

Contributor

@Jud you can try to edit /usr/local/etc/acpi/events/all in the rootfs if you can find out if vbox sends acpi signals when the host resumes. That'd be awesome.

Contributor

steeve commented Jun 4, 2014

@Jud you can try to edit /usr/local/etc/acpi/events/all in the rootfs if you can find out if vbox sends acpi signals when the host resumes. That'd be awesome.

@Jud

This comment has been minimized.

Show comment
Hide comment
@Jud

Jud Jun 6, 2014

@steeve I tried editing /usr/local/etc/acpi/events/all and changing event=button/power* to event=.* and changed the action to a little shell script that logged to a file. Restarted acpid and tried to trigger some acpi events by closing / opening the lid, saving the box, etc.

I didn't get any acpi events logged.

Jud commented Jun 6, 2014

@steeve I tried editing /usr/local/etc/acpi/events/all and changing event=button/power* to event=.* and changed the action to a little shell script that logged to a file. Restarted acpid and tried to trigger some acpi events by closing / opening the lid, saving the box, etc.

I didn't get any acpi events logged.

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Jun 6, 2014

Contributor

acpi_listen also does not receive anything - vbox'd again?

Contributor

SvenDowideit commented Jun 6, 2014

acpi_listen also does not receive anything - vbox'd again?

@Jud

This comment has been minimized.

Show comment
Hide comment
@Jud

Jud Jul 20, 2014

For now, I've hacked around this using SleepWatcher and disabling vbox's "feature" of going to sleep when the battery is low: VBoxManage setextradata global "VBoxInternal2/SavestateOnBatteryLow" 0.

Basically it just runs boot2docker ssh sudo ntpclient -s -h pool.ntp.org whenever the host wakes from sleep.

Jud commented Jul 20, 2014

For now, I've hacked around this using SleepWatcher and disabling vbox's "feature" of going to sleep when the battery is low: VBoxManage setextradata global "VBoxInternal2/SavestateOnBatteryLow" 0.

Basically it just runs boot2docker ssh sudo ntpclient -s -h pool.ntp.org whenever the host wakes from sleep.

@alfonsodev

This comment has been minimized.

Show comment
Hide comment
@alfonsodev

alfonsodev Jul 25, 2014

to me
sudo ntpclient -s -h de.pool.ntp.org (I'm in Germany)
still gives two hours less than current time,
do you know where timezone is defined ?

alfonsodev commented Jul 25, 2014

to me
sudo ntpclient -s -h de.pool.ntp.org (I'm in Germany)
still gives two hours less than current time,
do you know where timezone is defined ?

@docwhat

This comment has been minimized.

Show comment
Hide comment
@docwhat

docwhat Aug 7, 2014

Using NTPD is probably the easiest/best solution. It's more reliable than depending on random guest tools and works whether the acpi stuff is installed or not.

Adding an init.d script to run ntpd -p pool.ntp.org on boot would probably suffice.

docwhat commented Aug 7, 2014

Using NTPD is probably the easiest/best solution. It's more reliable than depending on random guest tools and works whether the acpi stuff is installed or not.

Adding an init.d script to run ntpd -p pool.ntp.org on boot would probably suffice.

@docwhat

This comment has been minimized.

Show comment
Hide comment
@docwhat

docwhat Aug 7, 2014

I have a fix-up script I use to work around unfixed issues in boot2docker that does this:

# Fix NTP/Time
# https://github.com/boot2docker/boot2docker/issues/290
boot2docker ssh -- sudo killall -9 ntpd
boot2docker ssh -- sudo ntpclient -s -h pool.ntp.org
boot2docker ssh -- sudo ntpd -p pool.ntp.org

It's meant to be idempotent, hence the killall.

docwhat commented Aug 7, 2014

I have a fix-up script I use to work around unfixed issues in boot2docker that does this:

# Fix NTP/Time
# https://github.com/boot2docker/boot2docker/issues/290
boot2docker ssh -- sudo killall -9 ntpd
boot2docker ssh -- sudo ntpclient -s -h pool.ntp.org
boot2docker ssh -- sudo ntpd -p pool.ntp.org

It's meant to be idempotent, hence the killall.

@alfonsodev

This comment has been minimized.

Show comment
Hide comment
@alfonsodev

alfonsodev Aug 8, 2014

My problem was that even that the time given by ntp was right, tiny core linux has defined a time zone already. So after reading tiny core docs, figure out you have to export TZ variable, to define your timezone.
sudo ntpclient -s -h de.pool.ntp.org
export TZ=CET-1CEST,M3.5.0,M10.5.0/3

alfonsodev commented Aug 8, 2014

My problem was that even that the time given by ntp was right, tiny core linux has defined a time zone already. So after reading tiny core docs, figure out you have to export TZ variable, to define your timezone.
sudo ntpclient -s -h de.pool.ntp.org
export TZ=CET-1CEST,M3.5.0,M10.5.0/3

@felixrabe

This comment has been minimized.

Show comment
Hide comment
@felixrabe

felixrabe Aug 8, 2014

Workaround: boot2docker restart. Does the job if you

  • can accept a restart of the VM,
  • are only annoyed by the wrong clock and don't depend on it being correct all the time.

felixrabe commented Aug 8, 2014

Workaround: boot2docker restart. Does the job if you

  • can accept a restart of the VM,
  • are only annoyed by the wrong clock and don't depend on it being correct all the time.
@docwhat

This comment has been minimized.

Show comment
Hide comment
@docwhat

docwhat Aug 8, 2014

@alfonsodev I fixed it by copying /etc/localtime into the boot2docker vm. See #476.

@felixrabe No, I need an accurate clock to do test some of the containers I work with.

docwhat commented Aug 8, 2014

@alfonsodev I fixed it by copying /etc/localtime into the boot2docker vm. See #476.

@felixrabe No, I need an accurate clock to do test some of the containers I work with.

@ahmetb

This comment has been minimized.

Show comment
Hide comment
@ahmetb

ahmetb Aug 24, 2014

I'm also using boot2docker up and boot2docker down commands instead of poweroff/restart (boot2docker 1.1.1 on OS X)

Over time, I have observed a time drift of ~40 minutes.

image

Epoch of VM: Sun, 24 Aug 2014 22:11:19 GMT
Epoch of My Mac: GMT: Sun, 24 Aug 2014 22:50:51 GMT

boot2docker restart solved it though.

ahmetb commented Aug 24, 2014

I'm also using boot2docker up and boot2docker down commands instead of poweroff/restart (boot2docker 1.1.1 on OS X)

Over time, I have observed a time drift of ~40 minutes.

image

Epoch of VM: Sun, 24 Aug 2014 22:11:19 GMT
Epoch of My Mac: GMT: Sun, 24 Aug 2014 22:50:51 GMT

boot2docker restart solved it though.

@sfitts

This comment has been minimized.

Show comment
Hide comment
@sfitts

sfitts Sep 24, 2014

Just got bit by this myself. Restart of course clears it, but that's a painful workaround. We'll use the ntpclient approach for now, any reason that ntpd isn't active by default as suggested by @docwhat ?

sfitts commented Sep 24, 2014

Just got bit by this myself. Restart of course clears it, but that's a painful workaround. We'll use the ntpclient approach for now, any reason that ntpd isn't active by default as suggested by @docwhat ?

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Sep 25, 2014

Contributor

ntpclient should be active - the iso's bootscript.sh has:

#import settings from profile (or unset them)
export NTP_SERVER=pool.ntp.org
test -f "/var/lib/boot2docker/profile" && . "/var/lib/boot2docker/profile"

# set the hostname
/etc/rc.d/hostname

# sync the clock (in the background, it takes 40s to timeout)
/etc/rc.d/ntpclient > /var/log/ntpclient.log 2>&1 &
Contributor

SvenDowideit commented Sep 25, 2014

ntpclient should be active - the iso's bootscript.sh has:

#import settings from profile (or unset them)
export NTP_SERVER=pool.ntp.org
test -f "/var/lib/boot2docker/profile" && . "/var/lib/boot2docker/profile"

# set the hostname
/etc/rc.d/hostname

# sync the clock (in the background, it takes 40s to timeout)
/etc/rc.d/ntpclient > /var/log/ntpclient.log 2>&1 &
@sfitts

This comment has been minimized.

Show comment
Hide comment
@sfitts

sfitts Sep 25, 2014

Is this a recent change, because as of 1.1.1 it is still losing time every time the host machine sleeps and you have to kick it to get it to resync.

sfitts commented Sep 25, 2014

Is this a recent change, because as of 1.1.1 it is still losing time every time the host machine sleeps and you have to kick it to get it to resync.

@martinlauer

This comment has been minimized.

Show comment
Hide comment
@martinlauer

martinlauer Nov 10, 2014

Here a chained command to get datesync working.
wget -q https://gist.githubusercontent.com/fcvarela/2c90b090e1e5f8c91127/raw/1e63833d4ec7edea98298204a0c26f79ead3db8e/com.fcvarela.boot2docker.datesync.plist -O ~/Library/LaunchAgents/com.fcvarela.boot2docker.datesync.plist && launchctl load ~/Library/LaunchAgents/com.fcvarela.boot2docker.datesync.plist && launchctl start com.fcvarela.boot2docker.datesync

Thx to @fcvarela

martinlauer commented Nov 10, 2014

Here a chained command to get datesync working.
wget -q https://gist.githubusercontent.com/fcvarela/2c90b090e1e5f8c91127/raw/1e63833d4ec7edea98298204a0c26f79ead3db8e/com.fcvarela.boot2docker.datesync.plist -O ~/Library/LaunchAgents/com.fcvarela.boot2docker.datesync.plist && launchctl load ~/Library/LaunchAgents/com.fcvarela.boot2docker.datesync.plist && launchctl start com.fcvarela.boot2docker.datesync

Thx to @fcvarela

@tianon

This comment has been minimized.

Show comment
Hide comment
@tianon

tianon Nov 11, 2014

Contributor

I'd be much more interested in a fix in the VM itself than in a workaround
via plist files, especially for an official fix. This problem isn't
OSX-specific, so fixing it via a workaround like "boot2docker ssh ntpdate
..." on a periodic host-side task seems completely backwards to me (great
as a workaround, but not as something I'd want to be installing by default
for all our users).

Contributor

tianon commented Nov 11, 2014

I'd be much more interested in a fix in the VM itself than in a workaround
via plist files, especially for an official fix. This problem isn't
OSX-specific, so fixing it via a workaround like "boot2docker ssh ntpdate
..." on a periodic host-side task seems completely backwards to me (great
as a workaround, but not as something I'd want to be installing by default
for all our users).

@mikz

This comment has been minimized.

Show comment
Hide comment
@mikz

mikz Nov 18, 2014

Starting ntpclient as init.d service looks like no brainer to me.

mikz commented Nov 18, 2014

Starting ntpclient as init.d service looks like no brainer to me.

@matthewleon

This comment has been minimized.

Show comment
Hide comment
@matthewleon

matthewleon Nov 18, 2014

Would love to see some kind of decision from Above as to what approach the team is favoring for this issue. It's biting a lot of us.

matthewleon commented Nov 18, 2014

Would love to see some kind of decision from Above as to what approach the team is favoring for this issue. It's biting a lot of us.

@sfitts

This comment has been minimized.

Show comment
Hide comment
@sfitts

sfitts Nov 19, 2014

@matthewleon agreed. At this point I'm good with any non-OSX specific fix. I'm slowly training folks to fix things up manually, but that's error prone and frankly just looks bad.

sfitts commented Nov 19, 2014

@matthewleon agreed. At this point I'm good with any non-OSX specific fix. I'm slowly training folks to fix things up manually, but that's error prone and frankly just looks bad.

@tianon

This comment has been minimized.

Show comment
Hide comment
@tianon

tianon Nov 19, 2014

Contributor

Does our VM have and run cron? We could just cron cycle the ntpclient init script as a simple first-pass solution.

Contributor

tianon commented Nov 19, 2014

Does our VM have and run cron? We could just cron cycle the ntpclient init script as a simple first-pass solution.

@adizam

This comment has been minimized.

Show comment
Hide comment
@adizam

adizam Nov 20, 2014

For now, my entire team is broken up into linux & mac users.. the linux users obviously not experiencing this problem (don't require boot2docker).. and @martinlauer's solution works fine for my mac developers.

I would love to see a real solution to this issue, but for now, that will have to suffice. If you guys do decide on a route you'd prefer it to go, I wouldn't mind throwing a bit of time and submitting a PR.. just don't want to overstep if the team has it on their roadmap.

Cheers

adizam commented Nov 20, 2014

For now, my entire team is broken up into linux & mac users.. the linux users obviously not experiencing this problem (don't require boot2docker).. and @martinlauer's solution works fine for my mac developers.

I would love to see a real solution to this issue, but for now, that will have to suffice. If you guys do decide on a route you'd prefer it to go, I wouldn't mind throwing a bit of time and submitting a PR.. just don't want to overstep if the team has it on their roadmap.

Cheers

@JeroenVdb

This comment has been minimized.

Show comment
Hide comment
@JeroenVdb

JeroenVdb Nov 28, 2014

When I run the ntpclient command I get this error: recvfrom: Connection refused

Boot2Docker version 1.3.1, build master : 9a31a68 - Fri Oct 31 03:14:34 UTC 2014
Docker version 1.3.1, build 4e9bbfa
docker@boot2docker:~$ sudo ntpclient -s -h pool.ntp.org
recvfrom: Connection refused
docker@boot2docker:~$ 

I'm connected to the internet and can ping to pool.ntp.org.

JeroenVdb commented Nov 28, 2014

When I run the ntpclient command I get this error: recvfrom: Connection refused

Boot2Docker version 1.3.1, build master : 9a31a68 - Fri Oct 31 03:14:34 UTC 2014
Docker version 1.3.1, build 4e9bbfa
docker@boot2docker:~$ sudo ntpclient -s -h pool.ntp.org
recvfrom: Connection refused
docker@boot2docker:~$ 

I'm connected to the internet and can ping to pool.ntp.org.

@tedstrauss

This comment has been minimized.

Show comment
Hide comment
@tedstrauss

tedstrauss Dec 3, 2014

This issue is somehow mangling synchronization of files between my OSX IDE and boot2docker files. Files are not being properly updated in nginx when the date/time gets broken.
Critical bug > switching to vagrant.

tedstrauss commented Dec 3, 2014

This issue is somehow mangling synchronization of files between my OSX IDE and boot2docker files. Files are not being properly updated in nginx when the date/time gets broken.
Critical bug > switching to vagrant.

@defunctzombie

This comment has been minimized.

Show comment
Hide comment
@defunctzombie

defunctzombie Dec 3, 2014

Is there a PR anyone has made to fix this?

On Wednesday, December 3, 2014, Ted Strauss notifications@github.com
wrote:

This issue is somehow mangling synchronization of files between my OSX IDE
and boot2docker files. Files are not being properly updated in nginx when
the date/time gets broken.
Critical bug > switching to vagrant.


Reply to this email directly or view it on GitHub
#290 (comment)
.

defunctzombie commented Dec 3, 2014

Is there a PR anyone has made to fix this?

On Wednesday, December 3, 2014, Ted Strauss notifications@github.com
wrote:

This issue is somehow mangling synchronization of files between my OSX IDE
and boot2docker files. Files are not being properly updated in nginx when
the date/time gets broken.
Critical bug > switching to vagrant.


Reply to this email directly or view it on GitHub
#290 (comment)
.

@blalor

This comment has been minimized.

Show comment
Hide comment
@blalor

blalor Dec 8, 2014

Another +1 for fixing this issue in the boot2docker ISO.

blalor commented Dec 8, 2014

Another +1 for fixing this issue in the boot2docker ISO.

@cooniur

This comment has been minimized.

Show comment
Hide comment
@cooniur

cooniur Apr 6, 2015

Has this issue been fixed? I just found after sleeping and resuming my Mac, the time in boot2docker VM is 15min behind the host. I'm on the latest version (1.5.0).

cooniur commented Apr 6, 2015

Has this issue been fixed? I just found after sleeping and resuming my Mac, the time in boot2docker VM is 15min behind the host. I'm on the latest version (1.5.0).

@jmshelby

This comment has been minimized.

Show comment
Hide comment
@jmshelby

jmshelby Apr 20, 2015

I noticed this still happening to me today. On 1.5.0 as well ...

jmshelby commented Apr 20, 2015

I noticed this still happening to me today. On 1.5.0 as well ...

@inflector

This comment has been minimized.

Show comment
Hide comment
@inflector

inflector Apr 23, 2015

Definitely happens to me too

inflector commented Apr 23, 2015

Definitely happens to me too

@jordi-chacon

This comment has been minimized.

Show comment
Hide comment
@jordi-chacon

jordi-chacon Jun 21, 2015

Happens to me too.

jordi-chacon commented Jun 21, 2015

Happens to me too.

@frankamp

This comment has been minimized.

Show comment
Hide comment
@frankamp

frankamp Jun 27, 2015

Me too, time to reopen this or #840

frankamp commented Jun 27, 2015

Me too, time to reopen this or #840

@progrium progrium referenced this issue Jul 31, 2015

Open

clock #43

@mickep76

This comment has been minimized.

Show comment
Hide comment
@mickep76

mickep76 Aug 3, 2015

Here is an example using the SleepWatcher workaround.

Install SleepWatcher:

brew install SleepWatcher

Launch and enable on login:

launchctl load ~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
ln -sfv /usr/local/opt/sleepwatcher/*.plist ~/Library/LaunchAgents

Create wake up script:

cat << EOF >~/.wakeup
#!/bin/bash

MACHINE='<machine>'
NTP_SERVER='pool.ntp.org'

PATH="\${PATH}:/usr/local/bin"
docker-machine ssh \${MACHINE} "sudo ntpclient -s -h \${NTP_SERVER}"
EOF
chmod +x ~/.wakeup

Replace <machine> with the name of your docker-machine instance.

mickep76 commented Aug 3, 2015

Here is an example using the SleepWatcher workaround.

Install SleepWatcher:

brew install SleepWatcher

Launch and enable on login:

launchctl load ~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
ln -sfv /usr/local/opt/sleepwatcher/*.plist ~/Library/LaunchAgents

Create wake up script:

cat << EOF >~/.wakeup
#!/bin/bash

MACHINE='<machine>'
NTP_SERVER='pool.ntp.org'

PATH="\${PATH}:/usr/local/bin"
docker-machine ssh \${MACHINE} "sudo ntpclient -s -h \${NTP_SERVER}"
EOF
chmod +x ~/.wakeup

Replace <machine> with the name of your docker-machine instance.

@veacks

This comment has been minimized.

Show comment
Hide comment
@veacks

veacks Dec 8, 2015

In case of somebody is still looking for the solution an came across this issue,
nodemon --lagacy-watch or nodemon -L seems to do the trick for me.

veacks commented Dec 8, 2015

In case of somebody is still looking for the solution an came across this issue,
nodemon --lagacy-watch or nodemon -L seems to do the trick for me.

@b00giZm b00giZm referenced this issue Jan 10, 2016

Closed

01 don't work #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment