Commit Graph
57303 Commits
Author SHA1 Message Date
Yu Watanabe 513631a757 fix typo 2022-04-11 02:30:29 +09:00
Yu Watanabe 3a258d3a47 fix typo 2022-04-11 00:13:16 +09:00
Ben Efros 1196b6a2e6 Ensure dns_search_domain_unlink_marked removes all marked domains 2022-04-10 21:20:56 +09:00
Yu Watanabe 928c6c00c3 test: always invoke systemd-repart with --no-pager
Follow-up for 31cf58864d.
2022-04-09 13:44:10 +01:00
Yu Watanabe 249e01b215 udev: add parens for function names in the logs 2022-04-09 13:41:06 +01:00
Yu Watanabe 7108fd6ad5 Merge pull request #22614 from zonque/timesync/runtime
timesyncd: add runtime servers
2022-04-09 13:27:05 +09:00
Luca Boccassi 471cac19a6 networkd-test: lazy umount tmp directories
In Semaphore CI, for some reason, /run/systemd/resolve is busy so the umount
fails at the end of the test run:

Verify link states with Unmanaged= settings, cold-plug. ... umount: /run/systemd/resolve: target is busy.14:57
ok14:57
ERROR14:57
======================================================================14:57
ERROR: tearDownModule (__main__)14:57
----------------------------------------------------------------------14:57
Traceback (most recent call last):14:57
  File /tmp/autopkgtest-lxc.6islza9t/downtmp/build.A9b/src/test/networkd-test.py, line 94, in tearDownModule14:57
    subprocess.check_call([umount, d])14:57
  File /usr/lib/python3.9/subprocess.py, line 373, in check_call14:57
    raise CalledProcessError(retcode, cmd)14:57
subprocess.CalledProcessError: Command '['umount', '/run/systemd/resolve']' returned non-zero exit status 32.14:57
----------------------------------------------------------------------14:58
Ran 35 tests in 138.868s14:58
FAILED (errors=1, skipped=2)

