Commit graph

44 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e9f3d2d508 Constify ConfigTableItem tables 2014-07-15 22:34:40 -04:00
Zbigniew Jędrzejewski-Szmek ae2db4e7e8 timesyncd: add sockaddr_pretty wrapper 2014-07-15 09:53:18 -04:00
Zbigniew Jędrzejewski-Szmek c566ee3253 timesyncd: only listen to clock changes when connected
This reverts previous commit and applies a different fix.

manager_clock_watch() callback calls manager_send_request() to kick
off a resync. We can only do that when we're actually connected to
something. It is not useful to setup the callback from manager_new().

Now the callback will be dropped in manager_connect() and requested
in manager_begin().

https://bugs.freedesktop.org/show_bug.cgi?id=80932
2014-07-15 09:52:19 -04:00
Kay Sievers afc7b1b9c1 timesyncd: suppress resync at system time change when not connected
Jul 04 17:46:03 orchid systemd[1]: Starting Network Time Synchronization...
Jul 04 17:46:03 orchid systemd[1]: Started Network Time Synchronization.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: System time changed. Resyncing.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: Assertion 'm->current_server_name'

https://bugs.freedesktop.org/show_bug.cgi?id=80932
2014-07-15 02:24:35 +02:00
Lennart Poettering c92e531c82 resolved: make use of union in_addr_union in resolved, too 2014-07-07 23:11:48 +02:00
Lennart Poettering 966bff2660 timesyncd: split privilege dropping code out of timesyncd so that we can make use of it from other daemons too
This is preparation to make networkd work as unpriviliged user.
2014-06-01 08:49:33 +02:00
Kay Sievers 4d40d39cdf timesysnc: reword network watching messages, and move resolver errors to debug 2014-05-25 13:46:43 +08:00
Kay Sievers d636d37679 timesyncd: only update stamp file when we are synchronized
Create initial stamp file with compiled-in time to prevent bootups
with clocks in the future from storing invalid timestamps.

At shutdown, only update the timestamp if we got an authoritative
time to store.
2014-05-24 08:04:56 +08:00
Lennart Poettering 609e002e78 time-util: make sure USEC_PER_SEC and friends are actually of type usec_t 2014-05-22 11:44:03 +09:00
Kay Sievers a6cb8f870d timesyncd: use STR_IN_SET() 2014-05-21 10:36:02 +09:00
Lennart Poettering a57a27b2ef timesyncd: fix english language typo 2014-05-21 09:36:49 +09:00
Lennart Poettering ece6e766cf timesyncd: save clock to disk everytime we get an NTP fix, and bump clock at boot using this
This is useful to make sure the system clock stays monotonic even on
systems that lack an RTC.

Also, why we are at it, also use the systemd release time for bumping
the clock, since it's a slightly less bad than starting with jan 1st,
1970.

This also moves timesyncd into the early bootphase, in order to make
sure this initial bump is guaranteed to have finished by the time we
start real daemons which might write to the file systemd and thus
shouldn't leave 1970's timestamps all over the place...
2014-05-21 00:23:39 +09:00
Tom Gundersen e56f363803 timesyncd: only attempt to connect when an address is configured
For now, we accept both link-local and routable addresses, maybe we want to
restrict ourselves to routable addresses only.
2014-05-19 20:54:42 +02:00
Nis Martensen f1721625e7 fix spelling of privilege 2014-05-19 00:40:44 +09:00
Lennart Poettering f864fd1b4b timesyncd: make use of floating event sources for signal handling 2014-05-18 20:52:49 +09:00
Lennart Poettering 9f7115498b timesyncd: enable watchdog support 2014-05-18 20:52:49 +09:00
Lennart Poettering a349eb10d3 timesyncd: run timesyncd as unpriviliged user "systemd-timesync" (but still with CAP_SYS_TIME) 2014-05-18 20:52:49 +09:00
Kay Sievers 15a224e06c timesyncd: fix typo in comment 2014-05-16 04:00:59 +02:00
Kay Sievers 59a9fce47b timesyncd: fix error path return value
https://bugs.freedesktop.org/show_bug.cgi?id=78752
2014-05-15 20:50:02 +02:00
Tom Gundersen 9b3310b066 timesyncd: read global operational state from networkd 2014-05-08 17:32:32 +02:00
Tom Gundersen e0e5ce237b timesyncd: only run when the system has a carrier on a network interface
As the operational state detection in sd-network is still too primitive, timesyncd
will likely try to connect a bit early, so the first attempt will fail.
2014-05-08 15:28:19 +02:00
Kay Sievers 089377209f timesyncd: shorten log message 2014-05-07 14:45:32 +02:00
Lennart Poettering 661278ee29 timesyncd: never accept NTP time from server that is older than systemd's release time 2014-05-06 18:08:04 +02:00
Lennart Poettering e8af69739a timesyncd: read server settings from a configuration file
Also, allow compiling in a default server list via a configure command
line item.
2014-05-06 17:02:11 +02:00
Lennart Poettering 16c058ba01 timesyncd: when an NTP server doesn't respond, proceed with the next 2014-05-06 16:15:02 +02:00
Lennart Poettering 376cd3b89c list: make LIST_FIND_TAIL work for empty lists 2014-05-06 13:07:15 +02:00
Lennart Poettering 600809211e timesyncd: keep order of NTP servers 2014-05-06 12:34:37 +02:00
Lennart Poettering 05f7fc0fe3 timesyncd: make sure to reread /etc/resolv.conf when we try the next NTP server 2014-05-06 12:34:37 +02:00
Kay Sievers 136aa3b444 timesyncd: accept NTP version 3 responses 2014-05-06 12:29:20 +02:00
Lennart Poettering 881c74201d timesyncd: add a more servers by default 2014-05-06 01:37:29 +02:00
Lennart Poettering becad8f1ed timesyncd: also try next server when sendto() fails 2014-05-06 01:37:13 +02:00
Lennart Poettering 7a183c4c73 timesyncd: don't busy loop when we cannot connect to any servers 2014-05-06 01:29:47 +02:00
Lennart Poettering 678522cff0 timesyncd: properly handle multiple configured NTP servers and multiplei IP addresses per server name 2014-05-06 01:17:35 +02:00
Lennart Poettering 856a5a7d76 timesyncd: lookup name server via sd-resolve, support IPv6, react to SIGINT/SITERM 2014-05-05 23:53:17 +02:00
Lennart Poettering 7ed0dd4be6 timesync: use safe_close() where possible 2014-05-05 21:47:38 +02:00
Lennart Poettering 5f8cfaee52 timesync: always initialize structs when declaring them as far as possible with contsant values 2014-05-05 21:47:09 +02:00
Kay Sievers ee03381e21 timesyncd: log drift value as signed 2014-05-05 14:21:40 +02:00
Kay Sievers ef6191945e timesyncd: log drift correction 2014-05-03 15:09:33 +02:00
Kay Sievers d67006fe53 timesyncd: use nanosecond mode 2014-04-30 17:25:46 +02:00
Kay Sievers 81c36b3f28 timesyncd: remove debug code 2014-04-30 09:37:59 +02:00
Kay Sievers ba9f11dc98 timesyncd: limit debug values to milliseconds 2014-04-29 23:48:23 +02:00
Kay Sievers 39594d49cf timesyncd: update log message 2014-04-29 10:16:07 +02:00
Kay Sievers a91df40e69 timesyncd: add unit and man page 2014-04-29 09:51:53 +02:00
Kay Sievers 687ed1237b rename timedate-sntp to timesync 2014-04-28 17:08:52 +02:00
Renamed from src/timedate/timedate-sntp.c (Browse further)