]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 months agoMerge pull request #28117 from yuwata/copy-follow-ups
Daan De Meyer [Sun, 25 Jun 2023 11:35:15 +0000 (12:35 +0100)] 
Merge pull request #28117 from yuwata/copy-follow-ups

copy: several follow ups

10 months agoMerge pull request #28149 from mrc0mmand/test-machinectl-bump-container-size
Luca Boccassi [Sun, 25 Jun 2023 11:01:30 +0000 (12:01 +0100)] 
Merge pull request #28149 from mrc0mmand/test-machinectl-bump-container-size

test: bump the test container size to 64 MiB

10 months agopo: Translated using Weblate (Korean)
김인수 [Sun, 25 Jun 2023 07:20:56 +0000 (09:20 +0200)] 
po: Translated using Weblate (Korean)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main

10 months agoMerge pull request #28147 from mrc0mmand/drop-workarounds
Yu Watanabe [Sun, 25 Jun 2023 05:13:45 +0000 (14:13 +0900)] 
Merge pull request #28147 from mrc0mmand/drop-workarounds

test: drop a couple of workarounds for recently fixed issues

10 months agotest: bump the test container size to 64 MiB 28149/head
Frantisek Sumsal [Sat, 24 Jun 2023 18:25:04 +0000 (20:25 +0200)] 
test: bump the test container size to 64 MiB

As 32 MiB appears to be on the edge of barely enough on C8S:

[  149.974689] testsuite-13.sh[601]: + dd if=/dev/zero of=/tmp/container.raw bs=1M count=32
[  150.388423] testsuite-13.sh[1096]: 32+0 records in
[  150.390721] testsuite-13.sh[1096]: 32+0 records out
[  150.392450] testsuite-13.sh[1096]: 33554432 bytes (34 MB, 32 MiB) copied, 0.354336 s, 94.7 MB/s
[  150.396422] testsuite-13.sh[601]: + mkfs.ext4 /tmp/container.raw
[  150.472209] testsuite-13.sh[1097]: mke2fs 1.45.6 (20-Mar-2020)
[  150.561303] testsuite-13.sh[1097]: Discarding device blocks: done
[  150.565438] testsuite-13.sh[1097]: Creating filesystem with 32768 1k blocks and 8192 inodes
[  150.568301] testsuite-13.sh[1097]: Filesystem UUID: d8e3c43b-0f1f-4e89-8c26-100e4a32b64f
[  150.569777] testsuite-13.sh[1097]: Superblock backups stored on blocks:
[  150.571135] testsuite-13.sh[1097]:   8193, 24577
[  150.572751] testsuite-13.sh[1097]: Allocating group tables: done
[  150.574294] testsuite-13.sh[1097]: Writing inode tables: done
[  150.598696] testsuite-13.sh[1097]: Creating journal (4096 blocks): done
[  150.604285] testsuite-13.sh[1097]: Writing superblocks and filesystem accounting information: done
[  150.612309] testsuite-13.sh[601]: + mount -o loop /tmp/container.raw /tmp/mnt
[  150.879736] testsuite-13.sh[601]: + cp -r /var/lib/machines/container1/bin ... /tmp/mnt
[  152.347545] testsuite-13.sh[1104]: cp: cannot create directory '/tmp/mnt/var/log': No space left on device
[  152.351739] testsuite-13.sh[1104]: cp: cannot create directory '/tmp/mnt/var/tmp': No space left on device

10 months agotest: show the subtest name together with the failing code
Frantisek Sumsal [Sat, 24 Jun 2023 18:43:26 +0000 (20:43 +0200)] 
test: show the subtest name together with the failing code

To make debugging slightly easier.

10 months agotest: don't assume yum is a script
François Rigault [Sat, 24 Jun 2023 08:44:54 +0000 (10:44 +0200)] 
test: don't assume yum is a script

on Rawhide at the moment yum is a symlink to dnf5 which is a binary.

10 months agotest: drop timeout when running portablectl 28147/head
Frantisek Sumsal [Sat, 24 Jun 2023 08:35:12 +0000 (10:35 +0200)] 
test: drop timeout when running portablectl

The deadlock should be resolved by #28123, so let's check if it's indeed
the case.

10 months agotest: test the /boot endpoint under nspawn as well
Frantisek Sumsal [Sat, 24 Jun 2023 08:33:14 +0000 (10:33 +0200)] 
test: test the /boot endpoint under nspawn as well

Since #28144 should be now resolved by fb0e106.

