| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
On RISCV32, time_t is 64bit and size_t is 32bit, hence the timestamp
data in message header may not be aligned.
Fixes #27241.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All daemons use a similar scheme to read their main config files and theirs
drop-ins. The main config files are always stored in /etc/systemd directory and
it's easy enough to construct the name of the drop-in directories based on the
name of the main config file.
Hence the new helper does that internally, which allows to reduce and simplify
the args passed previously to config_parse_many_nulstr().
Besides the overall code simplification it results:
16 files changed, 87 insertions(+), 159 deletions(-)
it allows to identify clearly the locations in the code where configuration
files are parsed.
|
|
|
|
| |
This will help in a later commit to separate userspace from EFI builds.
|
|
|
|
|
|
|
|
|
| |
are configured (#26708)
This commit fixes an issue where systemd-timesyncd re-synchronizes the
system clock every time the network configuration is updated, no matter
whether link servers are actually changed.
Fixes a bug introduced by e05dd7718d0b32e039c9e0f7bf3875079d1a359d.
|
| |
|
|
|
|
|
|
|
| |
Although this slightly more verbose it makes it much easier to reason
about. The code that produces the tests heavily benefits from this.
Test lists are also now sorted by test name.
|
|
|
|
|
|
| |
Meson+ninja+compiler do this for us and are better at it.
https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
|
|
|
|
|
|
|
|
| |
Let's make sure the timestamp file's mtime is guaranteed to change for
each boot, so that it is a useful indicator of time. Or in other words
this gurantees that systemd-timesyncd.service acts as a new kind of
milestone: that time definitely progressed on this boot even the machine
died abnormally imediately after.
|
|
|
|
| |
Let's log more.
|
|
|
|
|
|
|
|
|
|
|
|
| |
disk timestamp
It's useful being able to easily detect if a disk-based clock bump was
done, let's make it a structure message, the same way as acquiring an
NTP fix already is.
Also, set the clock to 1 µs further than the timestamp from the disk,
after all we know that that timestamp was current when it was written,
hence it can't be the right one right now anymore.
|
|
|
|
|
| |
Let's use statement expressions to return values instead of passing
in return arguments to the LIST macros.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-1 was used everywhere, but -EBADF or -EBADFD started being used in various
places. Let's make things consistent in the new style.
Note that there are two candidates:
EBADF 9 Bad file descriptor
EBADFD 77 File descriptor in bad state
Since we're initializating the fd, we're just assigning a value that means
"no fd yet", so it's just a bad file descriptor, and the first errno fits
better. If instead we had a valid file descriptor that became invalid because
of some operation or state change, the other errno would fit better.
In some places, initialization is dropped if unnecessary.
|
|\
| |
| | |
timesync: ignore IPv6 addresses when the kernel does not support it
|
| |
| |
| |
| | |
Fixes #25728.
|
| |
| |
| |
| | |
As this is mostly not user's fault.
|
|/
|
|
|
|
|
|
| |
This makes sure that after a server could not be contacted due to a
socket error, other (possibly working) NTP servers in the list of
configured NTP servers are (re-)tried.
Fixes #25728.
|
|
|
|
|
|
| |
The compiler should recognize that these are constant expressions, but
let's better make this explicit, so that the linker can safely share the
initializations all over the place.
|
|
|
|
|
|
| |
The name "def.h" originates from before the rule of "no needless abbreviations"
was established. Let's rename the file to clarify that it contains a collection
of various semi-related constants.
|
|
|
|
|
| |
util.h is now about logarithms only, so we can rename it. Many files included
util.h for no apparent reason… Those includes are dropped.
|
|
|
|
| |
To make them consistent with other functions.
|
| |
|
|
|
|
|
|
| |
Unfortunately, hex output can only be produced with unsigned types. Some
cases can be fixed by producing the correct type, but a few simply have
to be cast. At least casting makes it explicit.
|
|
|
|
| |
gcc will complain about all these with -Wformat-signedness.
|
|
|
|
| |
grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
|
|
|
|
|
|
|
| |
Also break some long lines for more uniform formatting. No functional change.
I went over all log_struct, log_struct_errno, log_unit_struct,
log_unit_struct_errno calls, and they seem fine.
|
| |
|
| |
|
|
|
|
|
| |
Use `LIST_APPEND()` in favour of `LIST_FIND_TAIL()` + `LIST_INSERT_AFTER()`.
Also use a switch/case statement instead of if/else if.
|
|
|
|
|
|
|
| |
When looking at debug logs, it's helpful to know what type of server
address has been added.
For that, introduce a string lookup table for the ServerType type.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
GIT_VERSION is not available as a config.h variable, because it's rendered
into version.h during builds. Let's rework jinja2 rendering to also
parse version.h. No functional change, the new variable is so far unused.
I guess this will make partial rebuilds a bit slower, but it's useful
to be able to use the full version string.
|
|
|
|
|
|
|
|
| |
Let's raise our supported baseline a bit: CLOCK_BOOTTIME started to work
with timerfd in kernel 3.15 (i.e. back in 2014), let's require support
for it now.
This will raise our baseline only modestly from 3.13 → 3.15.
|
|
|
|
|
| |
This also makes the macro check if the event is actually in the buffer,
and if it is not, then log about that and finish the loop.
|
|\
| |
| | |
tree-wide: declare iterator of LIST_FOREACH() in the loop
|
| |
| |
| |
| | |
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The message is misleading: it's not about synchronization but about
successful communicaiton. And it's not about "initial", but only about
first contact since we siwtched to this server.
Let's hence reword the message a bit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
/run/systemd/timesync/synchronized
|
| |
| |
| |
| |
| |
| |
| | |
system clock
We adjust the system clock slowly after all, even if we know a more
accurate time. Use the accurate time for the timestamp.
|
| |
| |
| |
| |
| | |
THe name is just too generic. Let's pick a name that makes clear that
this is about successful communication.
|
| |
| |
| |
| |
| | |
This should not be a fatal error, and it isn't in the other place we
call this.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
manager_adjust_clock()
Let's make sure manager_adjust_clock() is purely about setting the
clock, and nothing else.
Let's clean up logging this way. manager_adjust_clock() now won#t log
about errors, but the caller can safely do that, and do with the right
log message string.
|
| | |
|
| | |
|