Commit Graph
61370 Commits
Author SHA1 Message Date
Lennart Poettering e0cd19007e discover-image: add stringification helpers for ImageClass 2022-12-07 17:44:35 +01:00
Luca Boccassi 3dd581f9e4 Merge pull request #25651 from keszybz/man-halt
Deemphasize 'halt' subcommand
2022-12-07 15:49:30 +01:00
Yu Watanabe 42f8b6a808 network: manage addresses in the way the kernel does
This effectively reverts 5d0030310c.

With the commit 5d0030310c, networkd manages
addresses with the detailed hash and compare functions. But that causes
networkd cannot detect address update by the kernel or an external tool.
See issue
https://github.com/systemd/systemd/issues/481#issuecomment-1328132401.

With this commit, networkd (again) manages addresses in the way that the
kernel does. Hence, we can correctly detect address update.
2022-12-07 15:10:45 +01:00
Yu Watanabe b448fc0a6f test-network: try to change MAC address more
Follow-up for 23b6bf274f.
2022-12-07 15:08:23 +01:00
Frantisek Sumsal ed7c45a8c8 packit: ignore unpackaged files
It may take a bit for newly introduced binaries/other files to get
properly integrated into the Rawhide specfile, so don't choke up in the
meantime when rpmbuild detects unpackaged files.
2022-12-07 15:07:14 +01:00
Lennart Poettering f18b0a7630 update TODO 2022-12-07 14:31:57 +01:00
Luca Boccassi 87edf80b1b Merge pull request #25502 from keszybz/pam-namespace-add
Add pam_namespace to user@.service pam stack
2022-12-07 13:01:50 +01:00
Yu Watanabe 47c57b4813 core: use correct scope of looking up units
Fixes a bug introduced by 3b3557c410.

Fixes #25625.
2022-12-07 12:45:33 +01:00
Lennart Poettering 31d4258011 Merge pull request #25648 from keszybz/exitrd
Build systemd-shutdown.standalone
2022-12-07 11:34:54 +01:00
Zbigniew Jędrzejewski-Szmek 269d17f955 man: deemphasize "halt"
Systemd documents "halt" as the primary shutdown mechanism, redirecting
"reboot" and "shutdown" to the halt(8), but halt is a really strange and
obsolete concept. Who would want to really keep their machine running after
shutdown? I expect that halting is almost unused. Let's at least make it less
prominent in the docs.

While at it, use "power off" for a verb and "power-off" for noun (but "poweroff"
of the actual command name).
2022-12-07 10:26:31 +01:00
Yu Watanabe 9644fbd584 fuzz-systemctl: adjust size limit
Follow-up for 719b7d4dc2.

The size of the current reproducer is 250KB. Hence, 16KB should be
enough, but still we can test most arguments within the size.

Hopefully fixes oss-fuzz#53552.
2022-12-07 09:56:50 +01:00
Yu Watanabe bf9afd7b31 Merge pull request #25628 from zhangjian3032/dev/fix-set-bond-mac-failed
network: Fix set bond device MAC address failed
2022-12-07 13:34:39 +09:00
Daan De Meyer 94799c305a test-fs-util: Add relative path chase_symlinks() tests 2022-12-07 10:39:20 +09:00
Zbigniew Jędrzejewski-Szmek cc420ae52a Merge pull request #25616 from poettering/chase-symlinks-opendir
chase-symlinks/systemctl: let's handle cases without /proc/ better
2022-12-06 17:10:54 +01:00
Lennart Poettering 86adf4a5e8 gpt: add helpers for deriving data partition from verity or verity sig designator
let's add the inverse of the existing partition_verity_of() and
partition_verity_sig_of()
2022-12-06 16:41:06 +01:00
Frantisek Sumsal 0e336ea265 Merge pull request #25644 from yuwata/escape-fix-octescape
escape: fix octescape()
2022-12-06 15:22:08 +00:00
Yu Watanabe f4ee7b98c4 network: drop REMOVING flag when a netlink message is sent to kernel
When an interface goes to down, the kernel drops several routes
automatically, and at the same time networkd requests to remove
them, but the kernel sometimes does not respond the requests. Hence,
the routes cannot drop the REMOVING flag, and networkd will never try
to configure other routes which depend on the previously removed
routes even if they are already reconfigured.

With this patch, when networkd sends a request to configure a route
(or any other network settings), REMOVING flag for the route is dropped
without waiting for the reply about the previous remove request, as we
can expect it will appear even if it is already removed or under removing.

