From 925be528fd4a75c7bb2870855082d77957c3678c Mon Sep 17 00:00:00 2001 From: Jakub Novak Date: Wed, 5 Feb 2025 15:22:03 -0800 Subject: [PATCH 1/2] Correct path (the same is already used in SDKs) --- packages/envd/internal/host/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/envd/internal/host/sync.go b/packages/envd/internal/host/sync.go index fc693c804..dc3adabf6 100644 --- a/packages/envd/internal/host/sync.go +++ b/packages/envd/internal/host/sync.go @@ -17,7 +17,7 @@ func updateClock() error { defer cancel() // The chronyc -a makestep is not immediately stepping the clock - err := exec.CommandContext(ctx, "/usr/bin/bash", "-c", "/usr/bin/date -s @$(/usr/sbin/phc_ctl /dev/ptp0 get | cut -d' ' -f5)").Run() + err := exec.CommandContext(ctx, "/bin/bash", "-c", "/bin/date -s @$(/usr/sbin/phc_ctl /dev/ptp0 get | cut -d' ' -f5)").Run() if err != nil { return fmt.Errorf("failed to update clock: %w", err) } From 38ffc4e59a5e3200557dcf4dfe8ec252b86abbcd Mon Sep 17 00:00:00 2001 From: Jakub Novak Date: Wed, 5 Feb 2025 15:47:34 -0800 Subject: [PATCH 2/2] Improve the command --- packages/envd/internal/host/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/envd/internal/host/sync.go b/packages/envd/internal/host/sync.go index dc3adabf6..e7b24bf2a 100644 --- a/packages/envd/internal/host/sync.go +++ b/packages/envd/internal/host/sync.go @@ -17,7 +17,7 @@ func updateClock() error { defer cancel() // The chronyc -a makestep is not immediately stepping the clock - err := exec.CommandContext(ctx, "/bin/bash", "-c", "/bin/date -s @$(/usr/sbin/phc_ctl /dev/ptp0 get | cut -d' ' -f5)").Run() + err := exec.CommandContext(ctx, "/bin/bash", "-l", "-c", "date -s @$(/usr/sbin/phc_ctl /dev/ptp0 get | cut -d' ' -f5)").Run() if err != nil { return fmt.Errorf("failed to update clock: %w", err) }