From 7e76e8b41481929c9563bbf082a8daee7f2184bd Mon Sep 17 00:00:00 2001 From: Tobias Wiese Date: Mon, 29 Dec 2025 17:10:07 +0100 Subject: Initial commit --- debian/changelog | 5 +++++ debian/control | 22 ++++++++++++++++++++++ debian/copyright | 20 ++++++++++++++++++++ debian/install | 2 ++ debian/rules | 4 ++++ debian/source/format | 1 + ntp-units.d/50-rtctimesync.list | 1 + rtctimesync.service | 7 +++++++ rtctimesync.timer | 11 +++++++++++ 9 files changed, 73 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 ntp-units.d/50-rtctimesync.list create mode 100644 rtctimesync.service create mode 100644 rtctimesync.timer diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..de56c89 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rtctimesync (1.0) unstable-tobiaswiese; urgency=medium + + * Initial release. + + -- Tobias Wiese Mon, 29 Dec 2025 15:44:59 +0000 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..92f6c60 --- /dev/null +++ b/debian/control @@ -0,0 +1,22 @@ +Source: rtctimesync +Section: admin +Priority: optional +Maintainer: tobiaswiese.net hostmasters +Uploaders: Tobias Wiese +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.0 +Rules-Requires-Root: no +Homepage: https://git.tobiaswiese.net/hostmaster/rtctimesync.git/ +Vcs-Git: https://git.tobiaswiese.net/hostmaster/rtctimesync.git +Vcs-Browser: https://git.tobiaswiese.net/hostmaster/rtctimesync.git/ + +Package: rtctimesync +Architecture: all +Multi-Arch: foreign +Depends: ${misc:Depends}, util-linux-extra | util-linux (<< 3.38-1~) +Description: periodically synchronize system time from real time clock + When running under virtualization the virtual rtc is often backed by the + virtualizers system time. + . + Instead of using ntp on every vm. The host's clock can be synced via ntp and + the vms can take their time from the host (through the virtual rtc). diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..d1d484b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,20 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: * +Copyright: 2025 Tobias Wiese +License: GPL-2.0-or-later + This package 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. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..12f21f2 --- /dev/null +++ b/debian/install @@ -0,0 +1,2 @@ +rtctimesync.service rtctimesync.timer usr/lib/systemd/system/ +ntp-units.d/* usr/lib/systemd/ntp-units.d/ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/ntp-units.d/50-rtctimesync.list b/ntp-units.d/50-rtctimesync.list new file mode 100644 index 0000000..85756ad --- /dev/null +++ b/ntp-units.d/50-rtctimesync.list @@ -0,0 +1 @@ +rtctimesync.timer diff --git a/rtctimesync.service b/rtctimesync.service new file mode 100644 index 0000000..c9d153d --- /dev/null +++ b/rtctimesync.service @@ -0,0 +1,7 @@ +[Unit] +Description=Synchronize system time from real time clock +ConditionVirtualization=yes +Documentation=man:hwclock(1) + +[Service] +ExecStart=/usr/sbin/hwclock --hctosys diff --git a/rtctimesync.timer b/rtctimesync.timer new file mode 100644 index 0000000..4ffac0a --- /dev/null +++ b/rtctimesync.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Synchronize system time from hardware clock +ConditionVirtualization=yes +Documentation=man:hwclock(1) + +[Timer] +OnActiveSec=256s +OnUnitActiveSec=256s + +[Install] +WantedBy=timers.target -- cgit v1.2.3