1
0
mirror of https://github.com/systemd/systemd synced 2024-07-03 08:29:25 +00:00
Commit Graph

74383 Commits

Author SHA1 Message Date
Yu Watanabe
4f6d8ab076 test-network: mention that the captive portal option is supported since v2.20
The current latest release is v2.19, hence the test is typically skipped now.
2024-06-18 00:20:27 +09:00
Yu Watanabe
87e30d0e56 json: const char *func() -> const char* func()
Follow-up for 309a747fa6.
2024-06-18 00:19:59 +09:00
Yu Watanabe
abeb98d185 core/mount: suffix function name with paren
Follow-up for 88188e1ff1.
2024-06-18 00:19:59 +09:00
Lennart Poettering
1b3449d8c1 logind: tweaklets 2024-06-17 16:12:55 +01:00
Lennart Poettering
1ad4e37da1 pretty-print: take console glyph width into account when drawing progress bar
So far this used string length, not character width. Fix that.
2024-06-17 16:12:11 +01:00
reDBo0n
64c34eb8d3
hwdb: add support for AIPTEK Media Tablet Ultimate (#33371)
The "AIPTEK Media Tablet Ultimate", detected as "Waltop International Corp. Batteryless Tablet",
is missing the resolution of the x-/y-axes.

Adding a new rule to 60-evdev.hwdb with the same values as another entry
"WALTOP International Corp. Batteryless Tablet" just with another matching string makes the
device usable.

Fixes #33362.
2024-06-17 23:05:23 +09:00
Luca Boccassi
9981bc210a
Merge pull request #33355 from YHNdnzj/shutdown-cad
shutdown: re-enable CAD handling in kernel at start, several other cleanups
2024-06-17 09:19:08 +01:00
Luca Boccassi
f943fd9143
Merge pull request #33363 from YHNdnzj/service-serialization-cleanup
core/service: several cleanups for serialization logic
2024-06-16 23:01:35 +01:00
Luca Boccassi
65da79953b
Merge pull request #33364 from YHNdnzj/utf8-modernization
basic/utf8: some modernizations
2024-06-16 22:33:08 +01:00
Mike Yuan
e2b812c804
string-util: introduce string_is_safe_ascii helper 2024-06-16 19:07:35 +02:00
Mike Yuan
4d06bf5922
basic/utf8: modernize ascii_is_valid_n, make ascii_is_valid static inline 2024-06-16 19:07:35 +02:00
Mike Yuan
7ff7161044
basic/utf8: modernize utf8_is_valid_n a bit 2024-06-16 19:07:34 +02:00
Mike Yuan
156d23abc9
core/service: use r to store parsed int values 2024-06-16 19:05:29 +02:00
Mike Yuan
029df9ed7a
core/service: drop unused bus_name_owner
Follow-up for fc67a943d9

After the mentioned comment, we no longer need to record
the owner to restore the previous bus owner state.
Therefore, bus_name_owner is effectively unused. Kill it.
2024-06-16 19:00:39 +02:00
Mike Yuan
a74b284073
core/service: also serialize/dump status_errno 2024-06-16 19:00:39 +02:00
Mike Yuan
301dc07347
core/service: use serialize_usec where appropriate, drop redundant debug log 2024-06-16 19:00:39 +02:00
Mike Yuan
d4d90ef900
Merge pull request #33214 from keszybz/system-clock-epoch
Rework the setting and description of system clock to the epoch
2024-06-16 17:42:47 +02:00
Luca Boccassi
2a00e92598
Merge pull request #33352 from YHNdnzj/freeconp-void
Trivial follow-ups for recent PRs
2024-06-15 19:57:13 +01:00
Mike Yuan
0dd4a33454
shutdown: re-enable CAD handling in kernel at start 2024-06-15 19:29:03 +02:00
Mike Yuan
758760a361
shutdown: clean up sync_with_progress a bit
Also, ignore the error on caller's side.
2024-06-15 19:29:03 +02:00
Mike Yuan
c1bf0571c0
string-util: modernize first_word a bit 2024-06-15 19:19:39 +02:00
Mike Yuan
58aec56d84
core/manager: correct alignment in manager_handle_ctrl_alt_del 2024-06-15 19:19:39 +02:00
Mike Yuan
b5c8cc0a3b man,units: drop "temporary" from description of systemd-tmpfiles
Historically, systemd-tmpfiles was designed to manager temporary
files, but nowadays it has become a generic tool for managing
all kinds of files. To avoid user confusion, let's remove "temporary"
from the tool's description.

As discussed in #33349
2024-06-15 19:08:35 +02:00
Zbigniew Jędrzejewski-Szmek
863098fdc9 man: describe setting of the clock by systemd and systemd-timesyncd
The setting of systemd clock is important and deserves an accurate description,
see for example:
https://discussion.fedoraproject.org/t/f38-to-f39-40-dnf-system-upgrade-can-fail-on-raspberry-pi/92403
https://bugzilla.redhat.com/show_bug.cgi?id=2242759

The meat of the description was in systemd-timesyncd.service(8), but
actually it's systemd that sets the clock. In particular, systemd-timesyncd
doesn't know anything about /usr/lib/clock-epoch, and since systemd sets
the clock to the epoch when initializing, systemd-timesyncd would only
get to advance the clock to the epoch under special circumstances.
Also, systemd-timesyncd is an optional component, so we can't even rely
on its man page being installed in all circumstances. The description needs
to be moved to systemd(1).

The description is updated to describe the changes that were made in
previous commits.
2024-06-15 16:58:11 +02:00
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
Lennart Poettering
4d6222b6a4 random-util: add crypto_random_bytes_allocate_iovec()
Just a simple helper that allocates some memory, initializes it
randomly, and places this in a struct iovec.
2024-06-15 12:43:37 +01:00
Lennart Poettering
3b2e99ed8c importd: unify setup of bus connectivity in one place 2024-06-15 12:16:36 +01:00
Mike Yuan
2128085d0c
selinux-util: make type of cleanup func void
Follow-up for 6623c64a02

Return values are pointless for _cleanup_ functions, and
this matches what we do in DEFINE_TRIVIAL_CLEANUP_FUNC().
2024-06-15 13:05:50 +02:00
Mike Yuan
c89d1e425a
missing_loop: add missing assertions for fallback values 2024-06-15 13:05:50 +02:00
Mike Yuan
e4308ac783
macro-fundamental: correct comment and remove trailing ';' for macro
Follow-up for 3c2f2146f5
2024-06-15 12:57:55 +02:00
Mike Yuan
609bc3ae16
Merge pull request #33037 from keszybz/dlopen-open-code-definitions
Make dlopen macros more explicit and drop mac_selinux_free()
2024-06-15 12:49:59 +02:00
Lennart Poettering
3d6c2c918b json: extend JsonDispatch flags with nullable and refuse-null flags
currently when dispatching json objects into C structs we either insist
on the field type or we don't. Let's extend this model a bit: depending
on two new fields either allow or refuse null types in addition to the
specified type.

This is useful for example when dispatch enums as this allows us
explicitly refuse null in various scenarios where we allow multiple
types.
2024-06-15 10:58:02 +01:00
Lennart Poettering
26279199cf varlink: handle NULL varlink server object gracefully in varlink_server_current_connections()
let's treat a NULL server as a server with zero connections, to make
things more convenient to use.
2024-06-15 10:57:14 +01:00
Lennart Poettering
4db747b0dd machined: use bus_message_read_id128() at one more place 2024-06-15 01:19:31 +01:00
Luca Boccassi
05e69717fa
Merge pull request #33329 from poettering/varlink-idl-tweaks
varlink-idl: align continuation line character \
2024-06-15 01:18:37 +01:00
Lennart Poettering
aab74e1d93 pretty-print: enable stdio buffering while outputting progress bar
Writing the progress bar so far was irritatingly slow, which was caused
by the fact that the various things we output so far resulted in one
write() syscall each because STDERR is unbuffered by default.

Let's fix that, and temporarily turn on full buffering for stderr,
restoring the normal unbuffered output right after.

This makes progress bar print visibly more efficient (and flicker free
too, since terminals no longer will move the cursor around during
output).
2024-06-15 01:18:10 +01:00
Lennart Poettering
bba55185de utf8: let utf8_console_width() handle NULL strings somewhat reasonably 2024-06-15 00:46:42 +01:00
Luca Boccassi
78fb0ca46d
Merge pull request #33325 from poettering/vsock-ret-optional
socket-util: make return parameter for socket_address_parse_vsock() o…
2024-06-15 00:45:28 +01:00
Lennart Poettering
4fae650ad8 json: add sd_json_dispatch_double() helper 2024-06-15 00:43:56 +01:00
Luca Boccassi
10880ae3c4
Merge pull request #33334 from poettering/machined-more-pidfd
machined: prefer pinning clients via pidfd when creating machine, rat…
2024-06-15 00:13:50 +01:00
Luca Boccassi
67153a7bc4
Merge pull request #33330 from poettering/copy-tweaks
Minor tweaks to copy_bytes()
2024-06-15 00:12:48 +01:00
Raphaël Mélotte
56ab1c5449 src/basic/missing_loop.h: fix missing LOOP_SET_BLOCK_SIZE
Builds with kernels headers < 4.14 fail with:

../src/shared/loop-util.c: In function ‘loop_configure_fallback’:
../src/shared/loop-util.c:237:31: error: ‘LOOP_SET_BLOCK_SIZE’ undeclared (first use in this function); did you mean ‘LOOP_SET_DIRECT_IO’?
                 if (ioctl(fd, LOOP_SET_BLOCK_SIZE, (unsigned long) c->block_size) < 0)
                               ^~~~~~~~~~~~~~~~~~~
                               LOOP_SET_DIRECT_IO

Fixes: https://github.com/systemd/systemd/issues/33341

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2024-06-15 00:01:44 +01:00
Nick Rosbrook
9ebcac3b51 man: add a bit of a warning to systemd-tmpfiles --purge
Mention that by default, /home is managed by tmpfiles.d/home.conf, and
recommend that users run systemd-tmpfiles --dry-run --purge first to
see exactly what will be removed.
2024-06-15 00:00:53 +01:00
Lennart Poettering
7d9a8cc4ac creds-util: add common helper for determinign global boot credentials path
It's very useful being able to determine the directory where to write
global boot credentials to, that are picked up by all kernels.
2024-06-14 23:52:35 +01:00
Lennart Poettering
c29778a100 fs-util: add simple open_mkdir() wrapper 2024-06-14 23:50:59 +01:00
Lennart Poettering
b22635083a string-util: make sure strrepa() doesn't doubly evaluate expressions 2024-06-14 23:50:03 +01:00