summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* build: preserve correct mode when generating files via jinja2Christian Brauner2021-11-0810-22/+11
| | | | | | | | | When using "capture : true" in custom_target()s the mode of the source file is not preserved when the generated file is not installed and so needs to be tweaked manually. Switch from output capture to creating the target file and copy the permissions from the input file. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* test: refactor test-procfs-util for clarity and skip test on perm failureDan Streetman2021-11-081-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.
* Merge pull request #21237 from bluca/analyze_skipLuca Boccassi2021-11-061-0/+5
|\ | | | | analyze: allow a custom policy to skip a check
| * analyze: allow a custom policy to skip a check with weight=0Luca Boccassi2021-11-051-0/+5
| | | | | | | | | | | | 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.
* | Merge pull request #21171 from DaanDeMeyer/tty-dimensionsLennart Poettering2021-11-069-6/+103
|\ \ | | | | | | exec: Add TTYRows and TTYColumns properties to set TTY dimensions
| * | exec: Add TTYRows and TTYColumns properties to set TTY dimensionsDaan De Meyer2021-11-059-6/+103
| | |
* | | user-record: show CIFS extra mount options, in output tooLennart Poettering2021-11-061-0/+3
| | | | | | | | | | | | Follow-up for 4c2ee5c7f26fda41d7eb1250c61c85cc869a90de
* | | coredump: fix filename in journal when not compressedxdavidwu2021-11-051-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.
* | | sd-boot: Add .osrel sectionJan Janssen2021-11-052-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.
* | | Merge pull request #21252 from poettering/homed-record-dir-env-varLennart Poettering2021-11-054-6/+12
|\ \ \ | | | | | | | | homed: add env var to override dir where we fine stored user records
| * | | homed: add env var to override dir where we fine stored user recordsLennart Poettering2021-11-054-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.
* | | | user-record: fix display of access modeLennart Poettering2021-11-051-1/+1
| | | |
* | | | user-record: show fs/luks/gpt UUIDs as proper UUIDsLennart Poettering2021-11-051-3/+3
|/ / / | | | | | | | | | | | | These are not defined by us, but are defined as proper UUIDs by their respective specs, hence show them as such.
* / / test: Add test for flag macrosJan Janssen2021-11-051-0/+70
|/ /
* | Merge pull request #20138 from keszybz/coding-style-variable-declsLuca Boccassi2021-11-0547-160/+173
|\ \ | | | | | | A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
| * | Make pager_open() return voidZbigniew Jędrzejewski-Szmek2021-11-0338-100/+96
| | |
| * | manager: fix confusion when to send READY=1Zbigniew Jędrzejewski-Szmek2021-11-031-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().
| * | tree-wide: drop "f" from sd_notify() calls with a static stringZbigniew Jędrzejewski-Szmek2021-11-033-5/+5
| | | | | | | | | | | | If we don't need to do any formatting, let's optimize things a bit.
| * | journald: modernize code to send notificationsZbigniew Jędrzejewski-Szmek2021-11-031-13/+5
| | | | | | | | | | | | No change except making things a bit less verbose.
| * | tree-wide: warn when sd_notify fails with READY=1 or FDSTOREREMOVE=1Zbigniew Jędrzejewski-Szmek2021-11-038-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.
* | | Merge pull request #21225 from medhefgo/boot-cleanupZbigniew Jędrzejewski-Szmek2021-11-0510-89/+96
|\ \ \ | | | | | | | | Boot cleanup
| * | | sd-boot: Fix efi_arch checksJan Janssen2021-11-041-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.
| * | | sd-boot: Detect supported compile argsJan Janssen2021-11-041-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=).
| * | | sd-boot: Add some link flagsJan Janssen2021-11-042-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.
| * | | sd-stub: Fix possible memory leakJan Janssen2021-11-041-8/+4
| | | |
| * | | sd-boot: Check for existence of required pe sectionsJan Janssen2021-11-042-17/+30
| | | |
| * | | sd-boot: Move optional header verification into verify_peJan Janssen2021-11-041-10/+4
| | | |
| * | | sd-boot: Use FLAGS_SETJan Janssen2021-11-044-8/+8
| | | |
| * | | sd-boot: Move flags helpers to macro-fundamental.hJan Janssen2021-11-042-7/+7
| | | |
| * | | sd-boot: Always compile with -ffreestanding and -fshort-wcharJan Janssen2021-11-041-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.
| * | | sd-boot: Save and restore console attributesJan Janssen2021-11-041-1/+8
| | | | | | | | | | | | | | | | | | | | This also only writes the message on a new line if we aren't at the beginning of one already.
* | | | basic/mountpoint-util: detect erofs as a read-only FSLuca Boccassi2021-11-051-0/+1
| | | |
* | | | loop-util: reopen device node if we shortcut loop device creationLennart Poettering2021-11-051-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
* | | Merge pull request #21229 from keszybz/improve-m-hintLuca Boccassi2021-11-0417-42/+46
|\ \ \ | |/ / |/| | Improve hint to use -M in various tools
| * | tree-wide: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek2021-11-0417-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.
| * | busctl: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek2021-11-043-5/+7
| | | | | | | | | | | | (Or when -H is used, since -H and -M are incompatible.)
| * | shared/bus-util: make bus_log_*_error() functions functionsZbigniew Jędrzejewski-Szmek2021-11-042-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.
* | Merge pull request #21070 from medhefgo/boot-saveLennart Poettering2021-11-042-66/+86
|\ \ | | | | | | sd-boot: Add support to boot last select entry
| * | sd-boot: Add support to boot last selected entryJan Janssen2021-10-292-6/+45
| | | | | | | | | | | | Fixes: #18994
| * | sd-boot: Allow glob patterns for default and oneshot EFI vars tooJan Janssen2021-10-291-23/+11
| | |
| * | sd-boot: Keep all EFI var loading togetherJan Janssen2021-10-291-40/+33
| | | | | | | | | | | | This also delays the last remaining EFI var write in menu_run.
* | | Merge pull request #21030 from DaanDeMeyer/path-skippedLennart Poettering2021-11-0410-29/+74
|\ \ \ | | | | | | | | core: Propagate condition failed state from service to path unit.
| * | | core: Propagate condition failed state to triggering units.Daan De Meyer2021-11-0310-22/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | core: Delay start rate limit check when starting a unitDaan De Meyer2021-10-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing start rate limit checks before doing condition checks made condition check failures count towards the start rate limit which broke existing assumptions (see #21025). Run the rate limit checks after the condition checks again to restore the previous behaviour.
| * | | core: Move 'r' variable declaration to start of unit_start()Daan De Meyer2021-10-301-1/+2
| | | |
* | | | update-helper: add missing loop over user unitsZbigniew Jędrzejewski-Szmek2021-11-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Noticed by Luca. shellcheck doens't catch this, and somehow it was missed in review and testing ;(
* | | | tree-wide: always use TAKE_FD() when calling rearrange_stdio()Lennart Poettering2021-11-0411-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.
* | | | Merge pull request #21217 from keszybz/debug-test-process-utilYu Watanabe2021-11-035-67/+84
|\ \ \ \ | | | | | | | | | | procfs-util: fix confusion wrt. quantity limit and maximum value
| * | | | test-process-util: also add EROFS to the list of "good" errorsZbigniew Jędrzejewski-Szmek2021-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is only added in the one place where we actually try to set the setting to a new value. Before we were testing if we can set to it the existing value, which was a noop. We could still get a permission error, but this is the first place where we would propagate EROFS.
| * | | | procfs-util: fix confusion wrt. quantity limit and maximum valueZbigniew Jędrzejewski-Szmek2021-11-035-67/+84
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From packit/rawhide-arm64 logs: Assertion 'limit >= INT_MAX || get_process_ppid(limit+1, NULL) == -ESRCH' failed at src/test/test-process-util.c:855, function test_get_process_ppid(). Aborting. ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― The kernel has a few different limits. In particular kernel.threads-max can be set to some lower value, and kernel.pid_max can be set to a higher value. This is nice because it reduces PID reuse, even if the number of threads that is allowed is limited. But the tests assumed that we cannot have a thread with PID above MIN(kernel.threads-max, kernel.pid_max-1), which is not valid. So let's rework the whole thing: let's expose the helpers to read kernel.threads-max and kernel.pid_max, and print what they return in tests. procfs_tasks_get_limit() was something that is only used in tests, and wasn't very well defined, so let's drop it. Fixes #21193.