summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* strv: declare iterator of FOREACH_STRING() in the loopZbigniew Jędrzejewski-Szmek2022-03-2353-146/+66
| | | | | | | | | | | Same idea as 03677889f0ef42cdc534bf3b31265a054b20a354. No functional change intended. The type of the iterator is generally changed to be 'const char*' instead of 'char*'. Despite the type commonly used, modifying the string was not allowed. I adjusted the naming of some short variables for clarity and reduced the scope of some variable declarations in code that was being touched anyway.
* Merge pull request #22629 from nishalkulkarni/oomd_service_resultLennart Poettering2022-03-2312-19/+58
|\ | | | | core/oomd: Use oom-kill ServiceResult for oomd
| * man: Mention systemd-oomd now follows OOMPolicyNishal Kulkarni2022-03-223-3/+7
| |
| * test/oomd: Add test for new oomd_ooms xattrNishal Kulkarni2022-03-221-1/+5
| | | | | | | | | | Check if `user.oomd_ooms` xattr is being set as part of `oomd_cgroup_kill()` this xattr tracks OOM kills that were initiated by systemd-oomd.
| * core/oomd: Use oom-kill ServiceResult for oomdNishal Kulkarni2022-03-228-15/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To notify user of kill events from systemd-oomd we now use `SERVICE_FAILURE_OOM_KILL` as the failure result. `unit_check_oomd_kill` now calls `notify_cgroup_oom` to update the service result to `oom-kill`. We add a new xattr `user.oomd_ooms` to keep track of the OOM kills initiated by systemd-oomd, this helps us resolve a race between sending SIGKILL to processes and checking for OOM kill status from the xattr. Related to: #20649
| * core/cgroup: Add OOM checkNishal Kulkarni2022-03-211-0/+4
| | | | | | | | | | | | | | Check if process(es) of a cgroup were killed by Kernel OOM killer or systemd-oomd before we send the cgroup empty notification. This allows us to show the right exit state(ServiceResult)
* | sysupdate: fix error handlingYu Watanabe2022-03-231-1/+1
| |
* | NEWS: fix typoYu Watanabe2022-03-231-2/+2
| |
* | boot: fix typoYu Watanabe2022-03-231-1/+1
| |
* | fs-util: make sure openat_report_new() initializes return param also on shortcutLennart Poettering2022-03-232-3/+29
| | | | | | | | | | | | | | | | | | Our coding style dictates that return parameters should be initialized always on success, hence do so here also in the shortcut codepath. Issue discovered by @fbuihuu: https://github.com/systemd/systemd/pull/22808/files/ca8503f168d0632c606110da909aba3057777395#r831911069
* | fs-util: fix typos in commentsLennart Poettering2022-03-231-2/+2
| |
* | meson: replace sh+find with an internal glob in the python helperZbigniew Jędrzejewski-Szmek2022-03-233-10/+19
| | | | | | | | | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/22810#discussion_r831708052 This makes the whole thing simpler. A glob is passed to helper which then resolves it on its own. This way it's trivial to call the helper with a different set of files for testing.
* | Merge pull request #22825 from keszybz/assorted-cleanupsYu Watanabe2022-03-235-61/+39
|\ \ | | | | | | Assorted cleanups
| * | homework: s/EWOULDBLOCK/EAGAIN/Zbigniew Jędrzejewski-Szmek2022-03-221-2/+2
| | | | | | | | | | | | | | | C.f. 012d7b4217420163db5752a63da6cab39d25edf3, ff55c3c7327e6ad8ab139aef52d498386d4f4a72, ca2031fcc863fcdd4dd1594709918cb60cfd0e1b.
| * | errno-to-awk: simplify expressionZbigniew Jędrzejewski-Szmek2022-03-221-1/+1
| | | | | | | | | | | | No functional change.
| * | sd-bus: use _cleanup_ in one more placeZbigniew Jędrzejewski-Szmek2022-03-221-10/+7
| | |
| * | tools/dbus_exporter: deblackify and shorten code a bitZbigniew Jędrzejewski-Szmek2022-03-221-33/+14
| | | | | | | | | | | | | | | | | | When we do mkdir, we should just use 0o777 and let the umask take care of the rest. Specifying an explicit mode is inappropriate. And when touching the code, let's replace black madness with normal python style.
| * | man: clarify that options set the message fields and are not derived from themZbigniew Jędrzejewski-Szmek2022-03-221-15/+15
| | |
* | | NEWS: adjust MONITOR_ env vars paragraphLuca Boccassi2022-03-231-8/+7
| | | | | | | | | | | | | | | This actually never shipped in a release, so it's not a backward-incompatible change. Move it down and reword it.
* | | NEWS: initial writeup for v251Zbigniew Jędrzejewski-Szmek2022-03-221-77/+239
| | |
* | | Merge pull request #22821 from poettering/udev-tweakletsLuca Boccassi2022-03-222-3/+3
|\ \ \ | | | | | | | | Udev tweaklets
| * | | sd-device: use path_compare() rather than strcmp() for sorting pathsLennart Poettering2022-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sorting paths it actually matters to use the right comparison function. Example: ``` a/x a-b/y a_/z ``` I think people would probably expect this: ``` a/x a-b/y a_a/z ``` but if you use strcmp() instead of path_compare() you'd instead get: ``` a-b/y a/x a_a/z ``` That's because `/` is between `-` and `a` in the ascii table. I think that's quite confusing, and we shouldn#t order that way hence. As discussed: https://github.com/systemd/systemd/pull/22662#discussion_r831174776
| * | | sd-device: fix trivial typoLennart Poettering2022-03-221-2/+2
| | | |
* | | | docs: add some docs about building OS imagesLennart Poettering2022-03-221-0/+227
| | | | | | | | | | | | | | | | It's not trivial to know what to reset how. Let's document this a bit.
* | | | Merge pull request #22778 from poettering/kernel-install-layout-reworkZbigniew Jędrzejewski-Szmek2022-03-227-47/+189
|\ \ \ \ | |/ / / |/| | | kernel-install/bootctl: layout fixes
| * | | kernel-install: check for /loader/entries.srel file as explicit marker for ↵Lennart Poettering2022-03-221-2/+21
| | | | | | | | | | | | | | | | standards compliant /loader/entries directory
| * | | bootctl: automatically write out $BOOT/entries/standard.srelLennart Poettering2022-03-221-1/+43
| | | |
| * | | bootctl: generalize open_tmpfile_linkable() use a bitLennart Poettering2022-03-223-13/+45
| | | | | | | | | | | | | | | | | | | | We want FILE* here, instead of a plain fd. Let's generalize this in tmpfile-util.c, so we can reuse it later easily.
| * | | docs: add /loader/entries.srel to the boot loader specLennart Poettering2022-03-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new file is supposed to address conflicts with Fedora/Grub's frankenbootloaderspec implementation, that squatted the /loader/entries/ dir, but place incompatible files in them (that do variable expansion?). A simple text file /loader/entries.srel shall indicate which spec is implemented. If it contains the string "type1\n" then the /loader/entries/ directory implements our standard spec, otherwise something else.
| * | | NEWS: try to fix old entry regarding KERNEL_INSTALL_LAYOUTLennart Poettering2022-03-211-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old text was simply wrong, we used to read $layout from /etc/kernel/install.conf and the machine ID from $KERNEL_INSTALL_MACHINE_ID from /etc/machine-info. Correct that. Apparently KERNEL_INSTALL_MACHINE_ID was already known back in v235 times, hence don't mention it anymore. it's kinda weird retro-fixing these NEWS entries, given we deprecate them again, but I couldn't let this really incorrect stuff be.
| * | | kernel-install: list fields we honour in /etc/kernel/install.confLennart Poettering2022-03-211-7/+6
| | | |
| * | | bootctl: load /etc/kernel/install.conf's $layout field, tooLennart Poettering2022-03-211-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bootctl so far tried to determine the layout from /etc/machine-info, but that's obsolete, and the kernel-install script never looked there. Let's read the setting from /etc/kernel/install.conf instead, where kernel-install actually looks. Support for reading the field from /etc/machine-info is retained for compat. This means we'll now read /etc/machine-id, /etc/machine-info and /etc/kernel/install.conf, and read the machine ID from the former too and the layout setting from the latter two.
| * | | bootctl: $KERNEL_INSTALL_MACHINE_ID + $KERNEL_INSTALL_LAYOUT are deprecatedLennart Poettering2022-03-211-5/+8
| | | | | | | | | | | | | | | | | | | | Let's add a comment about this, and generate log messages if these fields are actually used.
* | | | Merge pull request #22662 from yuwata/udev-trigger-priorityLennart Poettering2022-03-228-178/+465
|\ \ \ \ | | | | | | | | | | udevadm trigger: add --prioritized-subsystem option
| * | | | udevadm: trigger: implement --initialized-match/nomatch argumentsDanilo Krummrich2022-03-224-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | systemd-udev-trigger.service by default triggeres all devices regardless of whether they were already recognized by systemd-udevd. There are machines (especially in embedded environments) where systemd-udev-trigger.service is configured to run at a later stage of the boot sequence, which can lead to quite a lot of devices being triggered although they were already recognized by systemd-udevd. Re-triggering a lot of devices is a relatively expensive operation and therefore should be avoided if unnecessary. Therefore this patch introduces --initialized-nomatch, which filters out devices that are already present in the udev database. For consistance reasons --initialized-match is implemented as well, which filters out devices that are *not* already present in the udev database. Replaces #19949.
| * | | | sd-device-enumerator: support to list only initialized or uninitialized devicesYu Watanabe2022-03-223-30/+54
| | | | |
| * | | | unit: make systemd-udev-trigger.service use --prioritized-subsystemYu Watanabe2022-03-221-2/+1
| | | | | | | | | | | | | | | | | | | | Replaces #19637 and #22643.
| * | | | udevadm trigger: introduce --type=all optionYu Watanabe2022-03-224-5/+13
| | | | |
| * | | | udevadm trigger: introduce --prioritized-subsystem optionYu Watanabe2022-03-224-22/+55
| | | | |
| * | | | sd-device-enumerator: introduce device_enumerator_scan_devices_and_subsystems()Yu Watanabe2022-03-222-0/+54
| | | | |
| * | | | sd-device-enumerator: drop /sys/subsystem supportYu Watanabe2022-03-221-24/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses the comment by Lennart https://github.com/systemd/systemd/pull/22662#discussion_r829799863: > /sys/subsystem is preparation for a future that never came. > And given that the main proponent of this left Linux kernel > development (Kay), I doubt this will ever come. So maybe we > should start dropping references to /sys/subsystem/ given it's > unlikely to materialize anytime soon.
| * | | | sd-device-enumerator: introduce device_enumerator_add_prioritized_subsystem()Yu Watanabe2022-03-222-2/+101
| | | | | | | | | | | | | | | | | | | | | | | | | If a subsystem is specified, then matching devices and their parents are listed at first.
| * | | | sd-device-enumerator: introduce device_enumerator_sort_devices()Yu Watanabe2022-03-221-46/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and devices are sorted when the iteration started. Previously, devices added by udev_enumerate_add_syspath() -> device_enumerator_add_device() are not sorted. This fixes the issue.
| * | | | sd-device-enumerator: introduce device_enumerator_unref_devices() helper ↵Yu Watanabe2022-03-221-10/+17
| | | | | | | | | | | | | | | | | | | | function
| * | | | sd-device-enumerator: introduce sound_device_compare() and ↵Yu Watanabe2022-03-221-38/+52
| |/ / / | | | | | | | | | | | | devpath_is_late_block() helper functions
* | / / random-util: use correct minimum pool size constantJason A. Donenfeld2022-03-221-1/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual minimum size of the pool across supported kernel versions is 32 bytes. So adjust this minimum. I've audited every single usage of random_pool_size(), and cannot see anywhere that this would have any impact at all on anything. We could actually just not change the constant and everything would be fine, or we could change it here and that's fine too. From both a functionality and crypto perspective, it doesn't really seem to make a substantive difference any which way, so long as the value is ≥32. However, it's better to be correct and have the function do what it says, so clamp it to the right minimum.
* | | Merge pull request #22813 from poettering/sd-boot-man-fixesZbigniew Jędrzejewski-Szmek2022-03-224-13/+25
|\ \ \ | |/ / |/| | man: some sd-boot doc tweaks
| * | man: clarify that type #1 entries are also read from the XBOOTLDR partitionLennart Poettering2022-03-222-10/+15
| | |
| * | man: also install systemd-stub man page as sd-stubLennart Poettering2022-03-222-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | So, typically systemd-boot is referenced as sd-boot, due to te usual shorter naming in ESP resources. systemd-stub didnt do that so far, since it never appears as separate files in the ESP. However it's super annoying that you can find "man sd-boot", but not the very closely related "man sd-stub". Let's fix that, and also add an "sd-stub" alias to the "systemd-stub" man page.
| * | man: clarify where the settings in type #1 entries are documentedLennart Poettering2022-03-221-1/+6
| | | | | | | | | | | | | | | | | | | | | So (maybe weirdly) loader.conf(5) documents both loader.conf and type #1 entries (because they share a similar syntax). But it then only lists the options of loader.conf. Let's add an explicit hint where to find the documentation of the type #1 entries.