Commit graph

74127 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e0c7c9a00d manager: add structured log message about clock bump
Requested in https://github.com/systemd/systemd/pull/33214#discussion_r1630251308.
Also, reword error messages a bit. When /usr/lib/clock-epoch was introduced,
"build time" stopped being acurate. Just say "epoch" instead.

The same message ID is used in the manager and timesyncd. The event is
essentially equivalent for the user, and it seems reasonable that to search for
both at the same time.

The catalog entry is dropped. It provided almost no additional information above
the message. When the same message ID is now applied to messages from PID1 and
timesyncd, and the clock can be both advanced and rewound, it becomes very hard
to make the catalog entry provide something useful, because catalog entries don't
allow conditionalization.
2024-06-15 16:54:37 +02:00
Zbigniew Jędrzejewski-Szmek 8905490d94 timesyncd: simplify handling of timestamps
We would attempt to take the built-in epoch twice. Since
advance_tstamp() is only called from one place, we don't need to do that.
Also, just pass usec_t instead of a pointer to stat buf.

Don't say we set the clock to "recorded timestamp" if we just set it
to the built-in epoch. Also, consistently say "advance" to make it clear
that we'll not attempt to rewind the clock here.
2024-06-15 16:20:19 +02:00
Zbigniew Jędrzejewski-Szmek 20fa2bb893 manager: apply clock epoch on updates too
If we're updating on a system with an invalid clock, and we're installing
a newer system version with a higher update, adjust the clock. This
way the invariant that the clock is always later than
max(compile time, timestamp file, other timestamp file) is maintained.

Also, adjust the wording of messages. When /usr/lib/clock-epoch was
introduced, "build time" stopped being acurate. Just say "epoch" instead.
2024-06-15 16:20:16 +02:00
Zbigniew Jędrzejewski-Szmek ed23f7cbcb manager: use max of: compile epoch, epoch file, timesyncd file
Previously systemd would not use /var/lib/systemd/timesync/clock. This means
that even if /var/ is mounted when systemd is started and the file is
available, we would potentially make one time jump and than another time jump.
From a user's POV, this doesn't seem useful at all.

Also, we would always let /usr/lib/clock-epoch take priority over the built-in
epoch. But there is no guarantee that this file is actually fresh. In
particular, a user may touch /usr/lib/clock-epoch to work around a broken clock
during installation (as recommended in [1]), and then this file will grow stale
over time.

So just load the three timestamps and use the highest one as the epoch.

[1] https://discussion.fedoraproject.org/t/f38-to-f39-40-dnf-system-upgrade-can-fail-on-raspberry-pi/92403
2024-06-15 16:20:12 +02:00
Zbigniew Jędrzejewski-Szmek 18c5979465 shared/clock-util: small modernization 2024-06-15 16:19:35 +02:00
Zbigniew Jędrzejewski-Szmek 8e215e938a Move two functions only used in timesyncd from libshared to the binary 2024-06-12 15:33:56 +02:00
Zbigniew Jędrzejewski-Szmek 4d47aa8c04 Move two functions only used in pid1 from libshared to the binary
Anything that is part of src/shared becomes part of the shared library, which
is wasteful, because the library is linked into almost all binaries. The
library is also forms a separate link unit, so this prevents the function from
being inlined or such.

Also, move logging into the function. Now that it's not a library function,
there is no reason not to do that.
2024-06-12 11:20:20 +02:00
Zbigniew Jędrzejewski-Szmek 455a2eb953 timesync: make public defines for clock epoch files
No functional change yet, just moving stuff around and message format
adjustments.

EPOCH_CLOCK_FILE is also made public for consistency, even though I don't
plan to use it outside of the one location.
2024-06-05 14:35:56 +02:00
Zbigniew Jędrzejewski-Szmek f11aaf7dfb man/systemd: reorder content a bit
Section "Description" didn't actually say what systemd does. And we had a giant
"Concepts" section that actually described units types and other details about
them. So let's move the basic description of functionality to "Description" and
rename the following section to "Units".

The link to the Original Design Document is moved to "See Also", it is of
historical interest mostly at this point.

