1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

57522 Commits

Author SHA1 Message Date
Yu Watanabe
262953ac77 udev: suppress multiple log message about interface naming scheme from workers 2022-04-11 19:59:04 +09:00
Yu Watanabe
d806fff1dd udev/net: cache parsed result of net.ifnames=
To make the log message shown only once.
2022-04-11 19:58:54 +09:00
Yu Watanabe
08405125c3 sd-device: shorten code a bit 2022-04-11 19:56:38 +09:00
Yu Watanabe
9a81972b3b sd-device: minor may be NULL 2022-04-11 19:56:38 +09:00
Yu Watanabe
a46f9cd049 sd-device: validate input parameter after creating sd-device object 2022-04-11 19:56:03 +09:00
Daan De Meyer
688efe7703 namespace-util: Fix typo 2022-04-11 19:20:08 +09:00
Franck Bui
a6aafd6ab6 tmpfiles: constify item_compatible() parameters 2022-04-11 11:22:39 +02:00
Franck Bui
eef72224a8 test: adapt install_pam() for openSUSE
limits.conf is installed in /usr/etc/security for openSUSE.
2022-04-11 11:22:39 +02:00
Franck Bui
402f2b3ce8 test: add test checking tmpfiles conf file precedence 2022-04-11 11:22:39 +02:00
Franck Bui
9f55d48ba5 test tmpfiles: add a test for 'w+' 2022-04-11 11:22:39 +02:00
Franck Bui
9af74e0f59 tmpfiles.d: only 'w+' can have multiple lines for the same path
Since d0ea5c5e39dce60efbce6d86534eb9ca253440b0, all lines specifying actions
that recreate a file system object (such as 'f+, 'L+', etc ...) on the same
path were allowed. This had the bad side effect to break the tmpfiles
configuration file sorting for files defining such lines.

For example:

  # cat /etc/tmpfiles.d/a.conf
  f+ /tmp/file - - - - a.conf

  # cat /etc/tmpfiles.d/z.conf
  f+ /tmp/file - - - - z.conf

  # systemd-tmpfiles --create /etc/tmpfiles.d/{a,z}.conf
  # cat /tmp/file
  z.conf

Even though "a.conf" sorts lexicographically before "z.conf", the content of
/tmp/file was the result of the action defined in "z.conf"

This patch restores the old logic - if multiple files specify the same path,
the entry in the file with the lexicographically earliest name will be applied.
2022-04-11 11:22:27 +02:00
Sonali Srivastava
e3d76a8efd timesync: update to use new-style sd-bus macros 2022-04-11 10:50:33 +02:00
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
Yu Watanabe
1a037ba238 repart: use sd_device_open()
Then, we can safely open devices even if symlinks are not yet created by udevd.
2022-04-10 23:05:10 +09:00
Lennart Poettering
41bc484906 tree-wide: take BSD lock on loopback devices we dissect/mount/operate on
So here's something we should always keep in mind:

systemd-udevd actually does *two* things with BSD file locks on block
devices:

1. While it probes a device it takes a LOCK_SH lock. Thus everyone else
   taking a LOCK_EX lock will temporarily block udev from probing
   devices, which is good when making changes to it.

2. Whenever a device is closed after write (detected via inotify), udevd
   will issue BLKRRPART (requesting the kernel to reread the partition
   table). It does this while holding a LOCK_EX lock on the block
   device. Thus anyone else taking LOCK_SH or LOCK_EX will temporarily
   block udevd from issuing that ioctl. And that's quite relevant, since
   the kernel will temporarily flush out all partitions while re-reading
   the partition table and then create them anew. Thus it is smart to
   take LOCK_SH when dissecting a block device to ensure that no
   BLKRRPART is issued in the background, until we mounted the devices.
2022-04-10 22:52:29 +09:00
Lennart Poettering
345418a9e6 test-loop-block: reenable test on CI 2022-04-10 22:52:29 +09:00
Lennart Poettering
7cad78c0bc update TODO 2022-04-10 22:52:29 +09:00
Lennart Poettering
1b010ae7c9 dissect: rework how we wait for partition block devices
This revisits the mess around waiting for partition block devices in
the image dissection code. It implements a nice little trick:

Instead of waiting for the kernel to probe the partition table for us
and generate the block devices from it, we'll just do that ourselves.
How can we do it? Via the BLKPG_ADD_PARTITION ioctl, that the kernel has
supported for a while. This ioctl allows creating partition block
devices off "whole" block devices from userspace, without the partitions
necessarily being present in the partition table at all.

So, whenever we want a partition to be there, we'll just issue
BLKPG_ADD_PARTITION. This can either work, in which case we know the
partition is there, and can use it. Yay. Or it can fail with EBUSY,
which the kernel returns if a partition by the selected partition index
already exists (or if an existing partition overlaps with the new one).
But if that's the case, then that's also OK, because the partition will
already exist.

So, regardless if we win or the kernel wins, for us the outcome is the
same: the partition block device will exist after invoking the ioctl.
Yay.

Net effect: we are not dependent on asynchronous uevent messages to wait
for the devices. Instead we synchronously get what we need. This makes
us independent of the (apparently less than reliable) netlink transport,
and should almost always be quicker.

Hopefully addresses #17469 even on older kernels.

Fixes: #17469
2022-04-10 22:52:29 +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 31cf58864d3f437c7e3f0497df0fef85130f159d.
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: 6ceb0a4094908dd213a78b9f6d0c59a684831ab0
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 c6552ad381003a23cde7c3228e7071f30465df35.
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
Michal Sekletar
2ef0101e0b tests: add test case for long unit names 2022-04-08 15:18:29 +02:00
Michal Sekletar
1d0727e76f core: shorten long unit names that are based on paths and append path hash at the end
Fixes #18077
2022-04-08 15:18:24 +02:00
Yu Watanabe
15ac2a62f2 network: ignore errors when CONFIG_NET_SCHED is disabled
Follow-ups for 828a81a93783248be15683c9639b85098f331328.

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