10 months agoMerge pull request #27330 from YHNdnzj/hibernate-resume-auto
Lennart Poettering [Fri, 23 Jun 2023 21:03:32 +0000 (23:03 +0200)] 
Merge pull request #27330 from YHNdnzj/hibernate-resume-auto

sleep/hibernate-resume: pass hibernate location through efivar for resume without kernel cmdline

10 months agoMerge pull request #27843 from yuwata/usleep_safe
Lennart Poettering [Fri, 23 Jun 2023 21:03:15 +0000 (23:03 +0200)] 
Merge pull request #27843 from yuwata/usleep_safe

time-util: introduce usleep_safe()

10 months agoMerge pull request #28144 from poettering/procfs-submounts-move
Lennart Poettering [Fri, 23 Jun 2023 20:53:25 +0000 (22:53 +0200)] 
Merge pull request #28144 from poettering/procfs-submounts-move

pid1: when setting up a new procfs instance for a service, mount submounts from host into it

10 months agoexecute: don't honour PrivateNetwork() if we lack CAP_NET_ADMIN
Lennart Poettering [Fri, 23 Jun 2023 14:06:29 +0000 (16:06 +0200)] 
execute: don't honour PrivateNetwork() if we lack CAP_NET_ADMIN

Somehow the Linux kernel allows us to allocate a network namespace if we
possess CAP_SYS_ADMIN but doesn't allow us to configure it, unless we
also have CAP_NET_ADMIN.

Taking that into consideration let's avoid allocating a network
namespace we cannot even configure "lo" in.

This is common case if nspawn is invoked without userns and without
netns, because in that case it will have CAP_SYS_ADMIN but no
CAP_NET_ADMIN.

This also takes down a notch the messages about the automatic
downgrading. These have been LOG_WARNING so far, and I downgraded them
to LOG_NOTICE, since in an environment where CAP_NET_ADMIN is not
available this is really not something to be concerned about, but still
noticable. With that it's still more priorized than regular LOG_INFO.

Fixes: #27292
10 months agoMerge pull request #28140 from mrc0mmand/more-coverage
Luca Boccassi [Fri, 23 Jun 2023 18:56:28 +0000 (19:56 +0100)] 
Merge pull request #28140 from mrc0mmand/more-coverage

test: test transactions with cycles

10 months agotest: ensure ProtectProc=invisible retains host submounts 28144/head
Lennart Poettering [Fri, 23 Jun 2023 16:27:45 +0000 (18:27 +0200)] 
test: ensure ProtectProc=invisible retains host submounts

10 months agonamespace: when mounting new proc instance, bind mount submounts of source over
Lennart Poettering [Fri, 23 Jun 2023 15:50:39 +0000 (17:50 +0200)] 
namespace: when mounting new proc instance, bind mount submounts of source over

Fixes: #28059
10 months agomount-util: add helper that can bind mount submounts of one dir to another
Lennart Poettering [Fri, 23 Jun 2023 15:50:17 +0000 (17:50 +0200)] 
mount-util: add helper that can bind mount submounts of one dir to another

10 months agomount-util: don't claim maybe-uninitialized was false that is valid
Lennart Poettering [Fri, 23 Jun 2023 15:52:31 +0000 (17:52 +0200)] 
mount-util: don't claim maybe-uninitialized was false that is valid

10 months agotmpfile-util: drop spurious double newline
Lennart Poettering [Fri, 23 Jun 2023 15:49:36 +0000 (17:49 +0200)] 
tmpfile-util: drop spurious double newline

10 months agohibernate-resume: support resuming through efivar HibernateLocation 27330/head
Mike Yuan [Mon, 24 Apr 2023 16:34:19 +0000 (00:34 +0800)] 
hibernate-resume: support resuming through efivar HibernateLocation

10 months agosleep: write hibernate location to efivar HibernateLocation
Mike Yuan [Mon, 24 Apr 2023 16:32:03 +0000 (00:32 +0800)] 
sleep: write hibernate location to efivar HibernateLocation

10 months agohibernate-resume: rework to follow the logic of sleep.c and use
Mike Yuan [Tue, 18 Apr 2023 17:21:55 +0000 (01:21 +0800)] 
hibernate-resume: rework to follow the logic of sleep.c and use
main-func.h

Preparation for #27247

10 months agobootctl: log correct error about device_path_make_canonical()
Mike Yuan [Fri, 23 Jun 2023 14:52:17 +0000 (22:52 +0800)] 
bootctl: log correct error about device_path_make_canonical()

10 months agosleep: always write resume_offset if possible
Mike Yuan [Tue, 18 Apr 2023 16:09:08 +0000 (00:09 +0800)] 
sleep: always write resume_offset if possible

