Commit Graph
65459 Commits
Author SHA1 Message Date
Daan De Meyer cdad1f1407 test: Add RootEphemeral= integration test 2023-06-21 12:48:48 +02:00
Daan De Meyer d110169b65 test: Add touch into minimal verity test image 2023-06-21 12:48:48 +02:00
Daan De Meyer 9c0c670125 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.
2023-06-21 12:48:46 +02:00
Daan De Meyer dbc3cc8b83 tmpfiles: Add note to man page about guaranteed cleanup for files/directories 2023-06-20 15:22:47 +02:00
Daan De Meyer 08c25eee34 tmpfiles: Don't log about harmless errors when trying to lock file
Let's make sure we don't log if the file is a symlink or does not
exist.
2023-06-20 15:22:47 +02:00
Daan De Meyer b572e8da41 tmpfiles: Fix BSD lock logging messages 2023-06-20 15:22:47 +02:00
Daan De Meyer d31f8e0cb8 dissect-image: Log if verity signature partition is too large 2023-06-20 15:22:47 +02:00
Daan De Meyer 66130f0a55 namespace: Load sidecar verity settings in apply_mount_namespace()
Let's reduce the argument count of setup_namespace() a bit by loading
the sidecar verity settings in apply_mount_namespace(). This will also
make it possible to pass file descriptors to the root image/directory
into setup_namespace() as before this wasn't possible because the
verity settings logic looks for sidecar files next to the
root image which requires the path to be available.
2023-06-20 15:22:47 +02:00
Daan De Meyer 1a5f67aba3 Merge pull request #27863 from DaanDeMeyer/copy-lock
Add helpers to lock a directory before copying into it
2023-06-20 15:22:24 +02:00
Lennart Poettering 459d84076f update TODO 2023-06-20 14:41:28 +02:00
Daan De Meyer d54f60c2af btrfs-util: Add BTRFS_SNAPSHOT_LOCK_BSD
When making ephemeral snapshots of subvolumes whose cleanup depends on
whether they're locked or not, it's necessary to have the lock from the
very beginning, so let's support that with a new BTRFS_SNAPSHOT_LOCK_BSD
flag.
2023-06-20 13:42:41 +02:00
Mike Yuan 68f8a86a46 gpt-auto: expand the loader partition UUID check to include XBOOTLDR
Before this commit, we only accept the case when LoaderDevicePartUUID
points to the ESP, while XBOOTLDR is mounted unconditionally.

After this commit, we check if LoaderDevicePartUUID points to either
ESP or XBOOTLDR. If it does, mount both, else nothing gets mounted.
2023-06-20 11:15:48 +02:00
cvlc12 1c2c00dbb6 Fix quoting 2023-06-20 00:51:32 +01:00
Zbigniew Jędrzejewski-Szmek 72e7bfe02d Merge pull request #27941 from cvlc12/early_cpio
Define 'microcode' file type for the kernel-install staging area.
2023-06-19 18:49:31 +02:00
msizanoen 996b00ede8 Revert "core/service: when resetting PID also reset known flag"
This reverts commit ff32060f2e.

This change is incorrect as we don't want to mark the PID as invalid but
only mark it as dead.

The change in question also breaks user level socket activation for
`podman.service` as the termination of the main `podman system service`
process is not properly handled, causing any application accessing the
socket to hang.

This is because the user-level `podman.service` unit also hosts two
non-main processes: `rootlessport` and `rootlessport-child` which causes
the `cgroup_good` check to still succeed.

The original submitter of this commit is recommended to find another
more correct way to fix the cgroupsv1 issue on CentOS 8.
2023-06-19 18:18:46 +02:00
cvlc12 4221065237 Add docs, improve log comments. 2023-06-19 17:34:53 +02:00
Frantisek Sumsal ed8f65c729 Merge pull request #28078 from keszybz/trivial-syntax-and-wording-fixes
Trivial syntax and wording fixes
2023-06-19 16:41:16 +02:00
Lennart Poettering ab93429dea Merge pull request #28056 from dtardon/polkit-cleanup
Some bus-polkit cleanup
2023-06-19 15:50:35 +02:00
Lennart Poettering 5cbfbf2aaa man: place options in a some limited form of subsections
Let's visually separate the options associated with cpu, io, memory, …
in subsections

