Commit graph

72199 commits

Author SHA1 Message Date
Luca Boccassi 55c1a411c6 portable: the 'flags' parameter is now used in DetachImageWithExtensions() and ReattachImageWithExtensions() 2024-03-29 09:35:45 +09:00
Yu Watanabe adfc608578
Merge pull request #31986 from YHNdnzj/suspend-mem-mode
sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep
2024-03-29 09:30:54 +09:00
Ronan Pigott 64761f38cc network: save the real rdnss address
... instead of the router that informed us

Fixes: 86a66e9b95 ("network: also save NTP servers and friends obtained by other protocols")
2024-03-29 09:30:42 +09:00
Frantisek Sumsal 607be850b9 test: make coverage runs happy with capsule@.service
capsule@.service uses DynamicUser=yes, so let's use the same tweak we
use for other such units.
2024-03-28 23:29:46 +00:00
Daan De Meyer 838235be87 login: Fix fallback error handling 2024-03-28 21:24:54 +01:00
Yu Watanabe e4c7dc9418 test: disable IPv6AcceptRA= for test network interfaces with static address
This hopefully improves test performance.
2024-03-28 12:37:45 +00:00
Luca Boccassi 166cb4c3ee
Merge pull request #31994 from yuwata/network-dhcp-server-follow-ups
network: several fixlets for PersistLeases=
2024-03-28 12:35:13 +00:00
Yu Watanabe ff944339f3 ndisc-option: allow to set valid time of options
When an option is delegated from an upstream server, its lifetime
may be limited by a time. Such functionality will be used later by
sd-radv.

This also remove 'offset' argument from the option setter
ndisc_option_set_xyz(), and make it update existing option.
See comments in ndisc_option_add_link_layer_address() for more details.
2024-03-28 12:34:09 +00:00
Yu Watanabe af41f9f8ad journalctl-filter: use add_match_boot_id() instead of add_match_this_boot()
The function add_match_this_boot() calls sd_journal_add_conjunction(),
hence, we cannot specify multiple devices in the extra match arguments,
e.g., "journalctl /dev/sda /dev/sdb" shows no entry.
2024-03-28 12:28:17 +00:00
Mike Yuan a2124b35e9
sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep
The setting is used when /sys/power/state is set to 'mem'
(common for suspend) or /sys/power/disk is set to 'suspend'
(hybrid-sleep). We default to kernel choice here, i.e.
respect what's set through 'mem_sleep_default=' kernel
cmdline option.
2024-03-28 17:19:35 +08:00
Mike Yuan b786128322
sleep: make write_mode take a path
Similar to the previous commit, preparation
for adding support for /sys/power/mem_sleep.
2024-03-28 17:16:25 +08:00
Mike Yuan b0e3b85a7c
sleep-config: make sleep_mode_supported take a path
Preparation for later commits.
2024-03-28 17:16:25 +08:00
Mike Yuan f8c700791e
string-util: modernize string_contains_word_strv a bit
Also correct the comment on flags.
2024-03-28 17:16:25 +08:00
Mike Yuan a6fe020ab8
sleep-config: fix potential memory leak
Follow-up for 77bd39385e
2024-03-28 17:16:24 +08:00
Mike Yuan 0a3fd5ce43
man/systemd-sleep: reorder options 2024-03-28 17:16:24 +08:00
Mike Yuan 792dd6f46c
sleep-config: make sleep_operation_is_hibernation uppercase 2024-03-28 17:16:21 +08:00
Adrian Vovk 1eba24dac4 homed: Release(): fix assertion failure
This fixes a race condition crash in homed that would happen in the
following sequence of events:

1. Client 1 takes a ref on the home area
2. Client 1 calls some method via dbus
3. Client 2 calls Release()

In homed, the Release() would check if a ref is still held (in this
case: yes it is) and returns an error. Except that is done through a
code-path that asserts that no operations are ongoing. In this case,
it's valid to have an ongoing operation, and so the assertion fails
causing homed to crash.
2024-03-28 13:35:37 +09:00
Luca Boccassi ed35851693 run: fix generated unit name clash after soft-reboot
When sd-run connects to D-Bus rather than the private socket, it will
generate the transient unit name using the bus ID assigned by the D-Bus
broker/daemon. The issue is that this ID is only unique per D-Bus run,
if the broker/daemon restarts it starts again from 1, and it's a simple
incremental counter for each client.
So if a transient unit run-u6.service starts and fails, and it is not
collected (default on failure), and the system soft-reboots, any new
transient unit might conflict as the counter will restart:

