Skip to content

Commit

Permalink
Disables systemd-timesync *after* apt-get complete
Browse files Browse the repository at this point in the history
Moves the disabling of systemd services to after all apt operations have
completed, as in theory possible that subsequent apt-get installation
operations could re-enable the systemd-timesyncd service.

There is no evidence of this occurring, but still appropriate as a risk
reduction measure.

#107

#145
  • Loading branch information
shasheene committed Dec 11, 2020
1 parent 5ba24a0 commit f661249
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions chroot.steps.part.1.sh
Expand Up @@ -262,11 +262,3 @@ rm /usr/share/icons/*/icon-theme.cache
rm -rf /usr/share/doc
rm -rf /usr/share/man
rm -rf /etc/network/if-up.d/ntpdate

# Disable systemd's built-in NTP time synchronization service by manually masking it (`systemctl mask`)
# using a symlink. This timesyncd service always modifies the hardware clock, and there
# does not appear to be a way to prevent this service from modifying the hardware clock.
# See [1] for more discussion.
# [1] https://github.com/rescuezilla/rescuezilla/issues/107
rm /etc/systemd/system/systemd-timesyncd.service
ln -s /dev/null /etc/systemd/system/systemd-timesyncd.service
8 changes: 8 additions & 0 deletions chroot.steps.part.2.sh
Expand Up @@ -56,6 +56,14 @@ mv /var/lib/apt/lists /var.lib.apt.lists
# and /var/cache/apt/archives/partial/."
apt-get clean

# Disable systemd's built-in NTP time synchronization service by manually masking it (`systemctl mask`)
# using a symlink. This timesyncd service always modifies the hardware clock, and there
# does not appear to be a way to prevent this service from modifying the hardware clock.
# See [1] for more discussion.
# [1] https://github.com/rescuezilla/rescuezilla/issues/107
rm /etc/systemd/system/systemd-timesyncd.service
ln -s /dev/null /etc/systemd/system/systemd-timesyncd.service

rm -rf /tmp/*
rm /etc/resolv.conf
rm -rf /var/lib/apt/lists/????????*
Expand Down

0 comments on commit f661249

Please sign in to comment.