summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #23009 from ↵Lennart Poettering2022-04-0847-174/+217
|\ | | | | | | | | keszybz/fix-detection-of-libsystemd-shared-with-suffix Fix detection of libsystemd-shared with suffix
| * syscalls: update syscall definitionsZbigniew Jędrzejewski-Szmek2022-04-0720-0/+20
| |
| * various: add missing "#pragma once"Zbigniew Jędrzejewski-Szmek2022-04-074-0/+4
| |
| * Merge parse-socket-bind-item.? into parse-helpers.?Zbigniew Jędrzejewski-Szmek2022-04-079-168/+159
| | | | | | | | | | | | | | 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.
| * Move path_simplify_and_warn() to new shared/parse-helpers.cZbigniew Jędrzejewski-Szmek2022-04-0712-62/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * test-nspawn-util: fix the test to actually find anythingZbigniew Jędrzejewski-Szmek2022-04-072-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 c6134d3e2f1d1d17b32b6e06556cd0c5429bc78a, 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.
| * nspawn: fix comparisons of versions with non-numerical suffixesZbigniew Jędrzejewski-Szmek2022-04-074-22/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See a2b0cd3f5ab3f450e74e2085ad20372a05451c74. 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.
| * Move systemd_installation_has_version() to src/nspawn/Zbigniew Jędrzejewski-Szmek2022-04-078-89/+109
| | | | | | | | | | | | | | | | 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.
| * core: inline an iterator variableZbigniew Jędrzejewski-Szmek2022-04-071-2/+1
| |
* | network: ignore errors when CONFIG_NET_SCHED is disabledYu Watanabe2022-04-081-2/+6
| | | | | | | | | | | | Follow-ups for 828a81a93783248be15683c9639b85098f331328. Fixes #23014.
* | Merge pull request #22803 from medhefgo/boot-cflagsLuca Boccassi2022-04-082-10/+26
|\ \ | | | | | | meson: Add support for building efi binaries on multilib
| * | boot: Restrict block IO buf sizeJan Janssen2022-04-071-2/+2
| | |
| * | meson: Add support for building efi binaries on multilibJan Janssen2022-04-071-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | meson: Add efi-cflags optionJan Janssen2022-04-071-0/+2
| | |
* | | dissect: improve debug logging in probe_filesystem()Lennart Poettering2022-04-071-4/+5
| | |
* | | test-loop-block: conditionalize things on HAVE_BLKID correctlyLennart Poettering2022-04-071-5/+12
| | |
* | | test: allow specifying test threads/iterations/timeouts via cmdlineLennart Poettering2022-04-071-14/+45
| | | | | | | | | | | | That's useful when running tests manually.
* | | loop-util: add debug message with details about acquired loopback deviceLennart Poettering2022-04-071-0/+6
| | |
* | | loop-util: explicitly close loopback block device before sleepingLennart Poettering2022-04-071-0/+3
| | | | | | | | | | | | | | | | | | | | | 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.
* | | loop-util: use ERRNO_IS_DEVICE_ABSENT() macro where appropriateLennart Poettering2022-04-071-1/+1
| | |
* | | loop-util: take a LOCK_EX BSD file lock on control device while we acquire a ↵Lennart Poettering2022-04-071-0/+16
| | | | | | | | | | | | loopback device
* | | test-loop-block: don't spawn threads in case N_THREADS is 1Lennart Poettering2022-04-071-9/+15
| | | | | | | | | | | | | | | Let's simplify things if we are only supposed to create a single thread. Makes it easier to debug things with gdb.
* | | loop-util: slightly rework device_has_block_children()Lennart Poettering2022-04-071-12/+23
| | | | | | | | | | | | | | | | | | | | | 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.
* | | loop-util: let's cut trailing whitespace, not trailing linesLennart Poettering2022-04-071-3/+1
|/ / | | | | | | | | | | | | | | 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.
* | core: fix dm-verity auto-discovery in MountImageUnit()Luca Boccassi2022-04-074-5/+11
| | | | | | | | | | | | | | | | | | 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.
* | calendarspec: fix possibly skips next elapseGibeom Gwon2022-04-072-7/+22
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #21795 from Werkov/bfq-io-weight-2Zbigniew Jędrzejewski-Szmek2022-04-071-13/+46
|\ \ | | | | | | IODeviceWeight= configures bfq.io.weight too
| * | core/cgroup: Silence IODeviceWeight= exclusive policy warningsMichal Koutný2022-03-291-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A single device cannot have more than a single proportional control policy at the same time. So either io.bfq.weight or io.weight will always fail. Process the resulting values and emit a warning message only when none was really configured. This patch also drops warnings when setting [blk]io.bfq.weight fails, the code would be too convoluted otherwise.
| * | core/cgroup: Silence warnings IODeviceWeigth= on old kernelsMichal Koutný2022-03-291-1/+17
| | | | | | | | | | | | | | | | | | | | | Old kernels (795fe54c2a82 ("bfq: Add per-device weight") v5.4) won't allow io.bfq.weight per-device configuration, don't get too excited about it but give the user one warning message to be aware this settings don't apply.
| * | core/cgroup: Refactor device weight property nameMichal Koutný2022-03-291-3/+8
| | | | | | | | | | | | Use arithmetic over explicit list of existing property names.
| * | core/cgroup: Apply IODeviceWeight= through BFQ attributes as wellMichal Koutný2022-03-231-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two possible IO control mechanisms (io.cost and BFQ) that expose separate weights APIs. In systemd units we configure only a single device weight value so we need to write it to both attribute files. This patch extends to devices what is already done for default cgroup IO weight in commit 2dbc45aea747 ("cgroup: Also set io.bfq.weight"). This is possible with kernels >= v5.4 with commit 795fe54c2a82 ("bfq: Add per-device weight"). A warning is logged if the write fails on older kernels. Since per-device weight of a particular device cannot use both io.cost policy and BFQ scheduler, at least one warning is always expected with this approach (the method that is unconfigured).
* | | Merge pull request #23000 from mrc0mmand/coverage__exitFrantisek Sumsal2022-04-071-0/+13
|\ \ \ | | | | | | | | macro: call __gcov_dump() before _exit() w/ coverage enabled
| * | | macro: call __gcov_dump() before _exit() w/ coverage enabledFrantisek Sumsal2022-04-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | _exit() skips at-exit hooks, causing lost coverage from processes utilizing it. Hopefully resolves systemd/systemd-centos-ci#482
* | | | sd-ipv4acd: actually drop the arp packet from one of the host interfaceYu Watanabe2022-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes a bug in 7f77917c0effe92d5fed52503bceddabcb4667ba. Fixes #23001.
* | | | Merge pull request #22965 from enr0n/oomd-used-memory-calcAnita Zhang2022-04-075-25/+25
|\ \ \ \ | | | | | | | | | | oomd: calculate 'used' memory with MemAvailable instead of MemFree
| * | | | oomd: calculate 'used' memory with MemAvailable instead of MemFreeNick Rosbrook2022-04-055-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calculation for used memory in oomd_system_context_acquire is given by MemTotal - MemFree from /proc/meminfo. This is too strict of a calculation because it does not consider memory that is still available for starting new applictions without swapping (MemAvailable). As a result, systemd-oomd can start to kill processes before it is necessary. This is more apparent on systems with low swap space. Instead, compute 'used' memory as MemTotal - MemAvailable in oomd_system_context_acquire and procfs_memory_get (which is used by oomd_cgroup_context_acquire). And, rename oomd_mem_free_below to oomd_mem_available_below for clarity.
* | | | | shutdown: get only active md arrays.Mariusz Tkaczyk2022-04-061-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current md_list_get() implementation filters all block devices, started from "md*". This is ambiguous because list could contain: - partitions created upon md device (mdXpY) - external metadata container- specific type of md array. For partitions there is no issue, because they aren't handle STOP_ARRAY ioctl sent later. It generates misleading errors only. Second case is more problematic because containers are not locked in kernel. They are stopped even if container member array is active. For that reason reboot or shutdown flow could be blocked because metadata manager cannot be restarted after switch root on shutdown. Add filters to remove partitions and containers from md_list. Partitions can be excluded by DEVTYPE. Containers are determined by MD_LEVEL property, we are excluding all with "container" value. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
* | | | | core: taint if /usr is unmergedLuca Boccassi2022-04-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9afd5e7b975e8051c011ff9c07c95e80bd954469 introduced a build-time taint, introduce a runtime one as well, in preparation for removing support for unmerged-usr in a future release
* | | | | test: --initialized=yes is the default for udevadm waitYu Watanabe2022-04-061-1/+1
| | | | |
* | | | | Merge pull request #22993 from keszybz/refactor-manager_taint_string()Yu Watanabe2022-04-066-50/+68
|\ \ \ \ \ | | | | | | | | | | | | Refactor manager_taint_string()
| * | | | | basic/strv: fix typos and confusion whether we are escaping or unescapingZbigniew Jędrzejewski-Szmek2022-04-062-6/+6
| | | | | |
| * | | | | Add new test-manager.c and "test" manager_taint_string()Zbigniew Jędrzejewski-Szmek2022-04-062-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | It seems it doesn't fit well anywhere else.
| * | | | | manager: rework manager_taint_string()Zbigniew Jędrzejewski-Szmek2022-04-062-44/+27
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | When I see stpcpy, my brain bleeds. This function was too complicated for it's own good.
* | | | | analyze: Fix verify exit status regressionDaan De Meyer2022-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, systemd-analyze verify would return 0 even if warnings were raised during analysis of the specified units or their dependencies. With 3cc3dc7, verify was changed to return 1 when warnings were raised. This commit changes the default mode to _RECURSIVE_ERRORS_INVALID so that verify returns zero again by default when warnings are raised.
* | | | | Merge pull request #22983 from yuwata/login-use-symlinks-under-static_node-tagsYu Watanabe2022-04-061-13/+10
|\ \ \ \ \ | | | | | | | | | | | | login: shorten code a bit
| * | | | | login: shorten code a bitYu Watanabe2022-04-061-13/+10
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | The symlinks under /run/udev/static_node-tags are pointing to the corresponding device nodes. Let's read the symlinks.
* | | | | udev: add a brief comment about the origin of the filtersYu Watanabe2022-04-061-0/+6
| |/ / / |/| | | | | | | | | | | | | | | | | | | I am not sure whether the original discussions are correct or not. This is just for adding references for future verification for the filters.
* | | | Merge pull request #22981 from yuwata/udev-node-cleanupsYu Watanabe2022-04-064-102/+112
|\ \ \ \ | | | | | | | | | | udev: cleanups for device node handling
| * | | | udev: move apply_static_dev_perms() to udev-node.cYu Watanabe2022-04-063-68/+71
| | | | | | | | | | | | | | | | | | | | and make it internally use udev_node_apply_permissions_impl().
| * | | | udev: upgrade mode in udev_node_apply_permissions_impl()Yu Watanabe2022-04-062-3/+4
| | | | |