]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
17 months agotree-wide: introduce PIPE_EBADF macro
Yu Watanabe [Tue, 20 Dec 2022 01:10:19 +0000 (10:10 +0900)] 
tree-wide: introduce PIPE_EBADF macro

17 months agofuzz: sort headers
Yu Watanabe [Tue, 20 Dec 2022 02:08:53 +0000 (11:08 +0900)] 
fuzz: sort headers

17 months agoMerge pull request #25786 from keszybz/ebadf
Yu Watanabe [Tue, 20 Dec 2022 01:02:10 +0000 (10:02 +0900)] 
Merge pull request #25786 from keszybz/ebadf

Use -EBADF for fd initialization

17 months agoMerge pull request #25787 from msekletar/rename-process-cap
Yu Watanabe [Tue, 20 Dec 2022 00:58:47 +0000 (09:58 +0900)] 
Merge pull request #25787 from msekletar/rename-process-cap

units: allow systemd-userdbd to change process name

17 months agohwdb: Fn+F5 fix for MSI Bravo 15-B5DX (#25788)
noodlejetski [Tue, 20 Dec 2022 00:57:54 +0000 (01:57 +0100)] 
hwdb: Fn+F5 fix for MSI Bravo 15-B5DX (#25788)

Closes #25782.

17 months agounits: allow systemd-userdbd to change process name 25787/head
Michal Sekletar [Mon, 19 Dec 2022 16:58:49 +0000 (17:58 +0100)] 
units: allow systemd-userdbd to change process name

rename_process() requires CAP_SYS_RESOURCE so let's make sure it is in
our permitted set after execve() by adding in to the bounding set.

Previously,
systemd-userdbd.service - User Database Manager
     Loaded: loaded (/usr/lib/systemd/system/systemd-userdbd.service; indirect; preset: disabled)
     Active: active (running) since Mon 2022-12-19 17:07:21 CET; 17min ago
TriggeredBy: ● systemd-userdbd.socket
       Docs: man:systemd-userdbd.service(8)
   Main PID: 1880 (systemd-userdbd)
     Status: "Processing requests..."
      Tasks: 4 (limit: 2272)
     Memory: 5.2M
        CPU: 244ms
     CGroup: /system.slice/systemd-userdbd.service
             ├─1880 /usr/lib/systemd/systemd-userdbd
             ├─2270 systemd-userwork
             ├─2271 systemd-userwork
             └─2272 systemd-userwork

Now,
    Loaded: loaded (/usr/lib/systemd/system/systemd-userdbd.service; indirect; preset: disabled)
     Active: active (running) since Mon 2022-12-19 17:27:02 CET; 15s ago
TriggeredBy: ● systemd-userdbd.socket
       Docs: man:systemd-userdbd.service(8)
   Main PID: 2404 (systemd-userdbd)
     Status: "Processing requests..."
      Tasks: 4 (limit: 2272)
     Memory: 5.5M
        CPU: 89ms
     CGroup: /system.slice/systemd-userdbd.service
             ├─2404 /usr/lib/systemd/systemd-userdbd
             ├─2407 "systemd-userwork: waiting..."
             ├─2408 "systemd-userwork: waiting..."
             └─2409 "systemd-userwork: waiting..."

17 months agoargv-util: do proper permission check while when changing process name
Michal Sekletar [Mon, 19 Dec 2022 16:29:40 +0000 (17:29 +0100)] 
argv-util: do proper permission check while when changing process name

Process renaming happens very seldomly so we are able to afford proper
permission check, i.e. actually check for CAP_SYS_RESOURCE capability
instead of euid.

17 months agoMerge pull request #25783 from keszybz/trivial-cleanups
Lennart Poettering [Mon, 19 Dec 2022 16:01:51 +0000 (17:01 +0100)] 
Merge pull request #25783 from keszybz/trivial-cleanups

Trivial cleanups

17 months agoMerge pull request #25771 from bluca/pkcs11_dlopen
Lennart Poettering [Mon, 19 Dec 2022 16:01:02 +0000 (17:01 +0100)] 
Merge pull request #25771 from bluca/pkcs11_dlopen

p11kit: switch to dlopen()

17 months agobasic/hashmap: add comment 25783/head
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 10:19:18 +0000 (11:19 +0100)] 
basic/hashmap: add comment

Coverity complains that the check is suspicious. Add a comment to help
the reader.

17 months agoefi: do not use 'r' as pointer name
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 10:17:07 +0000 (11:17 +0100)] 
efi: do not use 'r' as pointer name

