diff options
author | Kay Sievers <kay@vrfy.org> | 2014-04-29 08:57:51 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2014-04-29 09:51:53 +0200 |
commit | a91df40e69fec72cc98c9829721fa5153da28bc2 (patch) | |
tree | 7d1da98b41e9860df7b3d2d704ecb54618fe14aa | |
parent | 0b36bbc42d3a408531517a02acaf56105b863d55 (diff) |
timesyncd: add unit and man page
-rw-r--r-- | Makefile-man.am | 12 | ||||
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | man/systemd-timesyncd.service.xml | 74 | ||||
-rw-r--r-- | src/timesync/timesyncd.c | 8 | ||||
-rw-r--r-- | units/.gitignore | 1 | ||||
-rw-r--r-- | units/systemd-timesyncd.service.in | 20 |
7 files changed, 119 insertions, 7 deletions
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 @@ +<?xml version='1.0'?> <!--*-nxml-*--> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + +<!-- + This file is part of systemd. + + Copyright 2014 Kay Sievers + + 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. + + systemd 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see <http://www.gnu.org/licenses/>. +--> + +<refentry id="systemd-timesyncd.service" conditional='ENABLE_TIMESYNCD'> + + <refentryinfo> + <title>systemd-timesyncd.service</title> + <productname>systemd</productname> + + <authorgroup> + <author> + <contrib>Developer</contrib> + <firstname>Kay</firstname> + <surname>Sievers</surname> + <email>kay@vrfy.org</email> + </author> + </authorgroup> + </refentryinfo> + + <refmeta> + <refentrytitle>systemd-timesyncd.service</refentrytitle> + <manvolnum>8</manvolnum> + </refmeta> + + <refnamediv> + <refname>systemd-timesyncd.service</refname> + <refname>systemd-timesyncd</refname> + <refpurpose>Network Time Synchronization</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <para><filename>systemd-timesyncd.service</filename></para> + <para><filename>/usr/lib/systemd/systemd-timesyncd</filename></para> + </refsynopsisdiv> + + <refsect1> + <title>Description</title> + + <para><filename>systemd-timesyncd</filename> is a + system service that may be used to synchronize the local + system clock with a Network Time Protocol Server.</para> + </refsect1> + + <refsect1> + <title>See Also</title> + <para> + <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, + <citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, + <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>, + <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry> + </para> + </refsect1> + +</refentry> 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 |