1
0
mirror of https://github.com/rancher/os.git synced 2025-09-03 15:54:24 +00:00

Start ntpd using a script and -gx first

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-07-19 16:09:02 +10:00
parent 24f45e4eba
commit 5ba2c76c71
4 changed files with 9 additions and 7 deletions

View File

@@ -33,6 +33,7 @@ RUN rm /sbin/poweroff /sbin/reboot /sbin/halt && \
echo '%sudo ALL=(ALL) ALL' >> /etc/sudoers
COPY inputrc /etc/inputrc
COPY growpart /usr/bin/growpart
COPY start_ntp.sh /bin/start_ntp.sh
RUN sed -i s/"partx --update \"\$part\" \"\$dev\""/"partx --update --nr \"\$part\" \"\$dev\""/g /usr/bin/growpart && \
sed -i -e 's/duid/clientid/g' /etc/dhcpcd.conf && \
sed -i 1,10d /etc/rsyslog.conf && \

6
images/01-base/start_ntp.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -ex
echo "starting in one shot mode to fix large time differences"
ntpd -gq
echo "starting long running nptd"
exec ntpd --nofork -g

View File

@@ -211,7 +211,7 @@ rancher:
- /usr/bin/iptables:/sbin/iptables:ro
ntp:
image: {{.OS_REPO}}/os-base:{{.VERSION}}{{.SUFFIX}}
command: ntpd --nofork -g
command: /bin/start_ntp.sh
labels:
io.rancher.os.scope: system
io.rancher.os.after: network

View File

@@ -21,12 +21,7 @@ fi
# build kexec
pushd .
cd scripts/installer/kexec
echo Downloading dapper
curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m|sed 's/v7l//'` > .dapper.tmp
chmod +x .dapper.tmp
./.dapper.tmp -v
mv .dapper.tmp .dapper
./.dapper
dapper
popd