'r' should only be used as in 'int r'.

17 months agouserdb: fix typo
Zbigniew Jędrzejewski-Szmek [Fri, 16 Dec 2022 07:35:59 +0000 (08:35 +0100)] 
userdb: fix typo

17 months agoshared/dns-domain: reduce scope of variable declarations
Zbigniew Jędrzejewski-Szmek [Mon, 12 Dec 2022 14:01:49 +0000 (15:01 +0100)] 
shared/dns-domain: reduce scope of variable declarations

17 months agobasic/fd-util: rearrange variable declarations 25786/head
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 12:26:17 +0000 (13:26 +0100)] 
basic/fd-util: rearrange variable declarations

Having two blocks of normal variable declarations was unnecessary.
Also 'i' can be narrower in scope.

17 months agotree-wide: use -EBADF also in pipe initializers
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 12:20:30 +0000 (13:20 +0100)] 
tree-wide: use -EBADF also in pipe initializers

In some places, initialization is dropped when unnecesary.

17 months agotree-wide: change initialization to use EBADF instead of EBADFD
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 12:11:05 +0000 (13:11 +0100)] 
tree-wide: change initialization to use EBADF instead of EBADFD

Those fds never were, so it's not fair to say that they are in "bad state".
Let's use the shorter and more direct errno.

17 months agotree-wide: use -EBADF for fd initialization
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 12:07:42 +0000 (13:07 +0100)] 
tree-wide: use -EBADF for fd initialization

-1 was used everywhere, but -EBADF or -EBADFD started being used in various
places. Let's make things consistent in the new style.

Note that there are two candidates:
EBADF 9 Bad file descriptor
EBADFD 77 File descriptor in bad state

Since we're initializating the fd, we're just assigning a value that means
"no fd yet", so it's just a bad file descriptor, and the first errno fits
better. If instead we had a valid file descriptor that became invalid because
of some operation or state change, the other errno would fit better.

In some places, initialization is dropped if unnecessary.

17 months agosd-event: never pass negative errnos as signalfd to signalfd
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 13:36:08 +0000 (14:36 +0100)] 
sd-event: never pass negative errnos as signalfd to signalfd

We treat any negative value as "invalid fd", but signalfd only
accepts -1.

17 months agosocket-proxyd: do not hardcode -1 in a check for fd validity
Zbigniew Jędrzejewski-Szmek [Mon, 19 Dec 2022 13:35:05 +0000 (14:35 +0100)] 
socket-proxyd: do not hardcode -1 in a check for fd validity

17 months agoUpdate TODO 25771/head
Luca Boccassi [Sat, 17 Dec 2022 01:50:39 +0000 (01:50 +0000)] 
Update TODO

17 months agop11kit: switch to dlopen()
Luca Boccassi [Sat, 17 Dec 2022 01:33:46 +0000 (01:33 +0000)] 
p11kit: switch to dlopen()

17 months agoMerge pull request #25784 from poettering/bootctl-split
Lennart Poettering [Mon, 19 Dec 2022 13:37:52 +0000 (14:37 +0100)] 
Merge pull request #25784 from poettering/bootctl-split

bootctl: split up bootctl.c into multiple files

17 months agounit: use underbar for module name
Yu Watanabe [Thu, 15 Dec 2022 19:02:25 +0000 (04:02 +0900)] 
unit: use underbar for module name

For consistency with src/core/unit.c.

17 months agobootctl: split out "install" verb too 25784/head
Lennart Poettering [Mon, 19 Dec 2022 10:42:15 +0000 (11:42 +0100)] 
bootctl: split out "install" verb too

17 months agobootctl: split out "status" verb too
Lennart Poettering [Mon, 19 Dec 2022 10:04:17 +0000 (11:04 +0100)] 
bootctl: split out "status" verb too

17 months agobootctl: split out "set-efivar" verbs, too
Lennart Poettering [Fri, 16 Dec 2022 17:51:10 +0000 (18:51 +0100)] 
bootctl: split out "set-efivar" verbs, too

17 months agobootctl: also split out 'systemd-efi-options' verb
Lennart Poettering [Fri, 16 Dec 2022 17:45:55 +0000 (18:45 +0100)] 
bootctl: also split out 'systemd-efi-options' verb

17 months agobootctl: split out random seed verb, too
Lennart Poettering [Fri, 16 Dec 2022 17:42:39 +0000 (18:42 +0100)] 
bootctl: split out random seed verb, too