This patch tries to be minimal. It just adds the section titles, and
does minimal reordering to make sure the options on the same kind of
resource are placed close to each other.
2023-06-19 13:42:34 +02:00
Zbigniew Jędrzejewski-Szmek b2544bb6e8 machinectl: fix message
bus_wait_for_jobs_new() can fail for various reasons.
2023-06-19 13:36:30 +02:00
Zbigniew Jędrzejewski-Szmek 12cc960163 shared: improve messages about switch root operations
"change" is not clear without context.
2023-06-19 13:36:30 +02:00
Zbigniew Jędrzejewski-Szmek 730bdfed81 man/systemd-nspawn: fix indentation and parenthesis location 2023-06-19 13:36:30 +02:00
Zbigniew Jędrzejewski-Szmek 5811490a3f docs/CREDENTIALS: fix confusion of i.e. and e.g. 2023-06-19 13:36:30 +02:00
Zbigniew Jędrzejewski-Szmek 966dd7527d man: missing/misplaced periods 2023-06-19 13:36:30 +02:00
Sam Morris d9714fe405 Resource control manpage fixup (#28046)
The order of the description of each item should match the order that they are declared. Un-document effect of deprecated non-unified CGroup hierarchy on
DefaultCPUAccounting=. Mention that the default value for DefaultCPUAccouting= is 
affected by the kernel version.
2023-06-19 13:30:43 +02:00
Luca Boccassi 14cb29dfd5 Merge pull request #28074 from mrc0mmand/journal-gatewayd-followups
A couple of follow-ups for systemd-journal-gatewayd tests
2023-06-19 12:14:28 +01:00
David Tardon 3a3d4d3bd8 bus-polkit: put function params to a single line 2023-06-19 12:36:40 +02:00
David Tardon f8636446be bus-polkit: drop unnecessary else 2023-06-19 12:36:40 +02:00
David Tardon 4d12d3976c bus-polkit: merge variable declarations 2023-06-19 12:34:27 +02:00
David Tardon d32ac157ef bus-polkit: decrease indentation 2023-06-19 12:33:24 +02:00
David Tardon 9f657af4c3 bus-polkit: extract creation of polkit call to a function 2023-06-19 12:32:40 +02:00
David Tardon d2c50a176d bus-polkit: move verification to a separate function 2023-06-19 12:32:26 +02:00
Gibeom Gwon 5bfc4de634 homework: resize to maximum disk space if disk size is not specified
If the backing storage is LUKS2 on a block device, auto resize mode
is enabled, and disk size is not specified, resize the partition to
the maximum expandable size.

Fixes: #22255, #23967
2023-06-19 12:26:34 +02:00
Lennart Poettering be76bf625c update TODO 2023-06-19 10:36:42 +02:00
Daan De Meyer 94c357ca23 mkosi: Update to latest
We now run repart before starting systemd-nspawn to make sure that
the root partition is also generated when we boot the image in a
container instead of a VM.

To make sure we start from scratch for both the container boot and
the VM boot, we also enable Ephemeral to make sure all changes to
the image are ephemeral.
2023-06-19 10:30:39 +02:00
Frantisek Sumsal 033601b79a test: wrap curl when running with ASan
Necessary (unfortunately) for curl on C8S.
2023-06-19 10:19:44 +02:00
Frantisek Sumsal f9d1806e3b journal-gatewayd: handle SIGTERM
To allow gatewayd to exit cleanly.
2023-06-19 10:19:44 +02:00
licunlong a068eeac6f core/dbus-manager: also show DefaultIOAccounting and DefaultIPAccounting
fix: https://github.com/systemd/systemd/issues/28045
2023-06-19 09:57:11 +02:00
Frantisek Sumsal 52db3601bd test: extend the DynamicUser=yes coverage workaround to a couple more services 2023-06-18 23:08:24 +02:00
cvlc12 a6d8884120 Define 'microcode' type of initrd for the kernel-install staging area.
This allows microcode to be referenced first for UKIs and loader entries.
2023-06-18 20:38:20 +02:00
Luca Boccassi 5f655ffb15 Merge pull request #28069 from medhefgo/boot-dp
boot: device_path_to_str improvements
2023-06-18 15:11:49 +01:00
Luca Boccassi 40cdb3b756 journal: avoid infinite recursion when closing bad journal FD
When trying to log, if we fail we try to close the journal FD. If
it is bad, safe_close() will fail and assert, which will try to log,
which will fail, which will try to close the journal FD...
Infinite recursion looks very pretty live in gdb, but let's avoid
that by immediately invalidating the journal FD before closing it.
2023-06-18 12:31:53 +01:00
Jan Janssen 78fffdea37 boot: Improve device_path_to_str_internal()
The UEFI spec has a generic `Path` node representation that can be used
for device path nodes that are unknown. So we can use that instead of
giving up when we see a node other than FilePath.

This also simplifies the FilePath case by just using xasprintf(). The
code is really just a fallback for silly firmware that does not
implement EFI_DEVICE_PATH_TO_TEXT_PROTOCOL (looking at you, Apple).

The correctness of this was tested by round-tripping it through
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL, which yielded an identical device
compared to our input path.
2023-06-18 11:13:09 +02:00
Jan Janssen e53e5c0ac1 boot: Split log_hexdump() 2023-06-18 11:13:03 +02:00
Jan Janssen f982500338 boot: Move custom device path string creating into its own function 2023-06-18 09:42:22 +02:00
Luca Boccassi 55e1ff26a5 Merge pull request #28060 from mrc0mmand/remote-journal-tests
test: add a couple of tests for systemd-journal-gatewayd
2023-06-17 11:34:50 +01:00
Yu Watanabe ecaee348d9 Merge pull request #28063 from bluca/test_oomd_fixlets
Readability fixes for TEST-55-OOMD
2023-06-17 14:37:53 +09:00
Luca Boccassi 6acbb3f2fb TEST-55-OOMD: improve ephemeral configuration readability 2023-06-17 00:08:09 +01:00
Luca Boccassi 565b13f8b2 TEST-55-OOMD: use /run/ for configuration instead of /etc/
Make sure configuration is ephemeral if the image is reused
2023-06-17 00:08:09 +01:00
Frantisek Sumsal 9ccd59f751 socket-activate: make a copy of the command name and arguments
When we call safe_fork() with the first argument set (process name), we
call rename_process() that zeroes out saved argv (that was saved by
save_argc_argv() in the main func defined by DEFINE_MAIN_FUNC()). In this
case this means that with --accept both the target executable name and
its arguments will be empty strings:

```
$ systemd-socket-activate --accept --listen 1111 cat &
Listening on [::]:1111 as 3.
$ curl localhost:1111
Communication attempt on fd 3.
Connection from 127.0.0.1:52948 to [::ffff:127.0.0.1]:1111
Spawned cat (cat) as PID 10576.
Execing  ()
Failed to execp  (): No such file or directory
Child 10576 died with code 1
curl: (56) Recv failure: Connection reset by peer
```

Let's make a copy of the necessary arguments beforehand and use it
instead to fix this.
2023-06-16 20:42:43 +02:00