From a91df40e69fec72cc98c9829721fa5153da28bc2 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 29 Apr 2014 08:57:51 +0200 Subject: timesyncd: add unit and man page --- Makefile-man.am | 12 +++++++ Makefile.am | 8 ++++- configure.ac | 3 +- man/systemd-timesyncd.service.xml | 74 ++++++++++++++++++++++++++++++++++++++ src/timesync/timesyncd.c | 8 ++--- units/.gitignore | 1 + units/systemd-timesyncd.service.in | 20 +++++++++++ 7 files changed, 119 insertions(+), 7 deletions(-) create mode 100644 man/systemd-timesyncd.service.xml create mode 100644 units/systemd-timesyncd.service.in diff --git a/Makefile-man.am b/Makefile-man.am index 60ee9917cd..262e4b1e87 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -1126,6 +1126,17 @@ man/systemd-timedated.html: man/systemd-timedated.service.html endif +if ENABLE_TIMESYNCD +MANPAGES += \ + man/systemd-timesyncd.service.8 +MANPAGES_ALIAS += \ + man/systemd-timesyncd.8 +man/systemd-timesyncd.8: man/systemd-timesyncd.service.8 +man/systemd-timesyncd.html: man/systemd-timesyncd.service.html + $(html-alias) + +endif + if ENABLE_VCONSOLE MANPAGES += \ man/systemd-vconsole-setup.service.8 \ @@ -1550,6 +1561,7 @@ EXTRA_DIST += \ man/systemd-system-update-generator.xml \ man/systemd-system.conf.xml \ man/systemd-timedated.service.xml \ + man/systemd-timesyncd.service.xml \ man/systemd-tmpfiles.xml \ man/systemd-tty-ask-password-agent.xml \ man/systemd-udevd.service.xml \ diff --git a/Makefile.am b/Makefile.am index 7783882d12..4661a2a3a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4023,8 +4023,14 @@ systemd_timesyncd_LDADD = \ libsystemd-shared.la \ -lm -noinst_PROGRAMS += \ +rootlibexec_PROGRAMS += \ systemd-timesyncd + +nodist_systemunit_DATA += \ + units/systemd-timesyncd.service + +EXTRA_DIST += \ + units/systemd-timesyncd.service.in endif # ------------------------------------------------------------------------------ diff --git a/configure.ac b/configure.ac index 7674485a86..02561b5418 100644 --- a/configure.ac +++ b/configure.ac @@ -822,7 +822,7 @@ AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"]) # ------------------------------------------------------------------------------ have_timesyncd=no AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon])) -if test "x$enable_timesyncd" != "xno"; then +if test "x$enable_timesyncd" = "xyes"; then have_timesyncd=yes fi AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"]) @@ -1158,6 +1158,7 @@ AC_MSG_RESULT([ machined: ${have_machined} hostnamed: ${have_hostnamed} timedated: ${have_timedated} + timesyncd: ${have_timesyncd} localed: ${have_localed} networkd: ${have_networkd} coredump: ${have_coredump} diff --git a/man/systemd-timesyncd.service.xml b/man/systemd-timesyncd.service.xml new file mode 100644 index 0000000000..84c4899cac --- /dev/null +++ b/man/systemd-timesyncd.service.xml @@ -0,0 +1,74 @@ + + + + + + + + + systemd-timesyncd.service + systemd + + + + Developer + Kay + Sievers + kay@vrfy.org + + + + + + systemd-timesyncd.service + 8 + + + + systemd-timesyncd.service + systemd-timesyncd + Network Time Synchronization + + + + systemd-timesyncd.service + /usr/lib/systemd/systemd-timesyncd + + + + Description + + systemd-timesyncd is a + system service that may be used to synchronize the local + system clock with a Network Time Protocol Server. + + + + See Also + + systemd1, + timedatectl1, + localtime5, + hwclock8 + + + + diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index 5bd61dd07c..6ec8139942 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -627,8 +627,8 @@ static int sntp_receive_response(sd_event_source *source, int fd, uint32_t reven m->samples_jitter, spike ? " spike" : "", m->poll_interval_usec / USEC_PER_SEC); - log_info("%4llu %+10f %10f %10f%s", - m->poll_interval_usec / USEC_PER_SEC, offset, delay, m->samples_jitter, spike ? " spike" : ""); + log_info("poll=%llu s offset=%+f s roundtrip=%f s", + m->poll_interval_usec / USEC_PER_SEC, offset, delay); if (!spike) { r = sntp_adjust_clock(m, offset, leap_sec); @@ -771,9 +771,7 @@ int main(int argc, char *argv[]) { if (r < 0) goto out; - //server = "216.239.32.15"; /* time1.google.com */ - //server = "192.53.103.108"; /* ntp1.ptb.de */ - server = "27.54.95.11"; /* au.pool.ntp.org */ + server = "216.239.32.15"; /* time1.google.com */ sd_notifyf(false, "READY=1\n" diff --git a/units/.gitignore b/units/.gitignore index 3bae4b46b6..fca17c974f 100644 --- a/units/.gitignore +++ b/units/.gitignore @@ -54,6 +54,7 @@ /systemd-suspend.service /systemd-sysctl.service /systemd-timedated.service +/systemd-timesyncd.service /systemd-tmpfiles-clean.service /systemd-tmpfiles-setup-dev.service /systemd-tmpfiles-setup.service diff --git a/units/systemd-timesyncd.service.in b/units/systemd-timesyncd.service.in new file mode 100644 index 0000000000..4a363f71ca --- /dev/null +++ b/units/systemd-timesyncd.service.in @@ -0,0 +1,20 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Network Time Synchronization +Documentation=man:systemd-timesyncd.service(8) +ConditionCapability=CAP_SYS_TIME + +[Service] +Type=notify +Restart=always +RestartSec=0 +ExecStart=@rootlibexecdir@/systemd-timesyncd + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-54-g00ecf