17 months agobootctl: let's start splitting up bootctl like we did for systemctl and others
Lennart Poettering [Fri, 16 Dec 2022 17:27:06 +0000 (18:27 +0100)] 
bootctl: let's start splitting up bootctl like we did for systemctl and others

17 months agoMerge pull request #25779 from bluca/journa_remote_vacuum
Yu Watanabe [Mon, 19 Dec 2022 00:44:04 +0000 (09:44 +0900)] 
Merge pull request #25779 from bluca/journa_remote_vacuum

journal-remote: follow-ups for #25076

17 months agojournal-remote: fix memory leak on initialization error 25779/head
Luca Boccassi [Sun, 18 Dec 2022 10:58:37 +0000 (10:58 +0000)] 
journal-remote: fix memory leak on initialization error

Follow-up for f12b399dd6362a03379cb769954ebfb9972236ed from
https://github.com/systemd/systemd/pull/25076

CID#1501550

17 months agojournal-remote: fix initialization of vacuum metrics
Luca Boccassi [Sun, 18 Dec 2022 10:51:36 +0000 (10:51 +0000)] 
journal-remote: fix initialization of vacuum metrics

Follow-up for f12b399dd6362a03379cb769954ebfb9972236ed from
https://github.com/systemd/systemd/pull/25076

CID#1501551

17 months agomeson: fix cross-compilation of LONG_MAX
asavah [Sat, 17 Dec 2022 16:00:56 +0000 (17:00 +0100)] 
meson: fix cross-compilation of LONG_MAX

https://github.com/systemd/systemd/pull/25618#issuecomment-1355019553