Use lazy umount to avoid erroring out.
2022-04-09 10:27:10 +09:00
Daniel Mack a08ea29596 timesync: be explicit in the integer check of poll_interval_usec 2022-04-09 10:23:14 +09:00
Daniel Mack feb219c997 timesyncd: clean up server_name_new()
Use `LIST_APPEND()` in favour of `LIST_FIND_TAIL()` + `LIST_INSERT_AFTER()`.
Also use a switch/case statement instead of if/else if.
2022-04-09 10:23:14 +09:00
Daniel Mack 5dfb11097d timesyncd: add address type information to debug log
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.
2022-04-09 10:23:14 +09:00
Daniel Mack 57b82eaaca timesyncd: add RUNTIME servers
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.
2022-04-09 10:23:14 +09:00
Daniel Mack f1b42a0b23 timesync: export manager_is_connected()
This function use useful from other files, so let's export it.
2022-04-09 10:23:14 +09:00
Amarjargal d5e4e60bf2 machine: update to use new-style sd-bus macros (#23012)
* machine: update to use new-style sd-bus macros

Replace old SD_BUS_METHOD_WITH_NAMES and SD_BUS_SIGNAL_WITH_NAMES macros to
the new SD_BUS_METHOD_WITH_ARGS and SD_BUS_SIGNAL_WITH_ARGS macros.

Meson test, mkosi test image and running machinectl after build returned
no error. But since I don't have any virtual machines or containers, I'm not
sure how to test the changes thoroughly.
2022-04-08 21:43:18 +01:00
Lennart Poettering 11b957b59b update TODO 2022-04-08 22:23:35 +02:00
Lennart Poettering d0aba07f1a specifier: use %q for pretty hostname
%R is already used in service manager specifier expansion (cgroup root),
hence use a different char, that was so far not used.

Follow-up for: 6ceb0a4094
2022-04-08 22:18:28 +02:00
Lennart Poettering e22983e80f systemd-creds: fix name of env var
The env var is called $CREDENTIALS_DIRECTORY, not $CREDENTIALS_PATH. Fix
message about it accordingly.
2022-04-08 20:13:03 +02:00
Lennart Poettering 6247128902 update TODO 2022-04-08 18:59:47 +02:00
Lennart Poettering 5b06ad5132 update TODO 2022-04-08 18:41:51 +02:00
Lennart Poettering 2df2bb1ff4 update TODO 2022-04-08 18:20:22 +02:00
Frantisek Sumsal 7e43be7d0e meson: explicitly include coverage tweaks when built w/ --coverage
To make sure we don't miss any _exit() calls let's move the
coverage-related tweaks into a separate header file and include it
explicitly on the compiler command line using -include when a coverage
build is requested.

Follow-up to c6552ad381.
2022-04-09 00:02:30 +09:00
Lennart Poettering 492f9e74ff Merge pull request #23009 from keszybz/fix-detection-of-libsystemd-shared-with-suffix
Fix detection of libsystemd-shared with suffix
2022-04-08 15:43:09 +02:00
Yu Watanabe 15ac2a62f2 network: ignore errors when CONFIG_NET_SCHED is disabled
Follow-ups for 828a81a937.

Fixes #23014.
2022-04-08 11:13:42 +01:00
Luca Boccassi 7f95def671 Merge pull request #22803 from medhefgo/boot-cflags
meson: Add support for building efi binaries on multilib
2022-04-08 00:00:54 +01:00
Luca Boccassi a2587faa72 Merge pull request #23008 from poettering/loop-dissect-tweaks-safe
loop-util tweaks
2022-04-07 21:42:47 +01:00
Lennart Poettering 1cefb9a6af dissect: improve debug logging in probe_filesystem() 2022-04-07 18:56:38 +02:00
Lennart Poettering e745ddb16f test-loop-block: conditionalize things on HAVE_BLKID correctly 2022-04-07 18:56:38 +02:00
Lennart Poettering d4dd3689fa test: allow specifying test threads/iterations/timeouts via cmdline
That's useful when running tests manually.
2022-04-07 18:55:59 +02:00
Lennart Poettering 3b195f63fc loop-util: add debug message with details about acquired loopback device 2022-04-07 18:55:58 +02:00
Lennart Poettering 3e9210577d loop-util: explicitly close loopback block device before sleeping
attach_empty() file takes a BSD file lock on the device, and we really
should release that before going to sleep. hence explicitly close the
block device before the sleep instead of relying on _cleanup_ to close
it after the sleep.
2022-04-07 18:55:58 +02:00
Lennart Poettering 49043f8115 loop-util: use ERRNO_IS_DEVICE_ABSENT() macro where appropriate 2022-04-07 18:55:58 +02:00
Lennart Poettering cc53046620 loop-util: take a LOCK_EX BSD file lock on control device while we acquire a loopback device 2022-04-07 18:55:58 +02:00
Lennart Poettering da9ae8ea6c test-loop-block: don't spawn threads in case N_THREADS is 1
Let's simplify things if we are only supposed to create a single thread.
Makes it easier to debug things with gdb.
2022-04-07 18:55:58 +02:00
Lennart Poettering 7ffc7f3fcc loop-util: slightly rework device_has_block_children()
Let's match by devtype, i.e. the official way to distinguish "whole"
block devices from partitions.

Also add debug logging for devices we thus ignore.
2022-04-07 18:55:58 +02:00
Lennart Poettering a145f8c06c loop-util: let's cut trailing whitespace, not trailing lines
This doesn't really make any real difference, given the file should only
contain a single line. But it's conceptually more correct to just remove
the trailing newline/whitespace then the whole lines coming after that.
i.e. if the file actually contains more lines than one, this should
probably be considered an error.
2022-04-07 18:55:58 +02:00
Jan Janssen 7fc60c071f ci: Add ia32 EFI multilib test
This makes sure that building ia32 EFI binaries on x86_64 works.
We force gnu-efi support to ensure it's not skipped by accident
and provide the lib32 dir manually, because clang does not support
'--print-multi-os-directory', which is used to auto-detect it.
2022-04-07 18:45:21 +02:00
Jan Janssen 5ec9285611 boot: Restrict block IO buf size 2022-04-07 18:45:21 +02:00
Jan Janssen 7faded269d meson: Add support for building efi binaries on multilib
This allows building 32bit versions of efi binaries on x86_64 machines
and vice-versa by passing "-Defi-cflags=-m32" to meson, provided the
32bit gnu-efi and gcc-multilib are available.

It is expected that distros that want to provide both ia32 and x64
versions to use a second build dir to build the non-native version
by adding -m32 to efi-cflags and then running the sd-boot/sd-stub
ninja target directly.
2022-04-07 18:45:03 +02:00
Jan Janssen c0e4459e09 meson: Add efi-cflags option 2022-04-07 18:39:18 +02:00
Luca Boccassi cedf5b1aef core: fix dm-verity auto-discovery in MountImageUnit()
The implementation of MountImageUnit()/systemctl mount-image was
changed to use a /proc/self/fd path as the source, but that causes
the dm-verity files autodiscovery to fail, as it looks for files
in the same directory as the image.

Use the original file path when setting up dm-verity.
2022-04-07 17:31:04 +01:00
Zbigniew Jędrzejewski-Szmek 6eb32c7f2e syscalls: update syscall definitions 2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek a7fc59c70b various: add missing "#pragma once" 2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek 3fb72d6388 Merge parse-socket-bind-item.? into parse-helpers.?
That file only exported one function, and it fits nicely within the scope of
"parse helpers". Let's move it there to reduce the file count a bit.

No functional change.
2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek c3eaba2d3d Move path_simplify_and_warn() to new shared/parse-helpers.c
This is a high-level function, and it belongs in libsystemd-shared. This way we
don't end up linking a separate copy into various binaries. It would even end
up in libsystemd, where it is not needed. (Maybe it'd be removed in some
optimization phase, but it's better to not rely on that.)

$ grep -l -r -a 'path is not absolute%s' build/
build/libnss_systemd.so.2
build/pam_systemd_home.so
build/test-dlopen
build/src/basic/libbasic.a.p/path-util.c.o
build/src/basic/libbasic.a
build/src/shared/libsystemd-shared-249.so
build/test-bus-error
build/libnss_mymachines.so.2
build/pam_systemd.so
build/libnss_resolve.so.2
build/libnss_myhostname.so.2
build/libsystemd.so.0.32.0
build/libudev.so.1.7.2

$ grep -l -r -a 'path is not absolute%s' build/
build/src/shared/libsystemd-shared-251.a.p/parse-helpers.c.o
build/src/shared/libsystemd-shared-251.a
build/src/shared/libsystemd-shared-251.so

No functional change.
2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek 0643001c28 test-nspawn-util: fix the test to actually find anything
We would use a relative path, looking for globs like
'lib/systemd/libsystemd-shared-*.so' under the build directory, and never find
anything.

The test was supposed to find library in the current installation. But we
cannot assume that the right library is installed, so the test only printed the
result for manual inspection. Thus nobody noticed when it broke. I think it
broke in c6134d3e2f, path-util: get rid of prefix_root().
But that commit doesn't compile because of changes in meson, so this is just
a guess.

Before:
/* test_systemd_installation_has_version */
Current installation has systemd >= 0: no
Current installation has systemd >= 231: no
Current installation has systemd >= 249: no
Current installation has systemd >= 999: no

With the fix:
$ build/test-nspawn-util
/* test_systemd_installation_has_version */
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (OK).
Current installation has systemd >= 0: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (OK).
Current installation has systemd >= 231: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-251.so.so", version 251 (OK).
Current installation has systemd >= 251: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-251.so.so", version 251 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-250.so.so", version 250 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-251.so.so", version 251 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-250.so.so", version 250 (too old).
Current installation has systemd >= 999: no

$ build/test-nspawn-util /var/lib/machines/rawhide
/* test_systemd_installation_has_version */
/* test_systemd_installation_has_version */
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 0: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 231: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 251: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (too old).
Found libsystemd shared at "/var/lib/machines/rawhide/usr/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (too old).
/var/lib/machines/rawhide has systemd >= 999: no

While at it, NULSTR_FOREACH → FOREACH_STRING.
2022-04-07 18:25:26 +02:00
Zbigniew Jędrzejewski-Szmek 7e6821ed4e nspawn: fix comparisons of versions with non-numerical suffixes
See a2b0cd3f5a. When -Dshared-lib-tag is used,
libsystemd-shared.so and libsystemd-core.so get a suffix which breaks the
parsing done by systemd_installation_has_version(). We can assume that the
tag will be something like "251-rc1-1.fc37" that is currently used in Fedora.
(Anything that does *not* start with the version would be completely crazy.)
By switching to strverscmp_improved() we simplify the code and fix comparisons
with such versions.

$ build/test-nspawn-util /var/lib/machines/rawhide
...
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251-rc1-1.fc37 (OK).
/var/lib/machines/rawhide has systemd >= 251: yes
...

I noticed this when I started a systemd-nspawn container with Redora rawhide
and got the message "Not running with unified cgroup hierarchy, LSM BPF is not
supported". I thought the message is in error, but it was actually correct:
nspawn was misdetecting that the container does not sport new-enough systemd
to support cgroups-v2.
2022-04-07 18:19:03 +02:00
Zbigniew Jędrzejewski-Szmek c9394f4f93 Move systemd_installation_has_version() to src/nspawn/
This function implements a heuristic that is only used by nspawn. It doesn't
belong in basic. I opted for a new file "nspawn-utils.c", because it seems
likely that we'll need some other new utilities like that in the future.

No functional change.
2022-04-07 18:17:20 +02:00
Gibeom Gwon 1e582ede3b calendarspec: fix possibly skips next elapse
If the time unit changes after adding the repetition value, the
timer may skip the next elapse. This patch reset sub time units
to minimum value when upper unit is changed.

Fixes #22665.
2022-04-07 17:44:35 +02:00
Zbigniew Jędrzejewski-Szmek cbb6068d0f Merge pull request #21795 from Werkov/bfq-io-weight-2
IODeviceWeight= configures bfq.io.weight  too
2022-04-07 17:23:16 +02:00
Frantisek Sumsal 673d1f4ab9 Merge pull request #23000 from mrc0mmand/coverage__exit
macro: call __gcov_dump() before _exit() w/ coverage enabled
2022-04-07 13:08:55 +00:00
Frantisek Sumsal 1b2e3b8bff test: ignore missing coverage in TEST-02
Since c6552ad we now try to collect coverage even in situations where
it's basically impossible (like in test-mount-util where the whole / is
mounted as read-only). As dealing with this is not worth the trouble,
let's ignore the missing coverage errors thrown by gcov in such cases.
2022-04-07 12:45:13 +02:00