summaryrefslogtreecommitdiffstats
path: root/po (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-02-17process-util: add helper get_process_threads()Lennart Poettering6-9/+86
Let's add a proper helper for querying the number of threads in a process.
2023-02-17sync-util: port fsync_directory_of_file() to fd_is_opath()Lennart Poettering1-10/+6
As suggested here: https://github.com/systemd/systemd/pull/26450#pullrequestreview-1302922404
2023-02-17socket-util: make connect_unix_path() work with a NULL pathLennart Poettering1-28/+36
2023-02-17sd-event: allocate event source objects with the actually needed sizeLennart Poettering1-9/+33
Currently we allocate fixed-size memory for event sources: the largest any of the event source type needs. Discrepancy in the sizes needed for the various event sources is quite major however: it's 144 bytes on x86_64, i.e. more than two cache lines. hence, let's be a tiny bit more careful, and allocate exactly as much as we need, but not more.
2023-02-17macro: add macro for determining size of struct with trailing unionLennart Poettering1-0/+1
2023-02-17test: add test for new "systemctl --kill-value=" functionalityLennart Poettering4-0/+54
(as side-effect this also tests the new systemd-notify --exec switch)
2023-02-17man: document new --exec switch for systemd-notifyLennart Poettering1-0/+17
2023-02-17notify: add new --exec switch for chaining other commands to systemd-notifyLennart Poettering1-3/+56
This is useful in tests, so that we can first send a READY message and then continue doing something else without changing PID.
2023-02-17strv: add strv_copy_n() helper for copying part of a n strvLennart Poettering3-3/+52
2023-02-17man: document new --kill-value= switch to systemctlLennart Poettering1-34/+41
2023-02-17systemctl: add --kill-value= argument to systemctlLennart Poettering3-11/+50
This allows accompanying a signal with a value (as supported for Linux Realtime signals). This is particularly useful as it allows us to do stuff like this: systemctl kill --kill-whom=main --kill-value=0x300 systemd-journald In order to ask journald to flush its allocation caches and compact memory.
2023-02-17pid1: add a new D-Bus method for enquing POSIX signals with values to unit ↵Lennart Poettering13-75/+168
processes This augments the existing KillUnit() + Kill() methods with QueueSignalUnit() + QueueSignal(), which are what sigqueue() is to kill(). This is useful for sending our new SIGRTMIN+18 control signals to system services.
2023-02-17test-execute: also mount tmpfs on /dev/shmYu Watanabe1-1/+1
Otherwise, if /dev/shm has a directory that cannot be accessible by unprivileged user, then we cannot pick a dynamic user, and test service may fail with unexpected error code: --- Failed to enter shared memory directory /dev/shm/systemd-watch-bind-BqAGlN: Permission denied exec-dynamicuser-supplementarygroups.service: Failed to update dynamic user credentials: Device or resource busy exec-dynamicuser-supplementarygroups.service: Failed at step USER spawning /bin/sh: Device or resource busy src/test/test-execute.c:885:test_exec_dynamicuser: exec-dynamicuser-supplementarygroups.service: can_unshare=no: exit status 217, expected 216 --- Follow-up for 4e032f654b94c2544ccf937209303766dfa66c24.
2023-02-17cryptsetup: check the existence of salt by salt_size > 0Yu Watanabe1-1/+1
Follow-up for 504d0acf61c8472bc93c2a927e858074873b2eaf. The function may be called with non-NULL salt and salt_size == 0.
2023-02-17test: add tests for xsetxattr()Yu Watanabe1-0/+47
2023-02-17test: use mkdtemp_open()Yu Watanabe1-15/+8
2023-02-17activate: use _cleanup_close_ attributeYu Watanabe1-5/+9
2023-02-17activate: use log_set_open_when_needed()Yu Watanabe1-4/+6
Otherwise, several error logs may not be shown.
2023-02-17activate: fix typoYu Watanabe1-4/+2
2023-02-17activate: use DEFINE_MAIN_FUNC() macroYu Watanabe1-14/+12
2023-02-17journalctl: fix fd leakYu Watanabe1-5/+4
2023-02-17journalctl: use DEFINE_MAIN_FUNCTION() macroYu Watanabe1-170/+110
2023-02-16xattr-util: check if fd has O_PATH and do not try setxattr() twiceYu Watanabe1-21/+16
Follow-up for a4d2461c46f40c9ae5002a2aea35b35ccb60ef9c.
2023-02-16fd-util: introduce a simple helper to check a file descriptor has O_PATHYu Watanabe2-0/+13
2023-02-16test: avoid matching other fields than __SEQNUM=Frantisek Sumsal1-2/+2
The current unanchored grep sometimes matches MESSAGE=/_CMDLINE= fields that contain "__SEQNUM=" instead of just the __SEQNUM= field, causing spurious test fails: [ 721.546372] testsuite-04.sh[1013]: ++ cut -d= -f2 [ 721.555858] testsuite-04.sh[1011]: ++ journalctl -o export -n 1 [ 721.573037] testsuite-04.sh[1012]: ++ grep -a __SEQNUM= [ 721.767294] testsuite-04.sh[562]: + SEQNUM1='495773 [ 721.769671] testsuite-04.sh[562]: ++ grep -a __SEQNUM [ 721.771323] testsuite-04.sh[562]: grep -a __SEQNUM' [ 721.772938] testsuite-04.sh[562]: + systemd-cat echo yo [ 721.921413] testsuite-04.sh[562]: + journalctl --sync [ 722.088945] testsuite-04.sh[1018]: ++ journalctl -o export -n 1 [ 722.104040] testsuite-04.sh[1019]: ++ grep -a __SEQNUM= [ 722.117239] testsuite-04.sh[1020]: ++ cut -d= -f2 [ 722.314936] testsuite-04.sh[562]: + SEQNUM2=495786 [ 722.317906] testsuite-04.sh[562]: + test 495786 -gt '495773 [ 722.319737] testsuite-04.sh[562]: ++ grep -a __SEQNUM [ 722.321609] testsuite-04.sh[562]: grep -a __SEQNUM' [ 722.323536] testsuite-04.sh[562]: /usr/lib/systemd/tests/testdata/units/testsuite-04.sh: line 276: test: 495773 [ 722.325744] testsuite-04.sh[562]: ++ grep -a __SEQNUM [ 722.327498] testsuite-04.sh[562]: grep -a __SEQNUM: integer expression expected [ 722.329528] testsuite-04.sh[562]: + journalctl --rotate --vacuum-size=16M $ build/journalctl --file /var/tmp/systemd-test.0HpVjt/system.journal -o export | grep -a __SEQNUM= ... __SEQNUM=214849 __SEQNUM=214850 MESSAGE=++ grep -a __SEQNUM= _CMDLINE=grep -a __SEQNUM= __SEQNUM=214851 ... __SEQNUM=214860 MESSAGE=++ grep -a __SEQNUM= _CMDLINE=grep -a __SEQNUM= __SEQNUM=214861 __SEQNUM=214862 __SEQNUM=214863 ... Let's anchor the expression to avoid this. Follow-up to f28ed2c1be7.
2023-02-16boot: Fix assertion failureJan Janssen1-1/+1
The TPM code expects a description unless the PCR index indicates that no measurements have to take place. The assert was preempting this check from happening. Fixes: #26428
2023-02-16Drop mkosi + clang section from HACKINGDaan De Meyer1-77/+0
We removed a few features that made this work, will be added back in the future when we restructure the way mkosi does build images.
2023-02-16Update HACKING for latest mkosiDaan De Meyer1-13/+4
2023-02-16bootctl: Fix debug messagesSamanta Navarro1-2/+2
Remove duplicate KERNEL_INSTALL_MACHINE_ID from message and also specify the correct origin of layout variable. Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2023-02-16log: add common helper log_set_target_and_open()Lennart Poettering5-14/+13
quite often we want to set a log target and immediately open it. Add a common helper for that.
2023-02-16core/mount: fix default target for /sysusr/usr and its childYu Watanabe1-0/+4
Follow-up for 29a24ab28e9790680348b1ffab653a321fa49a67.
2023-02-16man: Fix spelling mistakePaul Barker1-1/+1
2023-02-16update TODOLennart Poettering1-0/+4
2023-02-16sulogin: fix control lost of the current terminal when default.target is ↵HATAYAMA Daisuke1-10/+49
rescue.target When default.target is rescue.target, exiting from the single-user shell results in lost of the control of the current terminal. This is because the operation performed to continue to boot is systemctl default but default.target is now rescue.target and it is already active. Hence, no new process that controls the current terminal is created. Users need to make hardware reset to recover the situation. This sounds like a bit corner case issue and some might feel configuring default.target as rescue.target is odd because there are several other ways to transition to rescue.mode without configuring default.target to rescue.target such as systemctl rescue or systemd.unit=rescue.target something like that. However, users unfamiliar with systemd operations tend to come up with systemctl set-default rescue.target. To fix this issue, let's transition to default.target only when default.target is inactive. Otherwise, invoke the single-user shell again to keep control of the current terminal for users. This new logic depends on whether D-Bus working well. Exiting without any check of result of systemctl default could lead to again the control lost of the current terminal. Hence, add checking results of each D-Bus operations including systemctl default and invoke the single-user shell if they fail.
2023-02-16execute: drop spurious empty lineLennart Poettering1-1/+0
2023-02-16pid1: generate compat warning for SystemCallArchitectures= if seccomp is offLennart Poettering1-0/+3
2023-02-16mkosi: configure multiarch libdir in debian/ubuntu buildsLuca Boccassi3-0/+14
Debian/Ubuntu use /usr/lib/<triplet> instead of /usr/lib64, so configure it accordingly. This is especially important for cryptsetup token plugins, as cryptsetup comes from the distro and is configured to look into those directories.
2023-02-16tpm2: fix build failure without opensslDan Streetman1-3/+6
2023-02-15mkosi: Enable debug logging in CIDaan De Meyer1-0/+6
"Failed to dissect image: connection timed out" messages have been appearing sporadically in mkosi CI. Let's enable debug logging to help figure out why.
2023-02-15journalctl: actually run the static destructorsFrantisek Sumsal1-0/+1
In journalctl we don't run the static destructors defined via the STATIC_DESTRUCTOR_REGISTER() macro, since it requires a corresponding static_destruct() call. In most cases this is handled by the DEFINE_(TEST_)?MAIN*() macros, but journalctl defines its own main function, so let's handle that as well. $ valgrind --suppressions=valgrind.supp --show-leak-kinds=all --leak-check=full build/journalctl --no-pager -u system.slice -n 10 >/dev/null ==2778093== Memcheck, a memory error detector ==2778093== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==2778093== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info ==2778093== Command: build/journalctl --no-pager -u system.slice -n 10 ==2778093== ==2778093== ==2778093== HEAP SUMMARY: ==2778093== in use at exit: 8,221 bytes in 4 blocks ==2778093== total heap usage: 458 allocs, 454 frees, 255,182 bytes allocated ==2778093== ==2778093== 13 bytes in 1 blocks are still reachable in loss record 1 of 4 ==2778093== at 0x484586F: malloc (vg_replace_malloc.c:381) ==2778093== by 0x4DA256D: strdup (strdup.c:42) ==2778093== by 0x4ADB747: strv_extend_with_size (strv.c:544) ==2778093== by 0x405386: strv_extend (strv.h:45) ==2778093== by 0x40816F: parse_argv (journalctl.c:933) ==2778093== by 0x40EAB5: main (journalctl.c:2111) ==2778093== ==2778093== 16 bytes in 1 blocks are still reachable in loss record 2 of 4 ==2778093== at 0x484578A: malloc (vg_replace_malloc.c:380) ==2778093== by 0x484A70B: realloc (vg_replace_malloc.c:1437) ==2778093== by 0x4ADB2A3: strv_push_with_size (strv.c:423) ==2778093== by 0x4ADB620: strv_consume_with_size (strv.c:496) ==2778093== by 0x4ADB770: strv_extend_with_size (strv.c:548) ==2778093== by 0x405386: strv_extend (strv.h:45) ==2778093== by 0x40816F: parse_argv (journalctl.c:933) ==2778093== by 0x40EAB5: main (journalctl.c:2111) ==2778093== ==2778093== LEAK SUMMARY: ==2778093== definitely lost: 0 bytes in 0 blocks ==2778093== indirectly lost: 0 bytes in 0 blocks ==2778093== possibly lost: 0 bytes in 0 blocks ==2778093== still reachable: 29 bytes in 2 blocks ==2778093== suppressed: 8,192 bytes in 2 blocks ==2778093== ==2778093== For lists of detected and suppressed errors, rerun with: -s ==2778093== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
2023-02-15resolved: Fall back to TCP if UDP is blockedJoan Bruguera1-1/+3
If UDP is blocked on the system (e.g. by iptables or BPF), the kernel will return EPERM on some or all of the system calls (connect, sendmsg, etc.). In this case, try to fall back to TCP, which hopefully will not be blocked.
2023-02-15core: add support for Startup memory limitsLuca Boccassi9-24/+454
We support separate Startup configurations for CPU and I/O, so add it for memory too. Only cover cgroupsv2 settings.
2023-02-15vconsole: allow setting default keymap through build optionMike Yuan6-4/+24
Allow defining the default keymap to be used by vconsole-setup through a build option. A template vconsole.conf also gets populated by tmpfiles if it doesn't exist.
2023-02-15journal: cat: set JOURNAL_STREAM before exec-ingMike Yuan1-1/+18
Make the behavior of systemd-cat match that of core/execute. Closes #25880
2023-02-15NEWS: finalizev253Luca Boccassi1-2/+2
2023-02-15hwdb: updateLuca Boccassi7-161/+847
2023-02-15NEWS: update contributors listLuca Boccassi1-10/+11
2023-02-15cryptsetup: do not assert when unsealing token without saltLuca Boccassi3-2/+6
Salt was added in v253. We are not checking whether it was actually found (non-zero size), so when an old tpm+pin enrollment is opened things go boom. For good measure, check both the buffer and the size in both places. Assertion 'saltlen > 0' failed at src/shared/tpm2-util.c:2490, function tpm2_util_pbkdf2_hmac_sha256(). Aborting.
2023-02-15ukify: fix padding lengthYu Watanabe1-1/+2
2023-02-15man/tc: Fix hexadecimals being with an ORaul Tambre1-3/+3