Fixes #24999.
2022-12-06 16:01:01 +01:00
Luca Boccassi 0927ae6a5c Merge pull request #25645 from yuwata/boot-fix-false-maybe-uninitialized
boot: fix false maybe-uninitialized warning
2022-12-06 16:00:10 +01:00
Aidan Dang b04ff66b42 Implement --luks-pbkdf-force-iterations for homed 2022-12-06 15:56:11 +01:00
Zbigniew Jędrzejewski-Szmek 9551c46a3d man: reword sentence
"Such as … suchlike" repeats too much.
2022-12-06 11:44:30 +01:00
Zbigniew Jędrzejewski-Szmek 6ed3aca5c3 meson: build a standalone version of systemd-shutdown
I'd like to use this as a basis for an exitrd:

When compiled with -Dstandalone-binaries=true -Db_lto=true -Dbuildtype=release,
the new file is 800k. It's more than I'd like, but still quite a bit less
than libsystemd-shared.so, which is 3800k.
2022-12-06 10:15:54 +01:00
Zbigniew Jędrzejewski-Szmek 9702d82414 test: do the --help/--version checks for repart.standalone too 2022-12-06 10:15:54 +01:00
Jian Zhang 23b6bf274f test-network: add test for bond mac address config
Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
2022-12-06 14:41:31 +08:00
Yu Watanabe 64e7a14146 Merge pull request #25559 from intelfx/work/systemd-importd-quotas
import: wire up SYSTEMD_IMPORT_BTRFS_{SUBVOL,QUOTA} to importd
2022-12-06 14:05:35 +09:00
Yu Watanabe febe556191 boot: fix false maybe-uninitialized warning
Fixes #25641.
2022-12-06 13:10:54 +09:00
Yu Watanabe 9e406b1141 boot: cleanups for efivar_get() and friends
- rename function arguments for storing results, and support the case
  that they are NULL,
- return earlier on error,
- always validate read size in efivar_get_uint32_le() and efivar_get_uint64_le().
2022-12-06 13:10:28 +09:00
Lennart Poettering 5acb31a683 dissect: show color in log output 2022-12-06 12:25:00 +09:00
Yu Watanabe 4f438c638b test: add basic tests for octescape() 2022-12-06 12:18:14 +09:00
Yu Watanabe 76519cecc7 escape: fix wrong octescape of bad character
Fixes a bug introduced by 95052df376.

This also makes octescape() support NULL or zero length string.