There's no need to conditionalize this.
Setting resume_offset=0 doesn't harm, and can even help
by overriding potentially existing half-written settings.

10 months agoman: fix references to gethostname/sethostname
Antonio Alvarez Feijoo [Fri, 23 Jun 2023 14:34:55 +0000 (16:34 +0200)] 
man: fix references to gethostname/sethostname

10 months agoupdate TODO
Lennart Poettering [Fri, 23 Jun 2023 13:23:09 +0000 (15:23 +0200)] 
update TODO

10 months agotree-wide: use https for the 0pointer.de doc links
Frantisek Sumsal [Fri, 23 Jun 2023 11:08:57 +0000 (13:08 +0200)] 
tree-wide: use https for the 0pointer.de doc links

10 months agoresolved: if ipv6 is off patch hostname→address query with unspec family to ipv4
Lennart Poettering [Thu, 22 Jun 2023 20:26:23 +0000 (22:26 +0200)] 
resolved: if ipv6 is off patch hostname→address query with unspec family to ipv4

If the client never specified the address family, and IPv6 is off in the
kernel, then look only for A, never for AAAA RRs.

Fixes: #23951
10 months agotest: test transactions with cycles 28140/head
Frantisek Sumsal [Fri, 23 Jun 2023 12:06:42 +0000 (14:06 +0200)] 
test: test transactions with cycles

Provides coverage for systemd/systemd#26872.

With systemd/systemd#26875 reverted:

[16444.287652] testsuite-03.sh[71]: + for i in {0..19}
[16444.287652] testsuite-03.sh[71]: + systemctl start transaction-cycle0.service
[16444.359503] systemd[1]: =================================================================
[16444.360321] systemd[1]: ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6180002e578e at pc 0x7f73b25ec7a6 bp 0x7ffc5531c6f0 sp 0x7ffc5531be68
[16444.360798] systemd[1]:
[16444.361044] systemd[1]: READ of size 783 at 0x6180002e578e thread T0 (systemd)
[16444.391684] systemd[1]:     #0 0x7f73b25ec7a5  (/lib64/libasan.so.5+0x557a5)
[16444.392167] systemd[1]:     #1 0x7f73b260a1d5 in __interceptor_vasprintf (/lib64/libasan.so.5+0x731d5)
[16444.392442] systemd[1]:     #2 0x7f73afa1d1e1 in log_format_iovec ../src/basic/log.c:996
[16444.392750] systemd[1]:     #3 0x7f73afa1e7b6 in log_struct_internal ../src/basic/log.c:1058
[16444.393101] systemd[1]:     #4 0x7f73b1979136 in transaction_verify_order_one ../src/core/transaction.c:392
[16444.393540] systemd[1]:     #5 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.393946] systemd[1]:     #6 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394262] systemd[1]:     #7 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394532] systemd[1]:     #8 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394812] systemd[1]:     #9 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
...

10 months agotest: make sure we get PID1's stack trace on ASan/UBSan errors
Frantisek Sumsal [Fri, 23 Jun 2023 12:28:30 +0000 (14:28 +0200)] 
test: make sure we get PID1's stack trace on ASan/UBSan errors

As hitting an ASan/UBSan error in PID1 results in a crash (and a kernel
panic when running under qemu), we usually lose the stack trace which
makes debugging quite painful. Let's mitigate this by forwarding the
stack trace to multiple places - namely to a file and the syslog.

10 months agoMerge pull request #28123 from poettering/threads-no-more
Luca Boccassi [Fri, 23 Jun 2023 12:24:41 +0000 (13:24 +0100)] 
Merge pull request #28123 from poettering/threads-no-more

get rid of any threads in PID 1

10 months agoelf-util: check for overflow when computing end of core's PT_LOAD segments
Romain Geissler [Thu, 22 Jun 2023 16:05:18 +0000 (16:05 +0000)] 
elf-util: check for overflow when computing end of core's PT_LOAD segments

10 months agoMerge pull request #28127 from poettering/coredump-loop-read
Luca Boccassi [Fri, 23 Jun 2023 11:28:40 +0000 (12:28 +0100)] 
Merge pull request #28127 from poettering/coredump-loop-read

coredump: fixes with overly large coredumps

10 months agobasic: drop unused include 28123/head
Lennart Poettering [Thu, 22 Jun 2023 20:24:30 +0000 (22:24 +0200)] 
basic: drop unused include

10 months agoprocess-util: add simple wrapper around PR_SET_CHILD_SUBREAPER
Lennart Poettering [Thu, 22 Jun 2023 20:24:04 +0000 (22:24 +0200)] 
process-util: add simple wrapper around PR_SET_CHILD_SUBREAPER