The only actual change is that when talking about API filesystems, /dev is also
mentioned. (I think /sys+/proc+/dev are the canonical set and should be always
listed on one breath.)
2024-06-05 14:34:12 +02:00
Luca Boccassi 0af5114534
Merge pull request #33193 from DaanDeMeyer/fortify
mkosi: Disable FORTIFY_SOURCE when building without optimizations or with sanitizers
2024-06-04 13:38:00 +01:00
Luca Boccassi b1213ef738
Merge pull request #33192 from DaanDeMeyer/packaging
mkosi: Various opensuse improvements
2024-06-04 11:32:27 +01:00
Daan De Meyer d56cf40dd7 mkosi: Build Arch Linux image with -D_FORTIFY_SOURCE=3
_FORTIFY_SOURCE requires optimizations to be enabled so we set -O2
as well.
2024-06-04 12:27:29 +02:00
Daan De Meyer cbbffa8355 mkosi: Drop $OPTIMIZATION variable
Let's instead just use $CFLAGS to override the optimization level.
2024-06-04 12:20:19 +02:00
Daan De Meyer 98a0e73b45 mkosi: Use __meson_verbose in opensuse build script
OpenSUSE Tumbleweed now ships meson 1.4.0 which ships the new
__meson_verbose macro.
2024-06-04 11:04:46 +02:00
Daan De Meyer a16c186667 mkosi: Use meson_extra_configure_options for opensuse
This is now available so let's use it.
2024-06-04 11:00:53 +02:00
Daan De Meyer 21b338de4c mkosi: Update opensuse commit to latest 2024-06-04 11:00:38 +02:00
Luna Jernberg e1c3ac1f67 po: Translated using Weblate (Swedish)
Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Luna Jernberg <bittin@reimu.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sv/
Translation: systemd/main
2024-06-04 16:11:56 +09:00
Pierre GRASSER 32aaf60e83 po: Translated using Weblate (French)
Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Pierre GRASSER <pierre.grasser@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fr/
Translation: systemd/main
2024-06-04 16:11:56 +09:00
Luca Boccassi 64531ad1ac
Merge pull request #33173 from yuwata/test-network
test-network: several  cleanups
2024-06-03 22:48:11 +01:00
Yu Watanabe dadf2bd4f4 test-network: introduce a .network file to protect existing interfaces 2024-06-03 18:41:26 +01:00
Yu Watanabe 653c38b3eb test-network: show PID and Invocation ID of networkd
Then, we can easily find relevant journal entry on failure.
This is especially useful when the test is running with --no-journal.
2024-06-03 18:41:26 +01:00
Yu Watanabe 6fec598290 test-network: flush stream buffer and journals before/after running test 2024-06-03 18:41:26 +01:00
Yu Watanabe 22fa8f6724 test-network: generate debugging logs of networkd-persistent-storage.service 2024-06-03 18:41:26 +01:00
Luca Boccassi 80a3eb5ab5 test: disable TEST-21-DFUZZER in mkosi, as it is very flacky
Can be re-enabled once https://github.com/systemd/systemd/issues/33156
is solved
2024-06-03 19:37:17 +02:00
Luca Boccassi d6243ebedd journald: enable persistent FD Store to fix logging during soft-reboot
A unit with StandardOutput=journal (the default) will get its stdout/stderr sockets
disconnected when journald stops, as the file descriptors on journald's side are
not preserved (it works on restart, as the FD Store keeps them open during restarts).
Set FileDescriptorStorePreserve=yes so that the journal FD's stay open during a soft
reboot, and applications don't get broken stdout/stderr.
2024-06-03 16:30:54 +01:00
Heran Yang 4762cf0b55 docs: fix escaped $ in CGroup Interface 2024-06-03 16:30:06 +01:00
Luca Boccassi 88c2ef1f75 Revert "test: Run end.sh when running integration tests with mkosi"
It seems this introduced a regression in the CentOS CI;

14:25:58 FAILED TASKS:14:25:58 -------------
14:25:58 TEST-03-JOBS
14:25:58 TEST-52-HONORFIRSTSHUTDOWN
14:25:58 TEST-63-PATH

Revert for now.

