summaryrefslogtreecommitdiffstats
path: root/src/timesync (follow)
Commit message (Collapse)AuthorAgeFilesLines
* timesyncd: minor simplificationLennart Poettering2014-11-301-10/+16
|
* timesyncd: Support timesyncd.conf.d directories in the usual search pathsJosh Triplett2014-11-292-4/+8
|
* treewide: another round of simplificationsMichal Schmidt2014-11-281-8/+4
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-282-5/+5
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-281-36/+18
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt2014-11-281-2/+2
|
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-282-13/+13
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-282-13/+13
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* timesyncd: do not keep listening socket open foreverSean Young2014-11-271-7/+13
| | | | This also makes the source port less predicatable.
* timesyncd: the IP_TOS sockopt is really just an optimization, we shouldn't ↵Lennart Poettering2014-10-241-3/+1
| | | | | | fail if we can't set it This partially undos 2f905e821e0342c36f5a5d3a51d53aabccc800bd
* util: avoid duplication of TIME_T_MAXRonny Chevalier2014-10-211-2/+1
|
* timesyncd: check return of setting IP_TOSTom Gundersen2014-09-181-1/+3
| | | | Fonud by Coverity. Fixes CID #1237534.
* Revert "timesyncd: remove retry_timer logic which is covered by the server ↵Kay Sievers2014-09-022-0/+15
| | | | | | | | | | | timeout" This reverts commit 665c6a9eab46b0b253af6566ca9fc70c866b3fcd. On Tue, Sep 2, 2014 at 3:17 PM, Miroslav Lichvar <mlichvar@redhat.com> wrote: > > With the other patch allowing missed replies included it's now getting > stuck as there is no timer to send the 2nd and 3rd request.
* timesyncd: don't reset polling interval when reselecting serverKay Sievers2014-09-021-1/+2
| | | | Original patch from: Miroslav Lichvar <mlichvar@redhat.com>
* timesyncd: allow two missed replies before reselecting serverMiroslav Lichvar2014-09-022-9/+19
| | | | | | After receiving a reply from the server, allow two missed replies before switching to another server to avoid unnecessary clock hopping when packets are getting lost in the network.
* timesyncd: remove retry_timer logic which is covered by the server timeoutKay Sievers2014-09-022-15/+0
|
* timesyncd: wait before reconnecting to first serverMiroslav Lichvar2014-09-022-1/+24
| | | | | | | | When all servers are exhausted, wait for one poll interval before trying to connect again to the first server in the list. Also, keep increasing the polling interval to make sure a client not getting any valid replies will not send requests to any server more frequently than is allowed by the maximum polling interval.
* timesyncd-manager: don't clear current_server_name if ServerAddress is NULLSteven Noonan2014-08-311-1/+4
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=83091 [zj: add comment]
* timesyncd: check root distanceMiroslav Lichvar2014-08-291-0/+16
| | | | | | | | | NTPv4 servers don't reply with unsynchronized status when they lost synchronization, they only keep increasing the root dispersion and it's up to the client to decide at which point they no longer consider it synchronized. Ignore replies with root distance over 5 seconds.
* timesyncd: get kernel timestamp in nanosecondsMiroslav Lichvar2014-08-291-9/+5
|
* timesyncd: fix calculation of transmit timeMiroslav Lichvar2014-08-291-3/+1
| | | | | The kernel timestamp (recv_time) is made earlier than current time (now_ts), use the timestamp captured before sending packet directly.
* timesyncd: check if stratum is validMiroslav Lichvar2014-08-291-1/+2
|
* notify: send STOPPING=1 from our daemonsLennart Poettering2014-08-211-2/+6
|
* timesyncd: don't trip up if networkd isn't running and can't tell us any NTP ↵Lennart Poettering2014-08-131-3/+1
| | | | servers
* timesyncd: beef up NTP server selection logic, and acquire NTP servers from DHCPLennart Poettering2014-08-128-110/+367
|
* timesyncd: split up into multiple source fileLennart Poettering2014-08-128-1142/+1268
| | | | | The source file got much too large, hence split up the sources into multiple per-object files, similar in style to resolved.
* timesyncd: move the generic sockaddr_equal() call to socket-util.hLennart Poettering2014-08-121-16/+0
|
* timesyncd: when we don't know anything about the network state, assume we ↵Lennart Poettering2014-08-111-26/+24
| | | | | | are online This should provide better compatibility with systems that lack networkd
* timesyncd: always use CLOCK_BOOTTIME if we canLennart Poettering2014-08-111-8/+8
| | | | | After all we want to compare a monotonically increasing clock with the remote clock, hence we shouldn't ignore system suspend periods.
* Properly report invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-311-0/+2
| | | | | | | | $ systemd-analyze verify trailing-g.service [./trailing-g.service:2] Trailing garbage, ignoring. trailing-g.service lacks ExecStart setting. Refusing. Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument. Failed to create trailing-g.service/start: Invalid argument
* Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird
* core: only set the kernel's timezone when the RTC runs in local timeKay Sievers2014-07-272-5/+22
| | | | | | | | | | | | | | | | | | | We can not reliably manage any notion of local time. Every daylight saving time change or time zone change by traveling will make the time jump, and the local time might jump backwards which creates unsolvable problems with file timestamps. We will no longer tell the kernel our local time zone and leave everything set to UTC. This will effectively turn FAT timestamps into UTC timestamps. If and only if the machine is configured to read the RTC in local time mode, the kernel's time zone will be configured, but systemd-timesysnc will disable the kernel's system time to RTC syncing. In this mode, the RTC will not be managed, and external tools like Windows bootups are expected to manage the RTC's time. https://bugs.freedesktop.org/show_bug.cgi?id=81538
* sd-network: fix parameter order for sd_network_monitor_new()Lennart Poettering2014-07-171-1/+1
| | | | | | Constructors should return the object they created as first parameter, except when they are generated as a child/member object of some other object in which case that should be first.
* Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek2014-07-171-21/+4
| | | | | | | | Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
* Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek2014-07-161-1/+1
|
* timesyncd: add sockaddr_pretty wrapperZbigniew Jędrzejewski-Szmek2014-07-152-3/+7
|
* timesyncd: only listen to clock changes when connectedZbigniew Jędrzejewski-Szmek2014-07-151-7/+0
| | | | | | | | | | | | | 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
* timesyncd: suppress resync at system time change when not connectedKay Sievers2014-07-151-0/+3
| | | | | | | | | 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
* resolved: make use of union in_addr_union in resolved, tooLennart Poettering2014-07-071-0/+2
|
* timesyncd: split privilege dropping code out of timesyncd so that we can ↵Lennart Poettering2014-06-011-67/+1
| | | | | | make use of it from other daemons too This is preparation to make networkd work as unpriviliged user.
* timesysnc: reword network watching messages, and move resolver errors to debugKay Sievers2014-05-251-3/+3
|
* timesyncd: only update stamp file when we are synchronizedKay Sievers2014-05-242-71/+54
| | | | | | | | 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.
* time-util: make sure USEC_PER_SEC and friends are actually of type usec_tLennart Poettering2014-05-221-4/+4
|
* timesyncd: use STR_IN_SET()Kay Sievers2014-05-211-3/+3
|
* timesyncd: fix english language typoLennart Poettering2014-05-211-1/+1
|
* timesyncd: save clock to disk everytime we get an NTP fix, and bump clock at ↵Lennart Poettering2014-05-201-11/+93
| | | | | | | | | | | | | | | | 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...
* timesyncd: only attempt to connect when an address is configuredTom Gundersen2014-05-191-1/+1
| | | | | For now, we accept both link-local and routable addresses, maybe we want to restrict ourselves to routable addresses only.
* fix spelling of privilegeNis Martensen2014-05-181-3/+3
|
* timesyncd: make use of floating event sources for signal handlingLennart Poettering2014-05-182-8/+2
|
* timesyncd: enable watchdog supportLennart Poettering2014-05-181-0/+2
|