Let's a simple helper that knows how to deal with PID == 1.

10 months agodocs: document threading situation in coding style
Lennart Poettering [Thu, 22 Jun 2023 09:53:16 +0000 (11:53 +0200)] 
docs: document threading situation in coding style

10 months agoasync: use FORK_DETACH for asynchronous syncs
Lennart Poettering [Thu, 22 Jun 2023 13:11:52 +0000 (15:11 +0200)] 
async: use FORK_DETACH for asynchronous syncs

To get proper "fire-and-forget" feeling we really want to make sure
noone has to reap the forked off process.

10 months agoasync: add explanatory comment
Lennart Poettering [Thu, 22 Jun 2023 13:09:50 +0000 (15:09 +0200)] 
async: add explanatory comment

10 months agoasync: drop the now unused asynchronous_job()
Lennart Poettering [Thu, 22 Jun 2023 10:04:46 +0000 (12:04 +0200)] 
async: drop the now unused asynchronous_job()

10 months agoasync: add generic implementation of asynchronous_rm_rf()
Lennart Poettering [Thu, 22 Jun 2023 09:55:59 +0000 (11:55 +0200)] 
async: add generic implementation of asynchronous_rm_rf()

This one doesn't use threads anymore. This is the last use of threads in
PID 1. Yay!

Fixes: #27287
10 months agoshared: move async.[ch] from src/basic/ → src/shared/
Lennart Poettering [Thu, 22 Jun 2023 09:54:51 +0000 (11:54 +0200)] 
shared: move async.[ch] from src/basic/ → src/shared/

That way we can later add an async wrapper for rm_rf() which is in
src/shared/, too.

10 months agoprocess-util: add FORK_DETACH flag for forking of detached child
Lennart Poettering [Thu, 22 Jun 2023 09:51:25 +0000 (11:51 +0200)] 
process-util: add FORK_DETACH flag for forking of detached child

A test for this is later added indirectly, via aynchronous_rm_rf() that
uses this and comes with a suitable test.

10 months agoautomont: rework expiry to use subprocess rather than thread
Lennart Poettering [Thu, 22 Jun 2023 08:57:31 +0000 (10:57 +0200)] 
automont: rework expiry to use subprocess rather than thread

One more step towards a thread-free PID1: let's do automount expiry in a
subprocess rather than a thread.

10 months agobasic: add comments about raw_clone() calls not supporting threads/malloc in child
Lennart Poettering [Thu, 22 Jun 2023 08:21:32 +0000 (10:21 +0200)] 
basic: add comments about raw_clone() calls not supporting threads/malloc in child

10 months agoasync: stop using threads for asynchronous_close()
Lennart Poettering [Thu, 22 Jun 2023 08:28:13 +0000 (10:28 +0200)] 
async: stop using threads for asynchronous_close()