Fixes [oss-fuzz#54059](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54059).

Fixes #25643.
2022-12-06 12:18:10 +09:00
Luca Boccassi 83320324df journald: fix build error
Follow-up for: 379864f890

Two PRs clashed with each other and were merged before we noticed
2022-12-06 11:41:03 +09:00
Luca Boccassi f252ea9ae4 Merge pull request #25638 from bluca/rate_limit_config
pid1: add env var to override default mount rate limit burst
2022-12-06 02:07:47 +01:00
Luca Boccassi 9cd4881d47 Merge pull request #25513 from brauner/pivot_root.nspawn
nspawn: support pivot_root()
2022-12-06 01:51:51 +01:00
Richard Phibel 379864f890 log: Switch logging to runtime when FS becomes read-only
The journal has a mechanism to log to the runtime journal if it fails to
log to the system journal. This mechanism is not triggered when the file
system becomes read-only. We enable it here.

When appending an entry fails if shall_try_append_again returns true,
the journal is rotated. If the FS is read-only, rotation will fail and
s->system_journal will be set to NULL. After that, when find_journal
will try to open the journal since s->system_journal will be NULL, it
will open the runtime journal.
2022-12-06 00:53:47 +01:00
Luca Boccassi a5d63f1e29 Merge pull request #25633 from DaanDeMeyer/journald-another-ratelimit
journald: Ratelimit a few more log messages
2022-12-05 22:08:25 +01:00
Luca Boccassi 24a4542cfa pid1: add env var to override default mount rate limit burst
I am hitting the rate limit on a busy system with low resources, and
it stalls the boot process which is Very Bad (TM).
2022-12-05 21:05:57 +00:00
Jan Macku c0ee89ac7e doc: CentOS is EOL use CentOS stream 2022-12-05 18:35:47 +01:00
Christian Brauner e79581ddfe nspawn: split mount tunnel setup
Before we supported pivot_root() nspawn used to make the rootfs shared
before setting up the mount tunnel. So it was safe for it to just turn
it into a dependent mount during setup.

However, we cannot do this anymore because of the requirements
pivot_root() has. After the pivot_root() we will make the rootfs shared
recursively. If we turned the mount tunnel into dependent mount before
mount_switch_root() this will have the consequence that it becomes a
shared mount within the same peer group as the rootfs. So no mounts will
propagate into the container from the host anymore.

To fix this we split setting up the mount tunnel and making it active
into two steps. Setting up the mount tunnel is performed before
mount_switch_root() and activating it afterwards. Note that this works
because turning a shared mount into a shared mount is a nop. IOW, no new
peer group will be allocated.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2022-12-05 18:35:02 +01:00
Christian Brauner b71a0192c0 nspawn: mount temporary visible procfs and sysfs instance
In order to mount procfs and sysfs in an unprivileged container the
kernel requires that a fully visible instance is already present in the
target mount namespace. Mount one here so the inner child can mount its
own  instances. Later we umount the temporary  instances created here
before we actually exec the payload. Since the rootfs is shared the
umount will propagate into the container. Note, the inner child wouldn't
be able to unmount the  instances on its own since it doesn't own the
originating mount namespace. IOW, the outer child needs to do this.

So far nspawn didn't run into this issue because it used MS_MOVE which
meant that the shadow mount tree pinned a procfs and sysfs instance
which the kernel would find. The shadow mount tree is gone with proper
pivot_root() semantics.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2022-12-05 18:34:25 +01:00
Christian Brauner 57c10a5650 nspawn: support pivot_root()
In order to support pivot_root() we need to move mount propagation
changes after the pivot_root(). While MS_MOVE requires the source mount
to not be a shared mount pivot_root() also requires the target mount to
not be a shared mount. This guarantees that pivot_root() doesn't leak
any mounts.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2022-12-05 18:34:25 +01:00
Luca Boccassi f587e19217 Merge pull request #25639 from jamacku/update-contributing
doc: update link to systemd-rhel GitHub repository - `CONTRIBUTING.md`
2022-12-05 17:53:14 +01:00
Jan Macku efe05392f6 doc: fix markdown-lint issues in CONTRIBUTING.md 2022-12-05 16:33:57 +01:00
Jan Macku f6f213acaf doc: update link to systemd-rhel GitHub repo
systemd-rhel GitHub repository has been moved to new location:

- https://github.com/redhat-plumbers
2022-12-05 16:33:57 +01:00
Luca Boccassi de28dd77c1 test: double default image size
I am now hitting the 500MB limit on Debian stable.
2022-12-05 15:17:57 +00:00
Daan De Meyer 04cb8ee880 journal: Ratelimit more log messages
Followup for 8522691d4d.
2022-12-05 14:41:53 +01:00
Daan De Meyer d9799ea2e2 journal: Use shared log ratelimit constant
Instead of maintaining two different constants, move the constant
to journal-internal.h and share it between files.
2022-12-05 14:41:51 +01:00
Zbigniew Jędrzejewski-Szmek cda7c31065 Merge pull request #25537 from evverx/fuzz-resource-records
tests: fuzz dns resource records
2022-12-05 13:41:38 +01:00
Jian Zhang f1a69d5acc network: Fix set bond device MAC address failed
Issue:
When device is in bond mode and booting up, there is a probability of
set bond MAC address failed due to `Device or resource busy` error.

In systemd-networkd, set MAC address steps are:
1. Try to set MAC address to device.
2. If failed with `Device or resource busy`, then `Down` the device.
3. Try to set MAC address to device again.

Currently, Even down the bond device, the bond device is still return
`Device or resource busy` error. So the MAC address set failed.

The root cause is that this not enough to down the bond device. We need
to down all the slaves of the bond device.
About this descprition, we could use those commands to check:
```shell
We have two network devices: eth0, bond1, eth0 is slave of bond1.
They are all up.

1. Down bond1, and set MAC address to bond1.
~# ip link set bond1 down
~# ip link set bond1 address 00:11:22:33:44:55
ip: SIOCSIFHWADDR: Device or resource busy

2. Down eth0, and set MAC address to bond1.
~# ip link set eth0 down
~# ip link set bond1 address 00:11:22:33:44:55
Set okay.
```

Fix:
When setting the mac for the second time, if the device kind is bond,
then we need to down the slave devices of bond device.

Tested: Verified in a long time test( reboot cycles ).

Fixes: #25627

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
2022-12-05 19:48:45 +08:00
Yu Watanabe cfef0734a1 acl-util: several cleanups
- add missing assertions,
- rename function arguments for storing result,
- rename variables which conflict our macros,
- always initialize function arguments for results on success.
2022-12-05 10:37:58 +01:00
Zbigniew Jędrzejewski-Szmek 8608fef36c Merge pull request #25437 from YHNdnzj/systemctl-disable-warn-statically-enabled-services
systemctl: warn if trying to disable a unit with no install info
2022-12-05 10:27:24 +01:00
Daan De Meyer 2877b14720 chase-symlinks: Fix regression from 5bc244aaa9
Previously, chase_symlinks() always returned an absolute path, which
changed after 5bc244aaa9. This commit
fixes chase_symlinks() so it returns absolute paths all the time again.
2022-12-05 09:27:58 +01:00