sormy / gentoo-ami-builder

Gentoo AMI Builder - Amazon Image builder for Gentoo Linux
MIT License
51 stars 20 forks source link

Phase2 - ntpd is broken on latest amazon linux ami #10

Closed k2t0f12d closed 3 years ago

k2t0f12d commented 3 years ago

ap-southeast-2 ami-09cc0712275eacf93

NOTE: Doesn't seem to work when ntpd is already running

 *   Process has failed with error code 1: ntpd -gq
     > 18 Aug 03:43:28 ntpd[2688]: ntpd 4.2.8p15@1.3728-o Thu Sep 24 16:50:31 UTC 2020 (1): Starting
     > 18 Aug 03:43:28 ntpd[2688]: Command line: ntpd -gq
     > 18 Aug 03:43:28 ntpd[2688]: ----------------------------------------------------
     > 18 Aug 03:43:28 ntpd[2688]: ntp-4 is maintained by Network Time Foundation,
     > 18 Aug 03:43:28 ntpd[2688]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
     > 18 Aug 03:43:28 ntpd[2688]: corporation.  Support and training for ntp-4 are
     > 18 Aug 03:43:28 ntpd[2688]: available at https://www.nwtime.org/support
     > 18 Aug 03:43:28 ntpd[2688]: ----------------------------------------------------
     > 18 Aug 03:43:28 ntpd[2688]: proto: precision = 0.058 usec (-24)
     > 18 Aug 03:43:28 ntpd[2688]: basedate set to 2020-09-12
     > 18 Aug 03:43:28 ntpd[2688]: gps base set to 2020-09-13 (week 2123)
     > 18 Aug 03:43:28 ntpd[2688]: unable to bind to wildcard address 0.0.0.0 - another process may be running - EXITING

Manually routed around thusly (probably isn't the best way) phase2-prepare-root.sh:

# having wrong time will cause all kinds of troubles
##eexec yum -y -q install ntp
##eexec ntpd -gq
eexec service ntpd stop
eexec ntpd -gq
eexec service ntpd start
sormy commented 3 years ago

Thanks for report. Will take a look. Looks like ntpd is already running on fresh Amazon Linux 2 versions

sormy commented 3 years ago

I have just executed image builder for amd64 on us-east-1 and did not get any errors. Could you please confirm the command line you used to build the image.

sormy commented 3 years ago

I have added a fix to kill ntpd if it is already running.