Let's work towards PID1 being purely single threaded again. Let's rework
asynchronous_close() on top of clone() with CLONE_FILES (so that we
can manipulate PID1's fd table correctly).

One less use of pthread_create() in PID 1.

10 months agoprocess-util: add clone_with_nested_stack() helper
Lennart Poettering [Thu, 22 Jun 2023 08:27:17 +0000 (10:27 +0200)] 
process-util: add clone_with_nested_stack() helper

This wraps glibc's clone() but deals with the 'stack' parameter in a
sensible way. Only supports invocations without CLONE_VM, i.e. when
child is a CoW copy of parent.

10 months agoprocess-util: add helper that detects if we are a reaper process
Lennart Poettering [Thu, 22 Jun 2023 09:52:06 +0000 (11:52 +0200)] 
process-util: add helper that detects if we are a reaper process

10 months agoMerge pull request #28129 from poettering/userdb-ratelimit
Lennart Poettering [Fri, 23 Jun 2023 07:53:21 +0000 (09:53 +0200)] 
Merge pull request #28129 from poettering/userdb-ratelimit

userdbd: make sure we don't exit under pressure

10 months agoman: correct and extend JournalSizeMax= 28127/head
Lennart Poettering [Thu, 22 Jun 2023 15:10:14 +0000 (17:10 +0200)] 
man: correct and extend JournalSizeMax=

The man page claimed the default was 10M, but that's not true, it's
767M.

Also mention there's no point in increasing it further.

See: #26748

10 months agocoredump: clamp JournalSizeMax= to maximum journald would accept
Lennart Poettering [Thu, 22 Jun 2023 15:11:00 +0000 (17:11 +0200)] 
coredump: clamp JournalSizeMax= to maximum journald would accept

See: #26748

10 months agocoredump: use loop_read() for reading coredump into memory
Lennart Poettering [Thu, 22 Jun 2023 14:48:48 +0000 (16:48 +0200)] 
coredump: use loop_read() for reading coredump into memory

Fixes: #26748
10 months agotpm2-util: look for tpm2-pcr-signature.json directly in /.extra/
Lennart Poettering [Thu, 22 Jun 2023 14:26:15 +0000 (16:26 +0200)] 
tpm2-util: look for tpm2-pcr-signature.json directly in /.extra/

So far we relied on tmpfiles.d to copy tpm2-pcr-signature.json from
/.extra/ into /run/systemd/. This is racy however if cryptsetup runs too
early, and we cannot unconditionally run it after tmpfiles completed.

hence, let's teach cryptsetup to directly look for the file in /.extra/,
in order to simplify this, and remove the race. But do so only in the
initrd (as only there /.extra/ is a concept).

We generally prefer looking in /run/systemd/, since things are under
user control then. In the regular system we exclusively want that
userspace looks there.

Fixes: #26490
10 months agocopy: propagate error in fd_copy_directory() 28117/head
Yu Watanabe [Thu, 22 Jun 2023 07:13:29 +0000 (16:13 +0900)] 
copy: propagate error in fd_copy_directory()

Follow-up for 01428141ba42a06d22f2c0e0df26049e700f4098.

Fixes CID#1513190.

10 months agocopy: fix fd leak
Yu Watanabe [Fri, 23 Jun 2023 01:10:58 +0000 (10:10 +0900)] 
copy: fix fd leak

Follow-up for 01428141ba42a06d22f2c0e0df26049e700f4098.

10 months agocopy: add one more assertions about copy_flags
Yu Watanabe [Thu, 22 Jun 2023 07:12:24 +0000 (16:12 +0900)] 
copy: add one more assertions about copy_flags

Follow-up for 01428141ba42a06d22f2c0e0df26049e700f4098.

10 months agotree-wide: getpid() → getpid_cached()
Lennart Poettering [Mon, 10 Aug 2020 14:33:02 +0000 (16:33 +0200)] 
tree-wide: getpid() → getpid_cached()

This doesn't really matter, but let's be systematic and prefer
getpid_cached() in our codebase.

10 months agouserdbd: when we hit a flood of requests to start more workers, don't exit 28129/head
Lennart Poettering [Thu, 22 Jun 2023 16:51:34 +0000 (18:51 +0200)] 
userdbd: when we hit a flood of requests to start more workers, don't exit

Let's tweak what we do if we detect a flood of requests to start more
workers: if none of the workers ever sticks (i.e. the worker count is
zero) then let's just give up, as before.

Otherwise, let's just not start more workers for a while, and do so
again after a while. Thus spawning ofr workers will "cool off" for a
while.

Fixes: #27028
10 months agouserdbd: prefix parameters with their names more
Lennart Poettering [Thu, 22 Jun 2023 16:50:43 +0000 (18:50 +0200)] 
userdbd: prefix parameters with their names more

10 months agouserdbd: drastically raise ratelimit we apply on requests for more worker processes
Lennart Poettering [Thu, 22 Jun 2023 16:48:41 +0000 (18:48 +0200)] 
userdbd: drastically raise ratelimit we apply on requests for more worker processes

These requests might come in during lookup floods very quickly, since
multiple worker processes might detect that things should be scaled up
at the same time. Hence, let's substantially raise the limit so that it
doesn't get hit in real-life scenarios and acts more like a safety net.

10 months agomeson: merge two similar loops for unit files
Yu Watanabe [Fri, 16 Jun 2023 01:38:25 +0000 (10:38 +0900)] 
meson: merge two similar loops for unit files

This also merges two arrays units and in_units, and uses dictionary
for declaring units.

This also fixes the condition handling, that previously only two
conditions were handled and rests were ignored.

11 months agodocs: describe $TESTFUNCS briefly
Lennart Poettering [Thu, 22 Jun 2023 14:10:06 +0000 (16:10 +0200)] 
docs: describe $TESTFUNCS briefly

Follow-up for f1a83e41ae985bd17056b3a9fe285cc196358183

11 months agotests: teach tests boilerplate to run selected tests only
Lennart Poettering [Wed, 21 Jun 2023 13:02:59 +0000 (15:02 +0200)] 
tests: teach tests boilerplate to run selected tests only

sometimes its useful to only run a specific test (or multiple) instead
of all implemented in a test. Allow the test name(s) to be specified on the
in a $TESTFUNCS env var, separated by colons.

11 months agoMerge pull request #28104 from DaanDeMeyer/emergency-kexec-halt
Lennart Poettering [Thu, 22 Jun 2023 14:07:35 +0000 (16:07 +0200)] 
Merge pull request #28104 from DaanDeMeyer/emergency-kexec-halt

core: Add halt and kexec emergency actions

11 months agohwdb: Don't generate hwdb if no hwdb files are found
Daan De Meyer [Wed, 21 Jun 2023 11:17:01 +0000 (13:17 +0200)] 
hwdb: Don't generate hwdb if no hwdb files are found

11 months agocore: restrict ImportCredential= globbing
Lennart Poettering [Wed, 21 Jun 2023 08:53:24 +0000 (10:53 +0200)] 
core: restrict ImportCredential= globbing

Let's restrict how we apply credential globbing in ImportCredential=, so
that we have some flexibility in automatically extending the glob
expression with per-instance data eventually without getting into
conflict with the globbing parts.

In our current uses we only allow globbing at the end of the expression,
and this is a new, unreleased feature hence let's be restrictive on this
initially. We can still relax this later if we feel the need to after
all.

Fixes: #28022
11 months agopid1: use FORK_DEATHSIG where appropriate
Lennart Poettering [Thu, 22 Jun 2023 10:38:57 +0000 (12:38 +0200)] 
pid1: use FORK_DEATHSIG where appropriate

11 months agoman: correct reference to sd_id128_get_boot_app_specific
Jan Luebbe [Thu, 22 Jun 2023 10:59:33 +0000 (12:59 +0200)] 
man: correct reference to sd_id128_get_boot_app_specific

The function sd_id128_get_boot_app_specific is the app specific variant of
sd_id128_get_boot.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
11 months agoMerge pull request #28115 from yuwata/meson-tiny-fixes
Daan De Meyer [Thu, 22 Jun 2023 09:49:36 +0000 (11:49 +0200)] 
Merge pull request #28115 from yuwata/meson-tiny-fixes

meson: several tiny fixes

11 months agounits: Use built-in halt and kexec features instead of systemctl 28104/head
Daan De Meyer [Thu, 22 Jun 2023 09:33:18 +0000 (10:33 +0100)] 
units: Use built-in halt and kexec features instead of systemctl

11 months agocore: Add halt and kexec emergency actions
Daan De Meyer [Wed, 21 Jun 2023 09:59:27 +0000 (11:59 +0200)] 
core: Add halt and kexec emergency actions

Let's complete the picture by adding the missing halt and kexec
emergency actions.

11 months agosleep-util: mention that offset is in memory pages
Lennart Poettering [Thu, 22 Jun 2023 08:29:50 +0000 (10:29 +0200)] 
sleep-util: mention that offset is in memory pages

11 months agorpm: fix lua trigger priority for sysusers
Franck Bui [Wed, 21 Jun 2023 08:32:57 +0000 (10:32 +0200)] 
rpm: fix lua trigger priority for sysusers

Commit cd621954ed643c6ee0d869132293e26056a48826 probably forgot to fix the lua
implementation.

11 months agotime-util: introduce usleep_safe() 27843/head
Yu Watanabe [Wed, 31 May 2023 23:31:25 +0000 (08:31 +0900)] 
time-util: introduce usleep_safe()

We use usec_t for storing time value, which is 64bit.
However, usleep() takes useconds_t that is (typically?) 32bit.
Also, usleep() may only support the range [0, 1000000].

This introduce usleep_safe() which takes usec_t.

11 months agotest: check size detections by meson
Yu Watanabe [Wed, 31 May 2023 23:20:04 +0000 (08:20 +0900)] 
test: check size detections by meson

11 months agomeson: sort types
Yu Watanabe [Wed, 31 May 2023 23:18:15 +0000 (08:18 +0900)] 
meson: sort types

11 months agomeson: fix test dependency 28115/head
Yu Watanabe [Mon, 19 Jun 2023 23:20:12 +0000 (08:20 +0900)] 
meson: fix test dependency

Follow-up for daf4e78e4841a527ba62da48fd00e2e6b8805193.

11 months agomeson: shorten code a bit
Yu Watanabe [Mon, 19 Jun 2023 23:06:43 +0000 (08:06 +0900)] 
meson: shorten code a bit

11 months agomeson: drop wrong and redundant assignment
Yu Watanabe [Mon, 19 Jun 2023 21:28:56 +0000 (06:28 +0900)] 
meson: drop wrong and redundant assignment

Follow-up for b62ee354dd68349812f0526622c4e164b4a89f5f.

11 months agomeson: also build symbol tests for static-libsystemd=no-pic
Yu Watanabe [Mon, 19 Jun 2023 21:08:17 +0000 (06:08 +0900)] 
meson: also build symbol tests for static-libsystemd=no-pic

11 months agomeson: add dependency for udev runner to test
Yu Watanabe [Mon, 19 Jun 2023 21:05:53 +0000 (06:05 +0900)] 
meson: add dependency for udev runner to test

11 months agosd-journal: verify journal file header in more detail
Yu Watanabe [Tue, 16 May 2023 18:29:23 +0000 (03:29 +0900)] 
sd-journal: verify journal file header in more detail

Fixes #27635.

11 months agopam: add macro wrapper to make code shorter
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jun 2023 07:47:00 +0000 (09:47 +0200)] 
pam: add macro wrapper to make code shorter

