From 5c1356a1eca582fdf7a48d7527f67a916408e0aa Mon Sep 17 00:00:00 2001 From: Adrian Zaharia Date: Mon, 28 Jun 2021 12:02:16 +0300 Subject: ntp: fix ntpdate to wait for subprocesses When using systemd, ntpdate-sync script will start in background triggering the start of ntpd without actually exiting. This results in an bind error in ntpd startup. Add wait at the end of ntpdate script to ensure that when the ntpdate.service is marked as finished the oneshot script ntpdate-sync finished and unbind the ntp port Fixes #386 Signed-off-by: Adrian Zaharia Signed-off-by: Khem Raj (cherry picked from commit 73d5cd5e8d9d8a922b6a8a9d90adf0470a99314e) Signed-off-by: Armin Kuster (cherry picked from commit f52ce99b468eff95b6e36caf41fb50808a26f8d5) Signed-off-by: Armin Kuster --- meta-networking/recipes-support/ntp/ntp/ntpdate | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'meta-networking/recipes-support') diff --git a/meta-networking/recipes-support/ntp/ntp/ntpdate b/meta-networking/recipes-support/ntp/ntp/ntpdate index 17b64d1335..be3bacfcd1 100755 --- a/meta-networking/recipes-support/ntp/ntp/ntpdate +++ b/meta-networking/recipes-support/ntp/ntp/ntpdate @@ -52,3 +52,8 @@ if [ -x /usr/bin/lockfile-create ] ; then fi ) & + +# wait for all subprocesses to finish +# this is required when using systemd service as ntpd will start before ntpdate finishes +# and results in a bind error (port 123) +wait -- cgit 1.2.3-korg