Failed to start transient service unit: Unit run-u6.service was already loaded or has a fragment file.

Get the soft-reboot counter, and if it's greater than zero, append it
to the autogenerated unit name to avoid clashes.
2024-03-28 11:19:46 +09:00
Yu Watanabe 2a4fb037cb
Merge pull request #31989 from mrc0mmand/test-loop-dev-check
test: check for /dev/loop-control when checking lodev availability
2024-03-28 11:19:32 +09:00
Yu Watanabe 74158eec0e
Merge pull request #31963 from yuwata/journalctl-authenticate-cleanups
journalctl-authenticate: several cleanups
2024-03-28 11:19:21 +09:00
Yu Watanabe bc91875ae5 test-network: add test cases for PersistLeases=no 2024-03-28 11:16:17 +09:00
Yu Watanabe 38b4ecf789 network: make [DHCPServer] in networkd.conf work
Follow-up for a3ed665a29.

Fixes https://github.com/systemd/systemd/pull/31977#discussion_r1542196572.
2024-03-28 11:15:53 +09:00
Yu Watanabe 1fadd9a357 network: fix typo
Follow-up for a3ed665a29.
2024-03-28 10:38:04 +09:00
Yu Watanabe 5e4aad5e96
Merge pull request #31985 from DaanDeMeyer/mkosi
mkosi: Copy built packages to output directory
2024-03-28 10:21:34 +09:00
Yu Watanabe a128119a1d timedate: fix typo
Follow-up for 3a51e31be9.
2024-03-28 09:55:11 +09:00
Yu Watanabe 66a0fdcaa5 journalctl-authenticate: return earlier if we are not on a TTY
No functional change, just refactoring.
2024-03-28 09:40:34 +09:00
Yu Watanabe ef277c961f journalctl-authenticate: use open_tmpfile_linkable() and link_tmpfile()
This also
- use path_join(),
- rename variables to more descriptive names.
2024-03-28 09:38:10 +09:00
Yu Watanabe 2dac05e62b journalctl-authenticate: drop unnecessary safe_close()
Follow-up for 7560fffcd2.

Addresses https://github.com/systemd/systemd/pull/31879#discussion_r1539063239.
2024-03-28 09:36:29 +09:00
Yu Watanabe 4c56862170 journalctl-authenticate: use is_dir() and refuse symlink for /var/log/journal
I am not sure it is explicitly documented that /var/log/journal should
be a directory, rather than a symlink to a directory, but the current
code of journald seems not to support symlinked directory well. Let's
refuse that at least here and now.
2024-03-28 09:36:29 +09:00
Luca Boccassi e6bd341e7d analyze: fix plot with soft-reboot
Clamp times and start counting from when soft-reboot is started
to avoid creating a huge graph, like it's done for the user
instance.
2024-03-27 22:25:45 +00:00
Frantisek Sumsal c75ee69e59 test: cleanup the test script a bit 2024-03-27 20:15:02 +01:00
Frantisek Sumsal 0348b500ef test: check for /dev/loop-control when checking lodev availability
losetup in util-linux 2.40 started reporting lost loop devices [0] and
it has an unfortunate side-effect where it reports lost devices even in
containers, which then makes the loop device check "falsely" pass [1].

Let's just check for /dev/loop-control explicitly to "work around" this.

[0] a6ca0456cc
[1] https://github.com/util-linux/util-linux/issues/2824
2024-03-27 19:35:30 +01:00
Michal Koutný 3a51e31be9 timedated: Respond on org.freedesktop.timedate1.SetNTP only when really finished
The method returns prematurely (before jobs it triggers terminate). This
is externally visible because other methods may fail if jobs did not
finish.
Postpone the DBus method response until we collect all signals for
finished jobs.
systemd-timedated keeps track of in-flight DBus requests and answers
them all in unspecified order when jobs finish. The capacity of requests
in systemd-timedated is limited.