The same pattern is repeated so many times that it seems worth making a
shorthand for it.

Follow-up for f71b55b51075e7ce42fa0ad4ae5569ba1aea6ee2 and
2675747f3cdd6f1e6236bbb2f79abfa53fb307f1.

11 months agoMerge pull request #28109 from mrc0mmand/more-journal-shenanigans
Luca Boccassi [Wed, 21 Jun 2023 23:46:06 +0000 (00:46 +0100)] 
Merge pull request #28109 from mrc0mmand/more-journal-shenanigans

test: cover a couple of missed code paths in journalctl/journald

11 months agosystemd-analyze: allow --quiet for condition checks
Ronan Pigott [Wed, 21 Jun 2023 02:47:47 +0000 (19:47 -0700)] 
systemd-analyze: allow --quiet for condition checks

I figure these messages are rather unnecessary, so let the user quiet
them with the existing --quiet flag if desired. Makes systemd-analyze
condition a little more ergonomic in scripts.

11 months agoelf-util: discard PT_LOAD segment early based on the start address.
Romain Geissler [Tue, 20 Jun 2023 16:06:31 +0000 (16:06 +0000)] 
elf-util: discard PT_LOAD segment early based on the start address.

Indeed when iterating over all the PT_LOAD segment of the core dump
while trying to look for the elf headers of a given module, we iterate
over them all and try to use the first one for which we can parse a
package metadata, but the start address is never taken into account,
so absolutely nothing guarantees we actually parse the right ELF header
of the right module we are currently iterating on.

