| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Because of alignment, those bitfields were not doing anything useful,
and were causing the generated code to be more complicated. But in this
case, at least potentially there might be a number of copies of those
structs (if we have a bunch of time servers configured), so let's actually
implement the intended space savings by reording the fields to reduce the
size of holes.
|
|
|
|
|
| |
This improves security against off-path attackers, and avoids leaking
the current system time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Emit signal when timesyncd LinkNTPServers property changes
Tested:
```
Monitoring bus message stream.
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=21 Timestamp="Fri 2023-05-19 07:50:47.427051 UT"
Sender=:1.623 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Memberd
UniqueName=:1.623
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "LinkNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.8.8.18";
STRING "10.8.8.19";
};
};
};
};
ARRAY "s" {
};
};
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=28 Timestamp="Fri 2023-05-19 07:53:22.609416 UT"
Sender=:1.623 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Memberd
UniqueName=:1.623
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "LinkNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.8.8.18";
STRING "10.8.8.20";
};
};
};
};
ARRAY "s" {
};
};
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=6 Timestamp="Fri 2023-05-19 08:12:26.964666 UTC"
Sender=:1.627 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Memberd
UniqueName=:1.627
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "LinkNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.8.8.18";
};
};
};
};
ARRAY "s" {
};
};
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=162 Timestamp="Mon 2023-07-10 09:06:18.865654 UTC"
Sender=:1.1 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Member=PropertiesChanged
UniqueName=:1.1
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "RuntimeNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.2.16.10";
};
};
};
};
ARRAY "s" {
};
};
```
Signed-off-by: Kingbom Dou <doujinbao@bytedance.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This new server type can only be set at runtime through a D-Bus method
and is exposed for reading through a D-Bus property.
`CAP_NET_ADMIN` and a PolKit acknowledge is required for setting
runtime servers.
Entries submitted that way are used before system and link servers
are being looked at.
|
|
|
|
| |
This function use useful from other files, so let's export it.
|
|
|
|
|
|
|
|
|
|
| |
correctly
Usecase: later on we can use this to retroactively adjust log output in
journalctl or similar on systems lacking an RTC: we just have to search
for this sructured log message that indicates the first sync point and
can then retroactively adjust the incorrect timestamps collected before
that.
|
|
|
|
|
| |
THe name is just too generic. Let's pick a name that makes clear that
this is about successful communication.
|
|
|
|
|
|
|
|
|
|
| |
changes
We basically had the same code in three places. Let's unify it in a
common helper function.
event_add_time_change() might be something we should add to the official
sd-event API sooner or later, given its general usefulness.
|
| |
|
|
|
|
|
| |
PollIntervalMinSec and PollIntervalMaxSec use the same pattern, but
RootDistanceMaxSec had switched orderd in the code.
|
|
|
|
|
|
| |
I started working on this because I wanted to change how
DEFINE_TRIVIAL_CLEANUP_FUNC is defined. Even independently of that change, it's
nice to make make things more consistent and predictable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```
❯ ssh sus@xx.xx.xx.xx
Last login: Sat Nov 14 17:32:08 2020 from 10.104.45.138
17:36:19 up 0 min, 0 users, load average: 0.00, 0.00, 0.00
> systemd-analyze blame
Bootup is not yet finished (org.freedesktop.systemd1.Manager.FinishTimestampMonotonic=0).
Please try again later.
Hint: Use 'systemctl list-jobs' to see active jobs
> systemd-analyze blame
43.954s systemd-time-wait-sync.service
1.969s systemd-networkd-wait-online.service
1.559s cloud-init-local.service
1.039s cloud-init.service
414ms cloud-final.service
387ms dracut-initqueue.service
382ms initrd-switch-root.service
380ms cloud-config.service
198ms systemd-journal-flush.service
136ms systemd-udev-trigger.service
115ms initrd-parse-etc.service
97ms systemd-timesyncd.service
84ms systemd-journald.service
```
After made it configurable and set to 5s
```
❯ ssh sus@xx.xx.xx.xx
Last login: Sat Nov 14 18:41:42 2020 from 10.104.45.138
18:42:36 up 0 min, 0 users, load average: 0.16, 0.03, 0.01
> systemd-analyze blame
10.450s systemd-time-wait-sync.service
8.303s systemd-networkd-wait-online.service
1.621s cloud-init-local.service
1.068s cloud-init.service
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The new retry intervals are [15, 20, 26, 34, 45, 60, 80, 106, 141, 188, 250,
333, 360, ...]. This should allow graceful response if a transient network
failure is encountered. Growth is exponential, but with a small power and
capped to a non-too-large value so that we resynchronize within a few minutes
after network is restored. I made the minimum 15 s to make sure that we never
send packets more often than that.
Fixes #16492.
|
| |
|
| |
|
|
|
|
|
|
|
| |
drift_freq is used for storing timex.freq, and is a 64bit integer.
To support x32 ABI, this changes the type of drift_freq to int64_t.
Fixes #9387.
|
|
|
|
|
|
|
|
| |
Fixes #9320.
for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do
git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms'
done
|
|
|
|
|
|
| |
Let's unify an beautify our remaining copyright statements, with a
unicode ©. This means our copyright statements are now always formatted
the same way. Yay.
|
|
|
|
|
|
|
|
|
|
|
| |
These lines are generally out-of-date, incomplete and unnecessary. With
SPDX and git repository much more accurate and fine grained information
about licensing and authorship is available, hence let's drop the
per-file copyright notice. Of course, removing copyright lines of others
is problematic, hence this commit only removes my own lines and leaves
all others untouched. It might be nicer if sooner or later those could
go away too, making git the only and accurate source of authorship
information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This part of the copyright blurb stems from the GPL use recommendations:
https://www.gnu.org/licenses/gpl-howto.en.html
The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.
hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.
I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
|
|
|
|
|
| |
This follows what the kernel is doing, c.f.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
|
|
|
|
|
|
| |
This adds PollIntervalMinSec= and PollIntervalMaxSec= to timesyncd.conf
Closes #7262.
|
|
|
| |
Closes #7211.
|
|
|
|
|
|
|
|
|
| |
explicitly
Parse the config files first and only apply the compiled-in list of
fallback servers if no NTP server was configured via FallbackNTP.
Closes: #5091
|
|
|
|
|
| |
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
|
|
|
|
|
| |
This is a continuation of the previous include sort patch, which
only sorted for .c files.
|
| |
|
|
|
|
|
|
| |
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
The source file got much too large, hence split up the sources into
multiple per-object files, similar in style to resolved.
|