Skip to content

Commit

Permalink
chroot: systemd v235 and later moved the timestamp file location
Browse files Browse the repository at this point in the history
fixes: RobertCNelson#140
Signed-off-by: Robert Nelson <[email protected]>
  • Loading branch information
RobertCNelson committed Apr 21, 2021
1 parent 8cd7553 commit fa0c6d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1113,12 +1113,20 @@ cat > "${DIR}/chroot_script.sh" <<-__EOF__
echo "Log: (chroot): enabling: systemd-timesyncd.service"
systemctl enable systemd-timesyncd.service || true
#systemd v232: (Debian Stretch)
#set our own initial date stamp, otherwise we get July 2014
touch /var/lib/systemd/clock
#if systemd-timesync user exits, use that instead. (this user was removed in later systemd's)
cat /etc/group | grep ^systemd-timesync && chown systemd-timesync:systemd-timesync /var/lib/systemd/clock || true
#systemd v235+: (Debian Buster/Bullseye)
#set our own initial date stamp, otherwise we get July 2014
touch /var/lib/systemd/timesync/clock
#if systemd-timesync user exits, use that instead. (this user was removed in later systemd's)
cat /etc/group | grep ^systemd-timesync && chown systemd-timesync:systemd-timesync /var/lib/systemd/timesync/clock || true
#Remove ntpdate
if [ -f /usr/sbin/ntpdate ] ; then
apt-get remove -y ntpdate --purge || true
Expand Down

0 comments on commit fa0c6d3

Please sign in to comment.