This was tested like this:
 - Create a core dump using sleep on a fedora 37 container, with an
   explicit LD_PRELOAD of a library having a valid package metadata:

    podman run -t -i --rm -v $(pwd):$(pwd) -w $(pwd) fedora:37 bash -x -c \
        'LD_PRELOAD=libreadline.so.8 sleep 1000 & SLEEP_PID="$!" && sleep 1 && kill -11 "${SLEEP_PID}" && mv "core.${SLEEP_PID}" the-core'

 - Then from a fedora 38 container with systemd installed, the resulting
   core dump has been passed to systemd-coredump with and without this
   patch. Without this patch, we get:

       Module /usr/bin/sleep from rpm bash-5.2.15-3.fc38.x86_64
       Module /usr/lib64/libtinfo.so.6.3 from rpm coreutils-9.1-8.fc37.x86_64
       Module /usr/lib64/libc.so.6 from rpm coreutils-9.1-8.fc37.x86_64
       Module /usr/lib64/libreadline.so.8.2 from rpm coreutils-9.1-8.fc37.x86_64
       Module /usr/lib64/ld-linux-x86-64.so.2 from rpm coreutils-9.1-8.fc37.x86_64

   While with this patch we get:

       Module /usr/bin/sleep from rpm bash-5.2.15-3.fc38.x86_64
       Module /usr/lib64/libtinfo.so.6.3 from rpm ncurses-6.3-5.20220501.fc37.x86_64
       Module /usr/lib64/libreadline.so.8.2 from rpm readline-8.2-2.fc37.x86_64

So the parsed package metadata reported by systemd-coredump when the module
files are not found on the host (ie the case of crash inside a container) are
now correct. The inconsistency of the first module in the above example
(sleep is indeed not provided by the bash package) can be ignored as it
is a consequence of how this was tested.

In addition to this, this also fixes the performance issue of
systemd-coredump in case of the crashing process uses a large number of
shared libraries and having no package metadata, as reported in
https://sourceware.org/pipermail/elfutils-devel/2023q2/006225.html.

11 months agoMerge pull request #27942 from DaanDeMeyer/root-ephemeral
Daan De Meyer [Wed, 21 Jun 2023 15:24:39 +0000 (17:24 +0200)] 
Merge pull request #27942 from DaanDeMeyer/root-ephemeral

