Commit 58da7faf authored by Martin Pitt's avatar Martin Pitt

Add hwclock-save.service to sync the system clock to the hardware clock on shutdown

This provides monotonic time for reboots. Thanks to Stefan Fritsch for the
initial unit.

Note: this is a hack for jessie; the next Debian release will enable timesyncd
by default.

Closes: #755722
parent 30a6a331
systemd (215-13) UNRELEASED; urgency=medium
* Add hwclock-save.service to sync the system clock to the hardware clock on
shutdown, to provide monotonic time for reboots. (Note: this is a hack for
jessie; the next Debian release will enable timesyncd by default).
(Closes: #755722)
-- Martin Pitt <mpitt@debian.org> Mon, 16 Feb 2015 16:11:12 +0100
systemd (215-12) unstable; urgency=medium
[ Martin Pitt ]
......
[Unit]
Description=Synchronise Hardware Clock to System Clock
DefaultDependencies=no
Before=shutdown.target
ConditionFileIsExecutable=!/usr/sbin/ntpd
ConditionFileIsExecutable=!/usr/sbin/openntpd
ConditionFileIsExecutable=!/usr/sbin/chrony
[Service]
Type=oneshot
ExecStart=/sbin/hwclock -D --systohc
[Install]
WantedBy=reboot.target halt.target poweroff.target
......@@ -183,7 +183,7 @@ override_dh_install:
debian/systemd/lib/lsb/init-functions.d/40-systemd
install --mode=644 debian/tmpfiles.d/debian.conf \
debian/systemd/usr/lib/tmpfiles.d/
install --mode=644 debian/debian-fixup.service debian/ifup@.service debian/extra/getty-static.service \
install --mode=644 debian/debian-fixup.service debian/ifup@.service debian/extra/getty-static.service debian/extra/hwclock-save.service \
debian/systemd/lib/systemd/system/
install -D --mode=644 debian/extra/network-pre.conf \
debian/systemd/lib/systemd/system/networking.service.d/network-pre.conf
......
......@@ -131,6 +131,10 @@ if dpkg --compare-versions "$2" lt "214-1"; then
systemctl enable remote-fs.target || true
fi
if dpkg --compare-versions "$2" lt "215-13"; then
systemctl enable hwclock-save.service || true
fi
# Re-run systemctl enable for any service that was enabled when preinst was run.
if dpkg --compare-versions "$2" ge "204"; then
while read UNIT ; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment