summaryrefslogtreecommitdiffstats
path: root/src/shared (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-11-08test: refactor test-procfs-util for clarity and skip test on perm failureDan Streetman1-26/+37
After commit c3dead53d50e334f2d072a2248256983d6dc9f8c the test can fail if the procfs file(s) aren't writable, because the check for permission failure happens after a call that will never fail, since setting the limit to the existing limit will always pass. This also refactors the function slightly to make the test var names clearer.
2021-11-08hwdb: remove the tablet pad entry for the UC-Logic 1060NPeter Hutterer1-5/+0
This entry only matches on vid/pid, so the pen event node of the device would also get assigned the ID_INPUT_TABLET_PAD property - making it break with libinput. On top of that, UC-Logic's tablets re-use USB ids, so now we're breaking multiple devices this way. To get this device tagged correctly, use libwacom which has the per-device hwdb entries. Fixes #17953 This reverts commit 0fbe78ac7a4c5689660b1c1e2c956ffa1a2e4ee5
2021-11-08po: Translated using Weblate (German)Ettore Atalan1-49/+31
Currently translated at 77.7% (147 of 189 strings) Co-authored-by: Ettore Atalan <atalanttore@googlemail.com> Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/de/ Translation: systemd/main
2021-11-06user-record: show CIFS extra mount options, in output tooLennart Poettering1-0/+3
Follow-up for 4c2ee5c7f26fda41d7eb1250c61c85cc869a90de
2021-11-05test: wait until `lvm-activate-$vgroup.service` finishesFrantisek Sumsal1-2/+11
The new lvm autoactivation method runs `vgchange` via `systemd-run --no-block`[0], which means that checking if the unit is in the `active` state is not enough, since the main binary might still be running. Let's fix this by waiting until the unit reaches the `exited` sub state. Follow-up to: * 29f8bef05eb9a4bb7f578b31409ca38ec1b1a069 * e50d743f99fa66c9f55e534c4e109a2cf6323f04 [0] https://sourceware.org/git/?p=lvm2.git;a=blob;f=udev/69-dm-lvm.rules.in;h=39e5b98074010745f78a7a86a05929700c9cd690;hb=67722b312390cdab29c076c912e14bd739c5c0f6#l83 Example: ``` [ 17.102002] systemd-udevd[282]: sdf: '/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-iscsi_lvm2212 /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212'(err) 'Running as unit: lvm-activate-iscsi_> [ 17.102522] systemd-udevd[282]: sdf: Process '/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-iscsi_lvm2212 /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212' succeeded. [ 17.102697] systemd-udevd[282]: sdf: Adding watch on '/dev/sdf' [ 17.104944] systemd[1]: lvm-activate-iscsi_lvm2212.service: Changed dead -> running ... [ 17.105434] systemd[1]: Started /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212. [ 17.105601] systemd[931]: lvm-activate-iscsi_lvm2212.service: Executing: /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212 ... [ 17.420228] testsuite-64.sh[268]: + systemctl -q is-active lvm-activate-iscsi_lvm2212.service [ 17.420228] testsuite-64.sh[268]: + return 0 [ 17.420228] testsuite-64.sh[268]: + test -e /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2021-09.com.example:iscsi.lvm.test-lun-4 [ 17.420228] testsuite-64.sh[268]: + udevadm settle [ 17.420228] testsuite-64.sh[268]: + test -e /dev/iscsi_lvm2212/mypart1 ... [ 17.451313] systemd[1]: testsuite-64.service: Main process exited, code=exited, status=1/FAILURE [ 17.451475] systemd[1]: testsuite-64.service: Failed with result 'exit-code'. ... [ 17.555759] systemd[1]: Starting End the test... [ 17.556972] sh[941]: + systemctl poweroff --no-block ... [ 17.688923] lvm[931]: 2 logical volume(s) in volume group "iscsi_lvm2212" now active ... [ 17.838484] systemd[1]: lvm-activate-iscsi_lvm2212.service: Child 931 belongs to lvm-activate-iscsi_lvm2212.service. [ 17.838718] systemd[1]: lvm-activate-iscsi_lvm2212.service: Main process exited, code=exited, status=0/SUCCESS (success) ```
2021-11-05coredump: fix filename in journal when not compressedxdavidwu1-0/+1
Since 587f2a5e564cf434c2e0a653f52b8f73e86092d8, filename for not-compressed coredump is missing from save_external_coredump, making it write COREDUMP_FILENAME= (empty) in journal, making `coredumpctl` report it missing but it is actually saved. This fixes it.
2021-11-05analyze: allow a custom policy to skip a check with weight=0Luca Boccassi3-2/+8
In some cases an offline analysis should ignore some fields, for example a portable service in an image will never list RootImage/RootDirectory, as they are added at runtime, and thus can be skipped.
2021-11-05exec: Add TTYRows and TTYColumns properties to set TTY dimensionsDaan De Meyer17-6/+171
2021-11-05getty: Pass tty to use by agetty via stdinDaan De Meyer4-4/+12
If the tty arg is set to "-", agetty uses the stdin fd as the tty. Let's pass the tty this way so that we keep an fd open to the tty at all times. If all fd's to a tty are closed, the kernel might reset the tty which we want to avoid.
2021-11-05test: exercise sytemd-integritysetup & generatorTony Asleson4-0/+135
Ensures we can open a dm-integrity volume formated with integritysetup.
2021-11-05sd-boot: Add .osrel sectionJan Janssen2-4/+11
This allows starting systemd-boot from \EFI\Linux for easier testing and bisection without risking an unbootable system as the user does not need to replace their working loader.
2021-11-05analyze: explain how the weight/range policy fields are usedLuca Boccassi1-3/+7
2021-11-05user-record: fix display of access modeLennart Poettering1-1/+1
2021-11-05user-record: show fs/luks/gpt UUIDs as proper UUIDsLennart Poettering1-3/+3
These are not defined by us, but are defined as proper UUIDs by their respective specs, hence show them as such.
2021-11-05docs: document systemd-homed development env varsLennart Poettering1-0/+32
2021-11-05homed: add env var to override dir where we fine stored user recordsLennart Poettering4-6/+12
This adds an env var which we can use to redirect where homed stores and looks for user records kept on the host. This is useful for debugging purposes so that one can easily run another homed instnce that doesn't interfere with the main instance.
2021-11-05test: Add test for flag macrosJan Janssen1-0/+70
2021-11-05meson-render-jinja2: use ast.literal_eval()Zbigniew Jędrzejewski-Szmek1-2/+4
Imports are sorted in the usual fashion: stdlib first. literal_eval() parses string/numbers/lists/sets/dicts, and nothing else, while eval will execute any python code. Using literal_eval() is generally more correct, because it avoids the risk of side effects from the parsed expression. In this case, we generate the parsed strings ourselves, so it's very unlikely to have anything unexpected in the expressions. But let's do the correct thing anyway.
2021-11-05basic/mountpoint-util: detect erofs as a read-only FSLuca Boccassi1-0/+1
2021-11-05loop-util: reopen device node if we shortcut loop device creationLennart Poettering1-4/+9
The LoopDevice object supports a shortcut: if the backing fd we are supposed to create a loopback device of refers to a block device alrady then we'll use it as is – if we can – instead of setting up an unnecessary loopback device that would be pretty much the same as its backing device. Previously, when doing this we'd just dup() the original backing fd and use that. But that's problematic in case O_DIRECT was set on the fd, since we'll keep that flag set on our copy too, which means we can't do simple, regular IO on it anymore. Thus, let's reopen the inode in this case with the exact access flags we'd apply if we'd actually allocate and open a new loopback device. Fixes: #21176
2021-11-04analyze: fix typos in test policyLuca Boccassi1-2/+2
2021-11-04sd-boot: Fix efi_arch checksJan Janssen1-2/+2
efi_arch is set to whatever meson returns from host_machine.cpu_family() and gnu_efi_arch is then set accordingly. On x86, efi_arch == x86 and gnu_efi_arch == ia32. Surprisingly, compilation worked (without disabling some instruction sets) and nobody ever complained about systemd-bootia32.efi not working.
2021-11-04sd-boot: Detect supported compile argsJan Janssen1-19/+28
This brings the final list of compiler arguments more in line with how meson does things. In particular, --buildtype=plain will not add any optimizations on its own (and would have to be provided through CFLAGS=).
2021-11-04sd-boot: Add some link flagsJan Janssen2-16/+3
These flags are used by gnu-efi. Adding --no-undefined even allows us to drop the no-undefined-symbols.sh test in favor of immediate compile time errors.
2021-11-04sd-stub: Fix possible memory leakJan Janssen1-8/+4
2021-11-04sd-boot: Check for existence of required pe sectionsJan Janssen2-17/+30
2021-11-04sd-boot: Move optional header verification into verify_peJan Janssen1-10/+4
2021-11-04sd-boot: Use FLAGS_SETJan Janssen4-8/+8
2021-11-04sd-boot: Move flags helpers to macro-fundamental.hJan Janssen2-7/+7
2021-11-04sd-boot: Always compile with -ffreestanding and -fshort-wcharJan Janssen1-2/+3
This is not a hosted environment and we should not pretend otherwise if -ffreestanding is not supported. With EFI strings being in UCS2, it is not supported to build without -fshort-wchar as gcc/clang default to a w_char_t size of 4 bytes. This also makes the charset for wide chars explicit on gcc. This way we get a nice error message if anyone ever tries to add 💩 to strings.
2021-11-04sd-boot: Save and restore console attributesJan Janssen1-1/+8
This also only writes the message on a new line if we aren't at the beginning of one already.
2021-11-04update-helper: add missing loop over user unitsZbigniew Jędrzejewski-Szmek1-2/+4
Noticed by Luca. shellcheck doens't catch this, and somehow it was missed in review and testing ;(
2021-11-04tree-wide: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek17-30/+33
(Or when -H is used, since -H and -M are incompatible.) Note that the slightly unusual form with separate boolean variables (hint_vars, hint_addr) instead of e.g. a const char* variable to hold the message, because this way we don't trigger the warning about non-literal format.
2021-11-04busctl: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek3-5/+7
(Or when -H is used, since -H and -M are incompatible.)
2021-11-04shared/bus-util: make bus_log_*_error() functions functionsZbigniew Jędrzejewski-Szmek2-16/+15
They were defined as macros, but they are a bit too complicated for this, so it's getting unwieldy. We can make them functions without any loss.
2021-11-04tree-wide: always use TAKE_FD() when calling rearrange_stdio()Lennart Poettering11-25/+28
rearrange_stdio() invalidates specified fds even on failure, which means we should always invalidate the fds we pass in no matter what. Let's make this explicit by using TAKE_FD() for that everywhere. Note that in many places we such invalidation doesnt get us much behaviour-wise, since we don't use the variables anymore later. But TAKE_FD() in a way is also documentation, it encodes explicitly that the fds are invalidated here, so I think it's a good thing to always make this explicit here.
2021-11-03core: Propagate condition failed state to triggering units.Daan De Meyer13-28/+72
Alternative to https://github.com/systemd/systemd/pull/20531. Whenever a service triggered by another unit fails condition checks, stop the triggering unit to prevent systemd busy looping trying to start the triggered unit.
2021-11-03macro: make TAKE_PTR() side-effect freeLennart Poettering1-2/+3
2021-11-03tree-wide: port more code to sigkill_wait()Lennart Poettering4-16/+8
2021-11-03tree-wide: port various places to use TAKE_PID()Lennart Poettering14-33/+18
2021-11-03process-util: rework TAKE_PID() to be side-effect freeLennart Poettering1-2/+3
2021-11-03process-util: wait for processes we killed even if killing failedLennart Poettering1-4/+4
The processes might be zombies in which case killing will fail, but reaping them still matters.
2021-11-03test: add test that ensures TAKE_FD() works as it shouldLennart Poettering1-0/+43
2021-11-03Make pager_open() return voidZbigniew Jędrzejewski-Szmek38-100/+96
2021-11-03fd-util: make TAKE_FD free of double evaluationLennart Poettering1-3/+4
Better be safe than sorry.
2021-11-03manager: fix confusion when to send READY=1Zbigniew Jędrzejewski-Szmek1-3/+3
I got the logic reversed in 6d9326595592f98e8126eacb4176acd8c3516d5c. Let's just remove the conditionalization of the status message: if we're sending something, we might just as well always attach READY=1, the extra few bytes don't make much of a difference. FWIW, it seems that this bug didn't cause problems, probably because we'd send READY=1 either from user_manager_send_ready() or from a later call to manager_send_ready().
2021-11-03tree-wide: drop "f" from sd_notify() calls with a static stringZbigniew Jędrzejewski-Szmek3-5/+5
If we don't need to do any formatting, let's optimize things a bit.
2021-11-03journald: modernize code to send notificationsZbigniew Jędrzejewski-Szmek1-13/+5
No change except making things a bit less verbose.
2021-11-03tree-wide: warn when sd_notify fails with READY=1 or FDSTOREREMOVE=1Zbigniew Jędrzejewski-Szmek8-46/+71
Most sd_notify() calls are like log_info() — the result is only informative and if they fail, it's best ignore this. But if a call with READY=1 fails, the unit may enter a failed state, so we should warn about this. Similarly for FSTOREREMOVE=1: the manager may be left with a stale fd, at least wasting resources.
2021-11-03CODING_STYLE: allow joined variable declarations and function callsZbigniew Jędrzejewski-Szmek1-9/+18
… but only for a single variable. The guidelines already allowed declaring variables at the point of initialization. But not making a function call to do that. Let's allow that now. The existing style of declaring and initializing seperate is still allowed, and whatever makes most sense should be used.