Fixes: #17739
2024-03-27 17:28:24 +00:00
Daan De Meyer 5524d2838c mkosi: Copy built packages to output directory
This allows the built packages to be inspected if needed, or installed
on the host system for anyone who's daring enough to do so.
2024-03-27 16:14:17 +01:00
Daan De Meyer e11fe427f8 mkosi: Update to latest 2024-03-27 16:14:15 +01:00
Yu Watanabe a3ed665a29 network/dhcp-server: introduce PersistLeases= setting
Requested at https://github.com/systemd/systemd/pull/31772#issuecomment-2000053357.
2024-03-27 13:21:15 +00:00
Antonio Alvarez Feijoo f824cd660a journalctl-show/util: add missing header
```
[1237/2836] Compiling C object journalctl.p/src_journal_journalctl-show.c.o
FAILED: journalctl.p/src_journal_journalctl-show.c.o
cc -Ijournalctl.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -MD -MQ journalctl.p/src_journal_journalctl-show.c.o -MF journalctl.p/src_journal_journalctl-show.c.o.d -o journalctl.p/src_journal_journalctl-show.c.o -c ../src/journal/journalctl-show.c
../src/journal/journalctl-show.c: In function ‘setup_event’:
../src/journal/journalctl-show.c:330:38: error: ‘STDOUT_FILENO’ undeclared (first use in this function)
  330 |         r = sd_event_add_io(e, NULL, STDOUT_FILENO, EPOLLHUP|EPOLLERR, NULL, INT_TO_PTR(-ECANCELED));
      |                                      ^~~~~~~~~~~~~
../src/journal/journalctl-show.c:330:38: note: each undeclared identifier is reported only once for each function it appears in
[1238/2836] Compiling C object journalctl.p/src_journal_journalctl-util.c.o
FAILED: journalctl.p/src_journal_journalctl-util.c.o
cc -Ijournalctl.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -MD -MQ journalctl.p/src_journal_journalctl-util.c.o -MF journalctl.p/src_journal_journalctl-util.c.o.d -o journalctl.p/src_journal_journalctl-util.c.o -c ../src/journal/journalctl-util.c
../src/journal/journalctl-util.c: In function ‘acquire_journal’:
../src/journal/journalctl-util.c:36:60: error: ‘STDIN_FILENO’ undeclared (first use in this function)
   36 |                 r = sd_journal_open_files_fd(&j, (int[]) { STDIN_FILENO }, 1, arg_journal_additional_open_flags);
      |                                                            ^~~~~~~~~~~~
../src/journal/journalctl-util.c:36:60: note: each undeclared identifier is reported only once for each function it appears in
```

Fixes ade2db83fe
2024-03-27 13:14:46 +00:00
Yu Watanabe 95d3570b47 sd-ndisc-router: introduce sd_ndisc_router_set_sender_address()
Currently this is not used, but will be used later to modify the sender
address.
2024-03-27 13:13:12 +00:00
Yu Watanabe 9f3587ae44 ndisc-option: add HomeAgent option support
Currently, these are not used, but will be used later in sd-radv.
2024-03-27 13:12:30 +00:00
Luca Boccassi 5e8adf9f50
Merge pull request #31965 from yuwata/logs-show-cleanups
logs-show: several cleanups
2024-03-27 13:09:56 +00:00
Luca Boccassi c3c5be4836
Merge pull request #31964 from yuwata/journalctl-filter-cleanups
journalctl-filter: several cleanups
2024-03-27 13:07:43 +00:00
Daan De Meyer a22236b471
Merge pull request #31954 from DaanDeMeyer/mkosi
mkosi: Re-enable OpenSUSE build
2024-03-27 13:27:44 +01:00
Daan De Meyer 0a6bf709dd mkosi: Specify --without docs if needed for fedora/centos 2024-03-27 13:00:11 +01:00
Daan De Meyer afc6ecd9cb Update pkg/fedora to latest 2024-03-27 12:58:17 +01:00
Daan De Meyer 6327988d65 mkosi: Merge base and system images
The only reason to have these split up is to be able to build extension
images that use the base image as a base tree and install extra packages.
Until we have such a use case, let's merge the base and system images to
simplify things a bit.

We keep the mkosi.images/ directory to not cause too many conflicts with
the integration tests PR.
2024-03-27 12:20:50 +01:00
Daan De Meyer c2720fa55c mkosi: Re-enable OpenSUSE build 2024-03-27 12:20:50 +01:00
Daan De Meyer b2b3b4ed84 mkosi: Update to latest 2024-03-27 12:20:50 +01:00
Luca Boccassi 2682552698
Merge pull request #31980 from bluca/soft_reboot_timestamps
soft-reboot: fix timestamps accounting for sd-analyze, add new timestamp, add new counter
2024-03-27 10:30:12 +00:00
dependabot[bot] a0ae04b611 build(deps): bump pkg/debian from 1932e19 to 44fe1d4
Bumps pkg/debian from `1932e19` to `44fe1d4`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-27 10:48:55 +01:00
Luca Boccassi 66f35161f6 core: add counter for soft-reboot iterations
Allow to query via D-Bus how many times the current booted system has
been soft rebooted
2024-03-27 01:27:35 +00:00