This reverts commit da3c6fc553.
2024-06-03 16:29:23 +01:00
Daan De Meyer 954019d211
Merge pull request #33146 from DaanDeMeyer/clang
mkosi: Add support for building with LLVM
2024-06-03 15:43:31 +02:00
Daan De Meyer c45ce65f2f mkosi: Allow using $MESON_VERBOSE to enable verbose meson output 2024-06-03 14:06:19 +02:00
Daan De Meyer 9ee96e7382 mkosi: Build Fedora Rawhide sanitizers job with LLVM
More coverage and clang tends to be better at sanitizers than gcc.
2024-06-03 13:47:37 +02:00
Daan De Meyer aacf9527d6 mkosi: Build with --werror in CI 2024-06-03 13:47:37 +02:00
Daan De Meyer 05895728e6 mkosi: Allow clearing meson cache with WIPE=1
meson does not support changing compilation flags on the fly, when
doing so, the entire build directory has to be cleared explicitly, so
let's add a way to do that by setting WIPE=1.

Let's also allow developers to specify their own meson options via
$MESON_OPTIONS.
2024-06-03 13:47:33 +02:00
dependabot[bot] 988b837df8 build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.1.2 to 5.3.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](52bab0caa5...60c9f2b924)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 13:07:26 +02:00
dependabot[bot] de5772c21d build(deps): bump ossf/scorecard-action from 2.3.1 to 2.3.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.3.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](0864cf1902...dc50aa9510)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 13:06:57 +02:00
dependabot[bot] 91c7d68d30 build(deps): bump softprops/action-gh-release from 2.0.4 to 2.0.5
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](9d7c94cfd0...69320dbe05)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 13:06:03 +02:00
dependabot[bot] 89b49c16ef build(deps): bump actions/checkout from 4.1.2 to 4.1.6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](9bb56186c3...a5ac7e51b4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 13:04:50 +02:00
Daan De Meyer 51ce4c7864 mkosi: Allow setting custom CFLAGS and LDFLAGS 2024-06-03 12:58:16 +02:00
Daan De Meyer 0ccbd22f04 mkosi: Fix comment 2024-06-03 12:58:16 +02:00
Daan De Meyer 02bfe0fa1b mkosi: Add support for building with LLVM
Now you can do mkosi -E LLVM=1 to build with clang+lld. This includes
support for building with sanitizers.
2024-06-03 12:53:03 +02:00
Daan De Meyer 4548e53ee5 mkosi: Make sure initrd coredumps are also stored in the journal
Let's also translate the coredump config into a dropin so we don't
accidentally override any existing configuration.
2024-06-03 12:52:48 +02:00
Daan De Meyer 90ce4096c6 mkosi: Update debian packaging to latest 2024-06-03 12:52:48 +02:00
Daan De Meyer 9d25dc0d86 mkosi: Disable iscsiuio.socket as well 2024-06-03 12:52:48 +02:00
Daan De Meyer 6a88774c96 mkosi: Use env where appropriate 2024-06-03 12:52:48 +02:00
Daan De Meyer b7865c2408 meson: Pass -Wno-deprecated-declarations when detecting libcryptsetup functions
Otherwise we fail to detect crypt_reencrypt() if -Werror is used.
2024-06-03 12:52:48 +02:00
Daan De Meyer c397b5c701 mkosi: drop Debian /tmp hack
/tmp is now a tmpfs in debian testing so let's drop our workaround.
2024-06-03 12:43:20 +02:00
Daan De Meyer e9ef4d6c7f mkosi: Add missing [Content] section 2024-06-03 12:29:23 +02:00
Daan De Meyer 51018ed1c2 mkosi: Make system dependencies conditional on format
If the none format is specified, we don't use the extra trees at all
so let's make the dependencies on the subimages conditional on Format=
not being set to "none".

This speeds up builds when using Format=none.
2024-06-03 11:51:08 +02:00
Heran Yang 7f2ff8b312 docs: fix typo in CGroup Interface 2024-06-03 18:13:57 +09:00
Arian van Putten 30a15ce1d0 docs/DAEMON_SOCKET_ACTIVATION
Remove non-sensical network.target dependencies

There is no need to have these dependencies on socket units as far as I am aware.
2024-06-03 15:22:54 +09:00
Daan De Meyer af21385e76 importctl: Fix 0 flags argument in sd_bus_message_append() 2024-06-03 15:18:13 +09:00