17 months agovacuum journal remote (#25076)
berenddeschouwer [Sat, 17 Dec 2022 13:54:16 +0000 (15:54 +0200)] 
vacuum journal remote (#25076)

* Support vacuuming for journal-remote

Co-authored-by: Berend De Schouwer <berend@deschouwer.co.za>
17 months agoMerge pull request #25221 from enr0n/nic-rename-fallback
Luca Boccassi [Sat, 17 Dec 2022 13:51:39 +0000 (14:51 +0100)] 
Merge pull request #25221 from enr0n/nic-rename-fallback

udev: set link alternative name if link is already up during rename

17 months agoMerge pull request #25387 from yuwata/core-fix-gc-logic
Luca Boccassi [Sat, 17 Dec 2022 13:49:21 +0000 (14:49 +0100)] 
Merge pull request #25387 from yuwata/core-fix-gc-logic

core: fix logic of merging units

17 months agoAdd basic systemctl edit test
наб [Tue, 22 Nov 2022 04:14:01 +0000 (05:14 +0100)] 
Add basic systemctl edit test

17 months agoTODO
Lennart Poettering [Fri, 16 Dec 2022 10:42:11 +0000 (11:42 +0100)] 
TODO

17 months agotest: systemd-mount --list and systemd-umount requires the device is initialized...
Yu Watanabe [Thu, 15 Dec 2022 18:04:22 +0000 (03:04 +0900)] 
test: systemd-mount --list and systemd-umount requires the device is initialized by udevd

Fixes #25674.

17 months agoman/systemd-oomd.service: Document command line options
Jade Lovelace [Wed, 7 Dec 2022 19:34:22 +0000 (11:34 -0800)] 
man/systemd-oomd.service: Document command line options

Previously these were not written down. This PR depends on #25670, since
`--dry-run` prints at debug level in `main`, which is surprising
behaviour.

17 months agoMerge pull request #25487 from poettering/systemctl-edit-newline-fix
Lennart Poettering [Thu, 15 Dec 2022 21:22:32 +0000 (22:22 +0100)] 
Merge pull request #25487 from poettering/systemctl-edit-newline-fix

systemctl: simplify trim_edit_markers()

17 months agoImplement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for homed...
Aidan Dang [Sat, 10 Dec 2022 10:58:27 +0000 (21:58 +1100)] 
Implement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for homed LUKS directories

17 months agorepart: Always derive fs/luks UUIDs from generated partition UUID
Daan De Meyer [Thu, 15 Dec 2022 14:06:40 +0000 (14:06 +0000)] 
repart: Always derive fs/luks UUIDs from generated partition UUID

When generating verity partitions, we only know the partition UUID
of the verity data and hash partition after doing the verity
formatting. This means we can't use the verity partition UUID as
input for deriving the filesystem/luks UUIDs. Currently, we derive
the filesystem/luks UUID from the null UUID instead, which isn't
ideal. Instead, let's always generate a partition UUID and use it
to derive the fs/luks UUIDs, but only use it as the actual partition
UUID if we're not doing verity for the partition.

17 months agopcrphase: gracefully exit if TPM2 support is incomplete
Lennart Poettering [Thu, 15 Dec 2022 17:07:20 +0000 (18:07 +0100)] 
pcrphase: gracefully exit if TPM2 support is incomplete

If everything points to the fact that TPM2 should work, but then the
driver fails to initialize we should handle this gracefully and not
cause failing services all over the place.

Fixes: #25700
17 months agotest: show and check almost all journal entries since the relevant command being...
Yu Watanabe [Thu, 15 Dec 2022 16:11:39 +0000 (01:11 +0900)] 
test: show and check almost all journal entries since the relevant command being invoked

For some reasons, journal timestamps from other sources sometimes
inconsistent. For example,
```
$ journalctl --file system.journal -o short-monotonic -u resmontest.service
[ 1112.168109] ns1.unsigned.test resolvectl[419]: → Q: ns1.unsigned.test IN AAAA
[ 1112.168109] ns1.unsigned.test resolvectl[419]: ← S: success
[ 1112.168109] ns1.unsigned.test resolvectl[419]: → Q: ns1.unsigned.test IN A
[ 1112.168109] ns1.unsigned.test resolvectl[419]: ← S: success
[ 1112.168109] ns1.unsigned.test resolvectl[419]: ← A: ns1.unsigned.test IN A 10.0.0.1
[ 1112.171961] ns1.unsigned.test systemd[1]: resmontest.service: Failed to load configuration: No such file or directory
[ 1112.172223] ns1.unsigned.test systemd[1]: resmontest.service: Trying to enqueue job resmontest.service/start/fail
[ 1112.179866] ns1.unsigned.test systemd[1]: resmontest.service: Installed new job resmontest.service/start as 312
[ 1112.179894] ns1.unsigned.test systemd[1]: resmontest.service: Enqueued job resmontest.service/start as 312
[ 1112.180389] ns1.unsigned.test systemd[1]: resmontest.service: Will spawn child (service_enter_start): /usr/bin/resolvectl
[ 1112.180418] ns1.unsigned.test systemd[1]: resmontest.service: Passing 0 fds to service
[ 1112.180447] ns1.unsigned.test systemd[1]: resmontest.service: About to execute /usr/bin/resolvectl monitor
[ 1112.180477] ns1.unsigned.test systemd[1]: resmontest.service: Forked /usr/bin/resolvectl as 419
[ 1112.180619] ns1.unsigned.test systemd[1]: resmontest.service: Changed dead -> start
[ 1112.180651] ns1.unsigned.test systemd[1]: Starting resmontest.service...
[ 1112.180799] ns1.unsigned.test systemd[419]: resmontest.service: Kernel keyring access prohibited, ignoring.
[ 1112.180895] ns1.unsigned.test systemd[419]: resmontest.service: Executing: /usr/bin/resolvectl monitor
[ 1112.181383] ns1.unsigned.test systemd[1]: resmontest.service: Got notification message from PID 419 (READY=1)
[ 1112.181413] ns1.unsigned.test systemd[1]: resmontest.service: Changed start -> running
[ 1112.181441] ns1.unsigned.test systemd[1]: resmontest.service: Job 312 resmontest.service/start finished, result=done
[ 1112.181469] ns1.unsigned.test systemd[1]: Started resmontest.service.
```
In such case, `journalctl -f` may not show the entries what we are interested in.

Fixes #25749. (At least, workarond for the issue.)

17 months agonetwork: wifi: check SSID when AP interfaces go up
Alvin Šipraga [Wed, 7 Dec 2022 15:43:06 +0000 (16:43 +0100)] 
network: wifi: check SSID when AP interfaces go up

When an AP goes up, the kernel may emit a netlink event indicating that
the interface has gained carrier. In that event, we should check if the
SSID has changed before attempting to reconfigure. Not doing so means
that the link->ssid member is not updated, leading to a potential
mismatch if some of the .network configurations match on SSID=.

There are however scenarios where the above heuristic is not enough.
Specifically, if the interface carrier state flip-flops within a short
enough interval, the internal throttling of netlink events inside the
kernel may suppress intermediate linkdown+linkup events (cf. Linux
net/core/link_watch.c). So there is no linkup event to react on.

To improve on the latter scenario, it is proposed to make newer kernels
emit an NL80211_CMD_START_AP multicast event when an AP goes up. This
event will not be dropped by link_watch. systemd-networkd can then react
to such events as well, and optionally reconfigure the link if the SSID
has changed. This will only work with newer kernels though.

17 months agocore/unit: fix log message 25387/head
Yu Watanabe [Tue, 15 Nov 2022 13:59:01 +0000 (22:59 +0900)] 
core/unit: fix log message

As you can see in the below, the dropped dependency Before=issue-24990.service
is not logged, but the dependency Before=test1.service which is not owned by
the units generated by the TEST-26 is logged.

Before:
systemd[1]: issue-24990.service: Dependency After=test1.service dropped, merged into issue-24990.service
systemd[1]: issue-24990.service: Dependency Before=test1.service dropped, merged into issue-24990.service

After:
systemd[1]: issue-24990.service: Dependency After=test1.service is dropped, as test1.service is merged into issue-24990.service.
systemd[1]: issue-24990.service: Dependency Before=issue-24990.service in test1.service is dropped, as test1.service is merged into issue-24990.service.

17 months agoman: add two signature key example to systemd-measure
Lennart Poettering [Thu, 15 Dec 2022 13:48:08 +0000 (14:48 +0100)] 
man: add two signature key example to systemd-measure

@keszybz asked for an example with --append= used in the systemd-measure
man page. Here it is.

As requested: https://github.com/systemd/systemd/pull/25224#pullrequestreview-1190709772

17 months agosystemctl: don't unlink non-existing temporary files 25487/head
Lennart Poettering [Thu, 24 Nov 2022 13:59:25 +0000 (14:59 +0100)] 
systemctl: don't unlink non-existing temporary files

17 months agosystemctl: if we edit a single file only, jump to the right line
Lennart Poettering [Tue, 22 Nov 2022 16:14:51 +0000 (17:14 +0100)] 
systemctl: if we edit a single file only, jump to the right line

17 months agosystemctl: stop using basename() at one more place
Lennart Poettering [Tue, 22 Nov 2022 17:46:20 +0000 (18:46 +0100)] 
systemctl: stop using basename() at one more place

17 months agosystemctl: line break string where the newlines are
Lennart Poettering [Tue, 22 Nov 2022 17:46:01 +0000 (18:46 +0100)] 
systemctl: line break string where the newlines are

17 months agosystemctl: minor modernizations/simplifications
Lennart Poettering [Tue, 22 Nov 2022 16:13:36 +0000 (17:13 +0100)] 
systemctl: minor modernizations/simplifications

17 months agosystemctl: simplify trim_edit_markers()
Lennart Poettering [Tue, 22 Nov 2022 15:22:41 +0000 (16:22 +0100)] 
systemctl: simplify trim_edit_markers()

This is not performance sensitive, don#t try to be smart with realloc()

Follow-up for: #25305
Fixes: #25303
17 months agotest: fix typo
Yu Watanabe [Thu, 15 Dec 2022 16:38:08 +0000 (01:38 +0900)] 
test: fix typo

17 months agoMerge pull request #25756 from yuwata/test-resolve-1
Yu Watanabe [Thu, 15 Dec 2022 15:53:52 +0000 (00:53 +0900)] 
Merge pull request #25756 from yuwata/test-resolve-1

test: several cleanups for TEST-75-RESOLVE

17 months agoMerge pull request #25718 from yuwata/locale-cleanups
Yu Watanabe [Thu, 15 Dec 2022 15:51:13 +0000 (00:51 +0900)] 
Merge pull request #25718 from yuwata/locale-cleanups

locale: avoid TOCTOU in reading config files

17 months agotest-network: add a test for renaming device to current altname 25221/head
Nick Rosbrook [Wed, 7 Dec 2022 17:28:28 +0000 (12:28 -0500)] 
test-network: add a test for renaming device to current altname

17 months agomkosi: work around a file conflict between systemd and systemd-boot
Frantisek Sumsal [Thu, 15 Dec 2022 12:52:52 +0000 (13:52 +0100)] 
mkosi: work around a file conflict between systemd and systemd-boot

17 months agorepart: Use "defer" in docs instead of "skip"
Daan De Meyer [Thu, 15 Dec 2022 14:27:08 +0000 (14:27 +0000)] 
repart: Use "defer" in docs instead of "skip"

17 months agosd-netlink: add a test for rtnl_set_link_name()
Nick Rosbrook [Tue, 22 Nov 2022 22:01:47 +0000 (17:01 -0500)] 
sd-netlink: add a test for rtnl_set_link_name()

Add a test that verifies a deleted alternative name is restored on error
in rtnl_set_link_name().

17 months agoudev: attempt device rename even if interface is up
Nick Rosbrook [Fri, 2 Dec 2022 20:35:25 +0000 (15:35 -0500)] 
udev: attempt device rename even if interface is up

Currently rename_netif() will not attempt to rename a device if it is
already up, because the kernel will return -EBUSY unless live renaming
is allowed on the device. This restriction will be removed in a future
kernel version [1].

To cover both cases, always attempt to rename the interface and return 0
if we get -EBUSY.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=bd039b5ea2a9

17 months agosd-netlink: restore altname on error in rtnl_set_link_name
Nick Rosbrook [Wed, 2 Nov 2022 09:36:14 +0000 (05:36 -0400)] 
sd-netlink: restore altname on error in rtnl_set_link_name

If a current alternative name is to be used to rename a network
interface, the alternative name must be removed first. If interface
renaming fails, restore the alternative name that was deleted if
necessary.

17 months agoManager: also log caller of daemon-reexec
Luca Boccassi [Thu, 15 Dec 2022 12:20:28 +0000 (12:20 +0000)] 
Manager: also log caller of daemon-reexec

17 months agosd-netlink: do not swap old name and alternative name
Nick Rosbrook [Fri, 2 Dec 2022 20:26:18 +0000 (15:26 -0500)] 
sd-netlink: do not swap old name and alternative name

Commit 434a348380 ("netlink: do not fail when new interface name is
already used as an alternative name") added logic to set the old
interface name as an alternative name, but only when the new name is
currently an alternative name. This is not the desired outcome in most
cases, and the important part of this commit was to delete the new name
from the list of alternative names if necessary.

17 months agoudev/net: allow new link name as an altname before renaming happens
Nick Rosbrook [Wed, 2 Nov 2022 15:05:01 +0000 (11:05 -0400)] 
udev/net: allow new link name as an altname before renaming happens

When configuring a link's alternative names, the link's new name to-be
is not allowed to be included because interface renaming will fail if
the new name is already present as an alternative name. However,
rtnl_set_link_name will delete the conflicting alternative name before
renaming the device, if necessary.

Allow the new link name to be set as an alternative name before the
device is renamed. This means that if the rename is later skipped (i.e.
because the link is already up), then the name can at least still be
present as an alternative name.

17 months agoMerge pull request #24058 from qdeslandes/journald_regex_filtering
Yu Watanabe [Thu, 15 Dec 2022 13:03:33 +0000 (22:03 +0900)] 
Merge pull request #24058 from qdeslandes/journald_regex_filtering

Allow for journald logs filtering on a per-unit basis

17 months agoRevert "test: wait for the monitoring service to become active" 25756/head
Yu Watanabe [Thu, 15 Dec 2022 07:28:52 +0000 (16:28 +0900)] 
Revert "test: wait for the monitoring service to become active"

This reverts commit 5dd34c2604567320707625bc009cf01c3769605f.

`resolvectl monitor` sends notify event, and systemd-run wait for the
service being in active state. Hence, the loop is not necessary.

17 months agotest: suppress echo in monitor_check_rr()
Yu Watanabe [Thu, 15 Dec 2022 06:28:56 +0000 (15:28 +0900)] 
test: suppress echo in monitor_check_rr()

17 months agopackit: drop/replace deprecated directives
Frantisek Sumsal [Thu, 15 Dec 2022 12:14:30 +0000 (13:14 +0100)] 
packit: drop/replace deprecated directives

17 months agorepart: Fix integration test
Daan De Meyer [Thu, 15 Dec 2022 12:01:35 +0000 (12:01 +0000)] 
repart: Fix integration test

17 months agoMerge pull request #25224 from poettering/measure-append
Yu Watanabe [Thu, 15 Dec 2022 12:47:29 +0000 (21:47 +0900)] 
Merge pull request #25224 from poettering/measure-append

add --append= switch to systemd-measure

17 months agoMerge pull request #25735 from yuwata/switch-root-follow-ups
Yu Watanabe [Thu, 15 Dec 2022 12:39:40 +0000 (21:39 +0900)] 
Merge pull request #25735 from yuwata/switch-root-follow-ups

mount-util: several follow-ups for recent mount_switch_root() changes

17 months agohwdb: Fix mount matrix for CSL Panther Tab HD (#25752)
mvzlb [Thu, 15 Dec 2022 10:59:14 +0000 (11:59 +0100)] 
hwdb: Fix mount matrix for CSL Panther Tab HD (#25752)

Commit a76d7aca sets ACCEL_MOUNT_MATRIX to match the device's casing
(landscape) instead of the LCD panel (portrait).

17 months agoupdate TODO 25224/head
Lennart Poettering [Tue, 1 Nov 2022 14:10:47 +0000 (15:10 +0100)] 
update TODO

17 months agotest: add integration test for systemd-measure --append=
Lennart Poettering [Thu, 15 Dec 2022 10:39:33 +0000 (11:39 +0100)] 
test: add integration test for systemd-measure --append=

17 months agomeasure: add --append= switch for merging signatures
Lennart Poettering [Tue, 1 Nov 2022 13:54:47 +0000 (14:54 +0100)] 
measure: add --append= switch for merging signatures

Often it's useful to add multiple signatures in the signature JSON file
to embedd in a single .pcrsig. (For example, a signature by key X for
boot phase "enter-initrd" and one by key Y for
"enter-initrd:leave-initrd" or so). Make this easy, by adding the
ability to append signatures to a previously generated JSON file.

17 months agojson: add helper for adding variant to array suppressing duplicates
Lennart Poettering [Tue, 1 Nov 2022 13:56:44 +0000 (14:56 +0100)] 
json: add helper for adding variant to array suppressing duplicates

17 months agojournal: add integration tests for log filtering 24058/head
Quentin Deslandes [Tue, 13 Sep 2022 15:12:36 +0000 (16:12 +0100)] 
journal: add integration tests for log filtering

Add integration tests for journald's log filtering feature.

17 months agojournal: filter log based on LogFilterPatterns
Quentin Deslandes [Tue, 13 Sep 2022 15:15:13 +0000 (16:15 +0100)] 
journal: filter log based on LogFilterPatterns

Use LogFilterPatterns from the unit's cgroup xattr in order to keep or
discard log messages before writing them to the journal.
When a log message is discarded, it won't be written to syslog, console...
either.

When a native, syslog, or standard output log message is received,
systemd-journald will process it if it matches against at least one
allowed pattern (if any) and none of the denied patterns (if any).

17 months agoCreate hash_ops structure to free keys of type pcre2_code
Quentin Deslandes [Tue, 13 Sep 2022 15:14:52 +0000 (16:14 +0100)] 
Create hash_ops structure to free keys of type pcre2_code

17 months agosystemctl: add support for LogFilterPatterns for show command
Quentin Deslandes [Wed, 14 Sep 2022 17:17:19 +0000 (18:17 +0100)] 
systemctl: add support for LogFilterPatterns for show command

Parse DBus structure send by LogFilterPatterns to print it in systemctl
show.

17 months agojournal: log filtering options support in PID1
Quentin Deslandes [Mon, 7 Nov 2022 19:30:01 +0000 (20:30 +0100)] 
journal: log filtering options support in PID1

Define new unit parameter (LogFilterPatterns) to filter logs processed by
journald.

This option is used to store a regular expression which is carried from
PID1 to systemd-journald through a cgroup xattrs:
`user.journald_log_filter_patterns`.

17 months agoset: add set_make_nulstr
Quentin Deslandes [Mon, 7 Nov 2022 19:25:46 +0000 (20:25 +0100)] 
set: add set_make_nulstr

Add function set_make_nulstr() to create a nulstr out of a set. Behave
the same way as strv_make_nulstr().

17 months agoMerge pull request #25350 from poettering/efi-guid-equal
Lennart Poettering [Thu, 15 Dec 2022 09:24:58 +0000 (10:24 +0100)] 
Merge pull request #25350 from poettering/efi-guid-equal

efi: add efi_guid_equal() helper

17 months agoMerge pull request #25602 from fbuihuu/fix-TEST-73-LOCALE
Yu Watanabe [Thu, 15 Dec 2022 08:47:05 +0000 (17:47 +0900)] 
Merge pull request #25602 from fbuihuu/fix-TEST-73-LOCALE

localed: reload PID1 configuration after modifying /etc/locale.conf

17 months agorepart: Rework Minimize= option settings
Daan De Meyer [Tue, 13 Dec 2022 18:52:18 +0000 (18:52 +0000)] 
repart: Rework Minimize= option settings

Instead of having Minimize= take a boolean let's allow for two
different ways to enable it. "best" means we want the most minimal
image possible, which currently is only possible for read-only
filesystems but can be extended in the future with bisection
to find the most minimal possible size.

We also add "guess", which is the current behavior, where we
populate once and use the sparse size to make a reasonable guess
on a size that fits all the sources without needing to O(log(n))
tries to find the most minimal size.

17 months agomount-util: make mount_switch_root() take a mount propagation flag 25735/head
Yu Watanabe [Wed, 14 Dec 2022 06:38:54 +0000 (15:38 +0900)] 
mount-util: make mount_switch_root() take a mount propagation flag

17 months agomountpoint-util: introduce mount_propagation_flag_is_valid()
Yu Watanabe [Wed, 14 Dec 2022 17:48:59 +0000 (02:48 +0900)] 
mountpoint-util: introduce mount_propagation_flag_is_valid()

17 months agomountpoint-util: rename mount_propagation_flags_to_string() and friends as singular
Yu Watanabe [Wed, 14 Dec 2022 08:52:31 +0000 (17:52 +0900)] 
mountpoint-util: rename mount_propagation_flags_to_string() and friends as singular

17 months agomount-util: mount flag is unsigned long
Yu Watanabe [Wed, 14 Dec 2022 05:58:48 +0000 (14:58 +0900)] 
mount-util: mount flag is unsigned long

17 months agomount-util: drop unnecessary inline attributes
Yu Watanabe [Wed, 14 Dec 2022 06:40:02 +0000 (15:40 +0900)] 
mount-util: drop unnecessary inline attributes

17 months agoMerge pull request #25743 from yuwata/timesync-ipv6
Yu Watanabe [Thu, 15 Dec 2022 03:57:54 +0000 (12:57 +0900)] 
Merge pull request #25743 from yuwata/timesync-ipv6

timesync: ignore IPv6 addresses when the kernel does not support it

17 months agobasic: do not output emojis if not on a proper terminal
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2022 14:39:26 +0000 (15:39 +0100)] 
basic: do not output emojis if not on a proper terminal

$TERM would generally be set if we're connected to a proper graphical terminal
emulator. In all other cases, in particular if $TERM is not set, we almost
certainly are not connected to something that can output emojis. In particular
the text console is unlikely to ever do it correctly.

So let's invert the check, and only write emojis if $TERM is set.

Fixes #25521.

17 months agoMerge pull request #25732 from enr0n/unit-test-machine-id-initialized
Yu Watanabe [Thu, 15 Dec 2022 03:55:04 +0000 (12:55 +0900)] 
Merge pull request #25732 from enr0n/unit-test-machine-id-initialized

unit tests: do not fail when `/etc/machine-id` is empty

17 months agoMerge pull request #25723 from keszybz/generators-tmp
Yu Watanabe [Thu, 15 Dec 2022 03:53:49 +0000 (12:53 +0900)] 
Merge pull request #25723 from keszybz/generators-tmp

Run generators with / ro and /tmp mounted

17 months agoMerge pull request #25693 from yuwata/binfmt
Yu Watanabe [Thu, 15 Dec 2022 03:52:30 +0000 (12:52 +0900)] 
Merge pull request #25693 from yuwata/binfmt

binfmt: several cleanups

17 months agopam: actually align the columns
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2022 21:23:31 +0000 (22:23 +0100)] 
pam: actually align the columns

In 9efb224443d819b7d64ec76cb94c8aa625a8abf2 was supposed to align
them, but for some reason I just added a second space everywhere.

17 months agosystemctl: is-enabled: document the return code change
Mike Yuan [Wed, 14 Dec 2022 16:50:19 +0000 (00:50 +0800)] 
systemctl: is-enabled: document the return code change

Follow-up for #25689

We've added a new output ("not-found") in #25689.

17 months agofstab-generator: use log message that matches reality 25723/head
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 13:38:06 +0000 (14:38 +0100)] 
fstab-generator: use log message that matches reality

We *assume* that when /sys is read-only, we're running in a container. But
there can other reasons, for example root is mount ro and nobody has mounted
/sys yet, or somebody forgot to add /sys to the list of filesystem not to
remount ro in a sandbox. So let's actually say what we know instead of assuming.

systemd-fstab-generator was reporting that it's running in a container and I
spent a good few minutes trying to figure out why 'systemd-detect-virt -c'
disagrees, before noticing that it's just checking a different condition.