core: Add RootEphemeral= setting

11 months agotest: cover a couple of missed code paths in journalctl/journald 28109/head
Frantisek Sumsal [Wed, 21 Jun 2023 11:14:54 +0000 (13:14 +0200)] 
test: cover a couple of missed code paths in journalctl/journald

11 months agotest: Add RootEphemeral= integration test 27942/head
Daan De Meyer [Tue, 20 Jun 2023 11:54:07 +0000 (13:54 +0200)] 
test: Add RootEphemeral= integration test

11 months agotest: Add touch into minimal verity test image
Daan De Meyer [Tue, 20 Jun 2023 11:53:45 +0000 (13:53 +0200)] 
test: Add touch into minimal verity test image

11 months agocore: Add RootEphemeral= setting
Daan De Meyer [Tue, 6 Jun 2023 15:44:09 +0000 (17:44 +0200)] 
core: Add RootEphemeral= setting

This setting allows services to run in an ephemeral copy of the root
directory or root image. To make sure the ephemeral copies are always
cleaned up, we add a tmpfiles snippet to unconditionally clean up
/var/lib/systemd/ephemeral. To prevent in use ephemeral copies from
being cleaned up by tmpfiles, we use the newly added COPY_LOCK_BSD
and BTRFS_SNAPSHOT_LOCK_BSD flags to take a BSD lock on the ephemeral
copies which instruct tmpfiles to not touch those ephemeral copies as
long as the BSD lock is held.

11 months agojournal-remote: fix typo in an error message
Frantisek Sumsal [Wed, 21 Jun 2023 09:09:12 +0000 (11:09 +0200)] 
journal-remote: fix typo in an error message

11 months agomeson: update man rules
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jun 2023 23:46:45 +0000 (17:46 -0600)] 
meson: update man rules

Fixup for 403082602d4230c224529c46e2d8a392f3a50e49.

11 months agoMerge pull request #28079 from Geass-LL/comment
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jun 2023 23:40:36 +0000 (01:40 +0200)] 
Merge pull request #28079 from Geass-LL/comment

basic/env-file: also change to state PRE_KEY if we see NEWLINE in sta…

11 months agoMerge pull request #28082 from mrc0mmand/more-journal-remote-tests
Luca Boccassi [Tue, 20 Jun 2023 22:38:24 +0000 (23:38 +0100)] 
Merge pull request #28082 from mrc0mmand/more-journal-remote-tests

test: add a couple of tests for systemd-journal-{remote,upload}

11 months agoMerge pull request #28095 from poettering/generic-valid-version
Lennart Poettering [Tue, 20 Jun 2023 19:37:46 +0000 (21:37 +0200)] 
Merge pull request #28095 from poettering/generic-valid-version

make version_is_valid() generic

11 months agostat-util: add missing S_IFLNK entry in inode_type_to_string()
Lennart Poettering [Tue, 20 Jun 2023 15:03:47 +0000 (17:03 +0200)] 
stat-util: add missing S_IFLNK entry in inode_type_to_string()

No idea what happened here, but it's a glaring omission.

11 months agoanalyze: also check for version string validity 28095/head
Lennart Poettering [Tue, 20 Jun 2023 16:30:40 +0000 (18:30 +0200)] 
analyze: also check for version string validity

It's highly interesting to see if tools such as systemd-sysupdate
consider a version valid, hence let's output that too (though
gracefully, not fatally)

11 months agostring-util: move version_is_valid() into generic code
Lennart Poettering [Thu, 2 Mar 2023 10:09:42 +0000 (11:09 +0100)] 
string-util: move version_is_valid() into generic code

While we are at it, replace the sloppy use of filename_is_valid() by the
less sloppy filename_part_is_valid() (as added by the preceeding
commit), since we don#t want to be too restrictive here. (After all,
version strings invalid as standalone filenames might be valid as part
of filenames, and hence we should allow them).

11 months agopath-util: split filename_is_valid() in two
Lennart Poettering [Fri, 3 Mar 2023 17:15:39 +0000 (18:15 +0100)] 
path-util: split filename_is_valid() in two

Add a helper filename_part_is_valid() which does half of what
filename_is_valid() does: it checks for valid chars and length, but does
not filter out ".", ".." and "", as these are OK as parts of filenames,
just not alone.

11 months agohwdb: add support for Jun Tab2/Dere T11 to 60-sensor.hwdb (#28092)
Juno Computers [Tue, 20 Jun 2023 16:41:47 +0000 (12:41 -0400)] 
hwdb: add support for Jun Tab2/Dere T11 to 60-sensor.hwdb (#28092)