chiark / gitweb /
units: add hwclock-load service
authorLennart Poettering <lennart@poettering.net>
Wed, 18 Aug 2010 00:24:31 +0000 (02:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 18 Aug 2010 00:24:31 +0000 (02:24 +0200)
Makefile.am
units/hwclock-load.service [new file with mode: 0644]

index 7414d5644bb2d411ad06ee7915ac01017bd80483..4905f2dad1b40f5604d571e20e47cb618e0b4650 100644 (file)
@@ -156,6 +156,7 @@ dist_systemunit_DATA = \
        units/var-lock.service \
        units/var-run.mount \
        units/var-run.service \
        units/var-lock.service \
        units/var-run.mount \
        units/var-run.service \
+       units/hwclock-load.service \
        units/hwclock-save.service \
        units/sysctl.service \
        units/printer.target \
        units/hwclock-save.service \
        units/sysctl.service \
        units/printer.target \
diff --git a/units/hwclock-load.service b/units/hwclock-load.service
new file mode 100644 (file)
index 0000000..85d56db
--- /dev/null
@@ -0,0 +1,31 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Apply System Clock UTC Offset
+DefaultDependencies=no
+Conflicts=shutdown.target
+Before=shutdown.target udev.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/sbin/hwclock --systz
+
+# Note the weird semantics if hwclock and the kernel here: the first
+# settimeofday() invocation from userspace is special and may be used
+# to set the offset from UTC of the system clock. It is independent
+# of any specific RTC device. This is mostly a crufty hack to support
+# legacy operating systems which insist on storing local time in the
+# RTC.
+
+# Note that we do not run --hctosys here, we assume the kernel
+# includes a compiled in RTC module which is used to initialize the
+# system time as part of kernel setup.
+
+[Install]
+WantedBy=sysinit.target