]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agomanager: pass monitor metadata in more cases 22460/head
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 09:49:26 +0000 (10:49 +0100)] 
manager: pass monitor metadata in more cases

The first ExecStartPre or the first ExecStart commands would get the metadata,
but not the subsequent ones. Also check that we do not pass it in
ExecStartPost.

2 years agomanager: prevent cleanup of triggering units before we start the handler
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 12:09:06 +0000 (13:09 +0100)] 
manager: prevent cleanup of triggering units before we start the handler

This fixes the following case:
OnFailure= would be spawned correctly, but OnSuccess= would be
spawned without the MONITOR_* metadata, because we'd "collect" the unit
that started successfully. So let's block cleanup while we have a job
running for the handler. The job cannot last infinitely, so at some point
we'll be able to collect both.

2 years agomanager/service: when we have multiple candidates to handle, warn
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 12:05:50 +0000 (13:05 +0100)] 
manager/service: when we have multiple candidates to handle, warn

This would be very confusing to users, so let's warn if they configured the
same handler for multiple units and we're not running it as expected.

2 years agomanager/service: when we spawn, say why
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 10:59:48 +0000 (11:59 +0100)] 
manager/service: when we spawn, say why

We already logged what we are spawning, but not so much why. Let's
add this, so it's easier to distinguish execstartpre/execstart/execstartpost
and such.

2 years agomanager: log how many OnSuccess/OnFailure jobs were started
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 10:33:07 +0000 (11:33 +0100)] 
manager: log how many OnSuccess/OnFailure jobs were started

2 years agomanager: adjust comment
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 10:33:28 +0000 (11:33 +0100)] 
manager: adjust comment

2 years agovarious: align vertically for ease of reading
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 12:03:31 +0000 (13:03 +0100)] 
various: align vertically for ease of reading

2 years agoTEST-68: enhance testing of chained commands
Zbigniew Jędrzejewski-Szmek [Thu, 10 Mar 2022 14:47:41 +0000 (14:47 +0000)] 
TEST-68: enhance testing of chained commands

The test would fail when the the same handler was used for multiple
*failing* units. We need to call 'reset-failed' to let the manager forget
about the earlier ones.

systemd-analyze log-target console is removed, because it's easier to follow
the logs if logging it to the journal.

2 years agoTEST-68-PROPAGATE-EXIT-STATUS: deobfuscate shell code and fix typo
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 09:07:23 +0000 (10:07 +0100)] 
TEST-68-PROPAGATE-EXIT-STATUS: deobfuscate shell code and fix typo

After the cleanup, it was fairly easy to see the wrong variable name ;)

2 years agoNEWS: note backward-incompatible MONITOR_METADATA change
Luca Boccassi [Wed, 9 Feb 2022 11:58:30 +0000 (11:58 +0000)] 
NEWS: note backward-incompatible MONITOR_METADATA change

2 years agotest: cover template OnFailure/OnSuccess handlers in TEST-68-PROPAGATE-EXIT-STATUS
Luca Boccassi [Wed, 9 Feb 2022 11:50:19 +0000 (11:50 +0000)] 
test: cover template OnFailure/OnSuccess handlers in TEST-68-PROPAGATE-EXIT-STATUS

2 years agocore: split $MONITOR_METADATA and return it only if a single unit triggers OnFailure...
Luca Boccassi [Wed, 9 Feb 2022 11:48:30 +0000 (11:48 +0000)] 
core: split $MONITOR_METADATA and return it only if a single unit triggers OnFailure/OnSuccess

Remove the list logic, and simply skip passing metadata if more than one
unit triggered an OnFailure/OnSuccess handler.
Instead of a single env var to loop over, provide each separate item
as its own variable.

Fixes https://github.com/systemd/systemd/issues/22370

2 years agoMerge pull request #22685 from bluca/user_root_dir
Luca Boccassi [Thu, 10 Mar 2022 13:12:19 +0000 (13:12 +0000)] 
Merge pull request #22685 from bluca/user_root_dir

core: support MountAPIVFS and RootDirectory in user manager

2 years agoMerge pull request #22595 from poettering/logind-action-refact
Yu Watanabe [Thu, 10 Mar 2022 11:56:15 +0000 (20:56 +0900)] 
Merge pull request #22595 from poettering/logind-action-refact

logind: some minor refactoring around logind's HandleAction logic

2 years agocore: support MountAPIVFS and RootDirectory in user manager 22685/head
Luca Boccassi [Wed, 9 Mar 2022 02:07:34 +0000 (02:07 +0000)] 
core: support MountAPIVFS and RootDirectory in user manager

The only piece missing was to somehow make /proc appear in the
new user+mount namespace. It is not possible to mount a new
/proc instance, not even with hidepid=invisible,subset=pid, in
a user namespace unless a PID namespace is created too (and also
at the same time as the other namespaces, it is not possible to
mount a new /proc in a child process that creates a PID namespace
forked from a parent that created a user+mount namespace, it has
to happen at the same time).

Use the host's /proc with a bind-mount as a fallback for this
case. User session services would already run with it, so
nothing is lost.

2 years agomain: drop get_process_cmdline from crash handler
licunlong [Thu, 10 Mar 2022 01:22:29 +0000 (09:22 +0800)] 
main: drop get_process_cmdline from crash handler
get_process_cmdline calls malloc, which should be avoid in signal handler.

Fixes: #22690
2 years agopo: Translated using Weblate (Georgian)
Temuri Doghonadze [Wed, 9 Mar 2022 13:25:27 +0000 (14:25 +0100)] 
po: Translated using Weblate (Georgian)

Currently translated at 23.2% (44 of 189 strings)

po: Added translation using Weblate (Georgian)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ka/
Translation: systemd/main

2 years agologind: rename scheduled_shutdown_type → scheduled_shutdown_action 22595/head
Lennart Poettering [Tue, 22 Feb 2022 12:28:24 +0000 (13:28 +0100)] 
logind: rename scheduled_shutdown_type → scheduled_shutdown_action

This matches naming of the 'delayed_action' field we already have. It's
similar in both type and concept, and hence should be named similarly.

2 years agologind: rename manager_item_for_handle() → handle_action_lookup()
Lennart Poettering [Tue, 22 Feb 2022 12:26:31 +0000 (13:26 +0100)] 
logind: rename manager_item_for_handle() → handle_action_lookup()

The function has nothing to do with any Manager object, hence drop that
from the name. And it actually looks something up by handle *action* not
by *handle*, hence the old name was a bit misnomer. Let's call it
handle_action_lookup(), as it queries handle action metainfo for a
handle action.

Also, let's make sure it behaves more like our usual functions that
lookup some fixed data from some enum value/int: let's return NULL if we
don't find it.

2 years agologind: drop unused prototype
Lennart Poettering [Tue, 22 Feb 2022 12:24:40 +0000 (13:24 +0100)] 
logind: drop unused prototype

2 years agologind: minor whitespace fix
Lennart Poettering [Tue, 22 Feb 2022 12:23:52 +0000 (13:23 +0100)] 
logind: minor whitespace fix

2 years agologind: rename ActionTableItem → HandleActionData
Lennart Poettering [Tue, 22 Feb 2022 12:19:44 +0000 (13:19 +0100)] 
logind: rename ActionTableItem → HandleActionData

It stores meta-info about various HandleActions, hence let's name it
after that. The fact that it can be seen as stored inside some form of a
table is an implementation detail of logind-action.c, and should not
leak into other modules, hence let's focus on what it is, not how it is
stored.

2 years agologind: replace handle_action_valid() macro by inline function
Lennart Poettering [Tue, 22 Feb 2022 12:05:16 +0000 (13:05 +0100)] 
logind: replace handle_action_valid() macro by inline function

The old macro will double evaluation and has no protection against
operator precedence issues. Let's fix that by using an inline func
instead, which also gives us typesafety.

2 years agoupdate TODO
Lennart Poettering [Wed, 9 Mar 2022 13:25:43 +0000 (14:25 +0100)] 
update TODO

2 years agorandom-util: unify RANDOM_ALLOW_INSECURE and !RANDOM_BLOCK and simplify
Jason A. Donenfeld [Mon, 7 Mar 2022 04:36:19 +0000 (21:36 -0700)] 
random-util: unify RANDOM_ALLOW_INSECURE and !RANDOM_BLOCK and simplify

RANDOM_BLOCK has existed for a long time, but RANDOM_ALLOW_INSECURE was
added more recently, leading to an awkward relationship between the two.
It turns out that only one, RANDOM_BLOCK, is needed.

RANDOM_BLOCK means return cryptographically secure numbers no matter
what. If it's not set, it means try to do that, but if it fails, fall
back to using unseeded randomness.

This part of falling back to unseeded randomness is the intent of
GRND_INSECURE, which is what RANDOM_ALLOW_INSECURE previously aliased.
Rather than having an additional flag for that, it makes more sense to
just use it whenever RANDOM_BLOCK is not set. This saves us the overhead
of having to open up /dev/urandom.

Additionally, when getrandom returns too little data, but not zero data,
we currently fall back to using /dev/urandom if RANDOM_BLOCK is not set.
This doesn't quite make sense, because if getrandom returned seeded data
once, then it will forever after return the same thing as whatever
/dev/urandom does. So in that case, we should just loop again.

Since there's never really a time where /dev/urandom is able to return
some easily but more with difficulty, we can also get rid of
RANDOM_EXTEND_WITH_PSEUDO. Once the RNG is initialized, bytes
should just flow normally.

This also makes RANDOM_MAY_FAIL obsolete, because the only case this ran
was where we'd fall back to /dev/urandom on old kernels and return
GRND_INSECURE bytes on new kernels. So also get rid of that flag.

Finally, since we're always able to use GRND_INSECURE on newer kernels,
and we only fall back to /dev/urandom on older kernels, also only fall
back to using RDRAND on those older kernels. There, the only reason to
have RDRAND is to avoid a kmsg entry about unseeded randomness.

The result of this commit is that we now cascade like this:

  - Use getrandom(0) if RANDOM_BLOCK.
  - Use getrandom(GRND_INSECURE) if !RANDOM_BLOCK.
  - Use /dev/urandom if !RANDOM_BLOCK and no GRND_INSECURE support.
  - Use /dev/urandom if no getrandom() support.
  - Use RDRAND if we would use /dev/urandom for any of the above reasons
    and RANDOM_ALLOW_RDRAND is set.

2 years agoPackit: build SRPMs in Copr
Laura Barcziova [Wed, 9 Mar 2022 06:50:29 +0000 (07:50 +0100)] 
Packit: build SRPMs in Copr

Add srpm_build_deps key to the Packit config to specify needed dependencies for SRPM build
and indicate to build SRPM in Copr.

2 years agotest: set log level of user manager in TEST-43 to debug
Luca Boccassi [Wed, 9 Mar 2022 02:08:15 +0000 (02:08 +0000)] 
test: set log level of user manager in TEST-43 to debug

2 years agocore: create parent directory for mount point of ExtensionDirectories
Luca Boccassi [Wed, 9 Mar 2022 02:02:17 +0000 (02:02 +0000)] 
core: create parent directory for mount point of ExtensionDirectories

This is used by ExtensionDirectories too, as they are bind-mounted in the
propagate directory to check the extension-release files

2 years agotest: skip TEST-17 on ubuntu ppc64el
Yu Watanabe [Tue, 8 Mar 2022 12:15:58 +0000 (21:15 +0900)] 
test: skip TEST-17 on ubuntu ppc64el

On Ubuntu CI on ppc64el, the test randomly fails when /run/udev is not
synced before checking its contents (see #22357). But /run/udev is a
tmpfs and fsync on tmpfs is noop (see `struct shmem_file_operations` in
mm/shmem.c of the kernel), hence, it is not necessary to call fsync on
/run/udev in general. This should be a testing emvironment issue (I
guess it is an issue on nested KVM on ppc64el), instead of an issue on
udev.

C.f. #22357.

Fixes #21603.

2 years agomain: log which process send SIGNAL to PID1
licunlong [Tue, 8 Mar 2022 11:18:36 +0000 (19:18 +0800)] 
main: log which process send SIGNAL to PID1
This can help users to figure out what makes systemd freeze.
1. Someone kills systemd accidentally, then the sender_pid won't be 1;
2. systemd triggers segfault or assert, then the sender_pid will be 1;

2 years agocore: manage SetShowStatus through polkit
Zbigniew Jędrzejewski-Szmek [Mon, 7 Mar 2022 18:22:26 +0000 (19:22 +0100)] 
core: manage SetShowStatus through polkit

When writing docs for SD_BUS_VTABLE_CAPABILITY, I noticed that we have one use
of SD_BUS_VTABLE_CAPABILITY(CAP_SYS_ADMIN) in the tree. This is the default, so
it's not very useful to specify it. But if we're touching that, I think it's
better to use mac + polkit for this like for everything else.

We don't have a very good category for this, but I don't think it makes sense
to add a new one. I just reused the same as other similar calls.

2 years agoudev: 60-persistent-storage-tape.rules: handle duplicate device ID
David Bond [Tue, 8 Mar 2022 09:41:39 +0000 (10:41 +0100)] 
udev: 60-persistent-storage-tape.rules: handle duplicate device ID

Some SCSI tape devices use the same device ID (NAA registered device
designator) for the SCSI tape changer device and the first actual tape
device. For example, this one:

https://docs.oracle.com/en/storage/tape-storage/storagetek-sl150-modular-tape-library/slofs/bridged-tape-drives.html

   You must connect the bridged drive to an HBA supporting multiple
   LUNs (also referred to as LUN scanning). The SL150 Library uses a
   single SCSI ID and two logical unit numbers (LUN). LUN 0 controls
   the tape drive and LUN 1 which is configured as a SCSI medium
   changer device controls the robotics. Data is sent to the remaining
   LUN on the bridged drive or to LUNs on the other, unbridged drives
   in the partition, all of which are configured as SCSI
   sequential-access (tape) devices.

This may lead to errors because /dev/tape/by-id symlinks may sometimes
point to the st device representing the tape, and sometimes to the sg
device representing the changer.

Fix this by assigning an increased priority to the tape device, and creating
a separate -changer link for the SCSI tape changer.

Co-developed-by: Martin Wilck <mwilck@suse.com>
2 years agoFix mic mute on Acer TravelMate B311-31 (#22677)
tawefogo [Tue, 8 Mar 2022 14:10:51 +0000 (15:10 +0100)] 
Fix mic mute on Acer TravelMate B311-31 (#22677)

2 years agoMerge pull request #22656 from keszybz/portablectl-method2
Zbigniew Jędrzejewski-Szmek [Tue, 8 Mar 2022 12:26:33 +0000 (13:26 +0100)] 
Merge pull request #22656 from keszybz/portablectl-method2

portable: add return parameter to GetImageMetadataWithExtensions

2 years agoTEST-29: do not pass -q to mk/unsquashfs, not supported on CentOS 8
Luca Boccassi [Mon, 7 Mar 2022 16:20:42 +0000 (16:20 +0000)] 
TEST-29: do not pass -q to mk/unsquashfs, not supported on CentOS 8

2 years agologind: use mfree instead of freep
Ludwig Nussel [Mon, 7 Mar 2022 12:33:59 +0000 (13:33 +0100)] 
logind: use mfree instead of freep

2 years agoci: make the concurrency group identifier unique once again
Frantisek Sumsal [Mon, 7 Mar 2022 15:18:42 +0000 (16:18 +0100)] 
ci: make the concurrency group identifier unique once again

Otherwise we end up randomly cancelling once of the two centos_epel
jobs.

Follow-up to da637c8fcad1baa530578982d41a6ecb1440f7c5.

2 years agoTEST-29: do not pass -q to mk/unsquashfs, not supported on CentOS 8 22656/head
Luca Boccassi [Mon, 7 Mar 2022 16:20:42 +0000 (16:20 +0000)] 
TEST-29: do not pass -q to mk/unsquashfs, not supported on CentOS 8

2 years agomemory-id: Work-around incorrect "Number of slots"
Bastien Nocera [Mon, 7 Mar 2022 09:11:12 +0000 (10:11 +0100)] 
memory-id: Work-around incorrect "Number of slots"

In some BIOSes, the "Number of slots or sockets available for Memory
Devices in this array" is incorrectly set to the number of memory array
that's populated.

Work-around this problem by outputting the number of sockets after
having parsed them so that consumers of this data can carry on expecting
an accurate number in this property.

This fixes the number of memory slots advertised for the HP Z600.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1686

2 years agoNEWS: note GetMetadataWithExtensions backward incompatible change
Luca Boccassi [Mon, 7 Mar 2022 13:50:32 +0000 (13:50 +0000)] 
NEWS: note GetMetadataWithExtensions backward incompatible change

2 years agoportable: add return parameter to GetImageMetadataWithExtensions
Zbigniew Jędrzejewski-Szmek [Thu, 3 Mar 2022 15:26:36 +0000 (16:26 +0100)] 
portable: add return parameter to GetImageMetadataWithExtensions

The complaint was that the output array was used for two kinds of data, and the
input flag decided whether this extra data should be included. The flag is
removed, and instead the old method is changed to include the data always as
a separate parameter.

This breaks backward compatibility, but  the old method is effectively broken
and does not appear to be used yet, at least in open source code, by
searching on codesearch.debian.net and github.com.

Fixes #22404.

Co-authored-by: Luca Boccassi <bluca@debian.org>
2 years agomkosi: Add CentOS Stream 9
Daan De Meyer [Mon, 28 Feb 2022 10:12:04 +0000 (10:12 +0000)] 
mkosi: Add CentOS Stream 9

The blocker causing Stream 9 builds to fail was fixed
(https://bugzilla.redhat.com/show_bug.cgi?id=2056276) so we can add
CentOS Stream 9 builds as well now.

2 years agodocs: add more links for portabled
Zbigniew Jędrzejewski-Szmek [Thu, 3 Mar 2022 18:54:34 +0000 (19:54 +0100)] 
docs: add more links for portabled

2 years agoportable: inline one variable declaration
Zbigniew Jędrzejewski-Szmek [Thu, 3 Mar 2022 18:13:20 +0000 (19:13 +0100)] 
portable: inline one variable declaration

2 years agoportablectl: reorder if branches to match previous conditional in the same function
Zbigniew Jędrzejewski-Szmek [Thu, 3 Mar 2022 17:56:06 +0000 (18:56 +0100)] 
portablectl: reorder if branches to match previous conditional in the same function

One is a ternary op, the other an normal conditional, but they should still use
the same order of branches.

2 years agoTEST-29: trim output a bit
Zbigniew Jędrzejewski-Szmek [Thu, 3 Mar 2022 17:55:26 +0000 (18:55 +0100)] 
TEST-29: trim output a bit

IIUC, pipefail doesn't matter for a sequence of commands joined with &&, and we
don't have any pipes. And such a failing expression also does not trigger an
exit, so the set +e/set -e were noops.

2 years agoAdd support for NEC VersaPro VG-S
4piu [Mon, 7 Mar 2022 08:38:08 +0000 (16:38 +0800)] 
Add support for NEC VersaPro VG-S

The brightness control key (Fn+F7 Fn+F8) and touchpad toggle key (Fn + Space) do not work on the NEC VersaPro VG-S laptop. Add the keycode to fix the problem.

2 years agotree-wide: fix typo
Yu Watanabe [Mon, 7 Mar 2022 06:32:22 +0000 (15:32 +0900)] 
tree-wide: fix typo

2 years agotest: check systemd RPM macros
Frantisek Sumsal [Thu, 3 Mar 2022 19:30:43 +0000 (20:30 +0100)] 
test: check systemd RPM macros

Make sure our RPM macros work as intended. Based on the original PR
(#16464) by Mikhail Novosyolov.

Co-authored-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
2 years agoMerge pull request #22663 from keszybz/various-man-page-bits
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 17:16:46 +0000 (18:16 +0100)] 
Merge pull request #22663 from keszybz/various-man-page-bits

Various man page bits

2 years agojournalctl: advertise --header a bit more 22663/head
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 15:39:34 +0000 (16:39 +0100)] 
journalctl: advertise --header a bit more

Fixes #2738.

2 years agoman: describe UNIT=/USER_UNIT=
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 15:26:12 +0000 (16:26 +0100)] 
man: describe UNIT=/USER_UNIT=

Fixes 17538.

2 years agoman: tweak description of auto/noauto
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 15:07:19 +0000 (16:07 +0100)] 
man: tweak description of auto/noauto

I think the current behaviour is stupid: 'x-systemd.automount,noauto' should
mean that we create the units, but don't add .mount or .automount to any targets.
Instead, we completely ignore 'noauto'. But let's at least describe the
implementation.

Text suggested by dpartrid in the bug.

Fixes #21040.

2 years agoman: describe capability checks on the bus
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 14:41:31 +0000 (15:41 +0100)] 
man: describe capability checks on the bus

A description of SD_BUS_VTABLE_CAPABILITY is added, and the discussion
on SD_BUS_VTABLE_UNPRIVILEGED in expanded. I think it would be nice
to add longer description of how access is checked (maybe in sd-bus(3)),
but I'm leaving that for later. I think the text that was added here
describes everything, even if tersely.

Fixes #21882.

2 years agoman: fix formatting of macros in sd_bus_add_object
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 14:23:17 +0000 (15:23 +0100)] 
man: fix formatting of macros in sd_bus_add_object

docbook would convert the newline to a space before the first argument:
  SD_BUS_METHOD_WITH_ARGS( member, args, result, handler)

And we need each item in a separate <para>, otherwise they'll all be in
one line.

2 years agoman: say that we ignore ignored options
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 13:13:56 +0000 (14:13 +0100)] 
man: say that we ignore ignored options

Fixes #22057.

2 years agoman: drop outdated info about polkit in pid1
Zbigniew Jędrzejewski-Szmek [Fri, 4 Mar 2022 13:03:50 +0000 (14:03 +0100)] 
man: drop outdated info about polkit in pid1

Fixes #22648.

2 years agodevnode-acl: use _cleanup_ to free acl_t
David Tardon [Thu, 3 Mar 2022 14:58:24 +0000 (15:58 +0100)] 
devnode-acl: use _cleanup_ to free acl_t

2 years agosd-stub: do not print warning if filesystem is not supported
Alfonso Sánchez-Beato [Thu, 3 Mar 2022 10:42:41 +0000 (11:42 +0100)] 
sd-stub: do not print warning if filesystem is not supported

Do not print a warning in case we try to load the file system protocol for an
unsupported file system, just return EFI_SUCCESS instead.

2 years agoMerge pull request #22644 from keszybz/meson-no-split
Zbigniew Jędrzejewski-Szmek [Thu, 3 Mar 2022 22:10:14 +0000 (23:10 +0100)] 
Merge pull request #22644 from keszybz/meson-no-split

Use normal lists in meson instead of splitting on whitespace

2 years agocore: check size before mmap
Tobias Stoeckmann [Wed, 2 Mar 2022 21:03:26 +0000 (22:03 +0100)] 
core: check size before mmap

The data type off_t can be 64 on 32 bit systems if they have large
file support. Since mmap expects a size_t with 32 bits as second
argument truncation could occur. At worst these huge files could
lead to mmaps smaller than the previous check for small files.

This in turn shouldn't have a lot of impact because mmap allocates
at page size boundaries. This also made the PAGE_ALIGN call in
open_mmap unneeded. In fact it was neither in sync with other mmap
calls nor with its own munmap counterpart in error path.

If such large files are encountered, which is very unlikely in these
code paths, treat them with the same error as if they are too small.

2 years agokillall: show PID of processes killed in final killing spree
Lennart Poettering [Thu, 3 Mar 2022 17:31:48 +0000 (18:31 +0100)] 
killall: show PID of processes killed in final killing spree

Let's show the PID of killed processes in all cases, to make debugging
easier.

See: https://lists.freedesktop.org/archives/systemd-devel/2022-March/047504.html

2 years agomeson: move files' closing brace to separate line 22644/head
Zbigniew Jędrzejewski-Szmek [Thu, 3 Mar 2022 11:14:13 +0000 (12:14 +0100)] 
meson: move files' closing brace to separate line

2 years agoMerge pull request #22522 from lnussel/fix_logind_restart
Luca Boccassi [Wed, 2 Mar 2022 17:58:53 +0000 (17:58 +0000)] 
Merge pull request #22522 from lnussel/fix_logind_restart

logind: load scheduled shutdown on restart

2 years agomeson: use files() for libudevd_core_sources too
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 13:52:50 +0000 (14:52 +0100)] 
meson: use files() for libudevd_core_sources too

I'm not sure why a plain-text list was used in this case.

2 years agomeson: do not use split() in file lists
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 13:49:32 +0000 (14:49 +0100)] 
meson: do not use split() in file lists

The approach to use '''…'''.split() instead of a list of strings was initially
used when converting from automake because it allowed identical blocks of lines
to be used for both, making the conversion easier.

But over the years we have been using normal lists more and more, especially
when there were just a few filenames listed. This converts the rest.

No functional change.

2 years agobuild(deps): bump meson from 0.60.3 to 0.61.2 in /.github/workflows
dependabot[bot] [Tue, 1 Mar 2022 09:05:16 +0000 (09:05 +0000)] 
build(deps): bump meson from 0.60.3 to 0.61.2 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 0.60.3 to 0.61.2.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.60.3...0.61.2)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump github/codeql-action from 1.0.29 to 1.1.3
dependabot[bot] [Tue, 1 Mar 2022 09:04:51 +0000 (09:04 +0000)] 
build(deps): bump github/codeql-action from 1.0.29 to 1.1.3

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.29 to 1.1.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/384cfc42b2131df01c009d3d2eed7b78d8e8556e...75f07e7ab2ee63cba88752d8c696324e4df67466)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/labeler from 3.0.2 to 3.1.0
dependabot[bot] [Tue, 1 Mar 2022 09:04:47 +0000 (09:04 +0000)] 
build(deps): bump actions/labeler from 3.0.2 to 3.1.0

Bumps [actions/labeler](https://github.com/actions/labeler) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/69da01b8e0929f147b8943611bee75ee4175a49e...3d612d72e6784a1a65365cc6d33b5a001c12bf10)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoshared: Add more dlopen() tests
Daan De Meyer [Tue, 1 Mar 2022 17:04:13 +0000 (17:04 +0000)] 
shared: Add more dlopen() tests

Add dlopen_dw(), dlopen_elf() and dlopen_pcre2() to the dlopen test.
To enable adding dlopen_pcre2(), we move pcre2-dlopen.h/c from
src/journal to src/shared.

2 years agofile-hierarchy: Document /sys/fs/cgroup
Josh Triplett [Fri, 25 Feb 2022 20:40:45 +0000 (12:40 -0800)] 
file-hierarchy: Document /sys/fs/cgroup

file-hierarchy does not mention anything about the expected mountpoint
for cgroups. This may lead some software to believe it will need to
search for it (e.g. by scanning mountinfo) rather than just looking in
the canonical location.

Document the canonical mountpoint as /sys/fs/cgroup. Also provide
information on the non-default configurations, but
make it clear that in such configurations if cgroup2 is mounted (hybrid
mode) it won't have resource controllers attached. This will help
software know if it should fall back to /sys/fs/cgroup/unified or just
ignore that case.

2 years agosystemctl: use action_table for scheduling shutdown 22522/head
Ludwig Nussel [Tue, 8 Feb 2022 10:23:04 +0000 (11:23 +0100)] 
systemctl: use action_table for scheduling shutdown

The fall-through to reboot doesn't seem to make sense. It won't happen
in the current code. Filtering the actions on client side is not needed
either as the server will refuse unsupported operations anyway.

2 years agologind: load scheduled shutdown on restart
Ludwig Nussel [Tue, 4 Jan 2022 13:02:15 +0000 (14:02 +0100)] 
logind: load scheduled shutdown on restart

Make sure logind doesn't forget about a scheduled shutdown, even if it
gets restarted eg due to a package update.

2 years agoman: recommend built-in platform.freedesktop_os_release() in our page
Zbigniew Jędrzejewski-Szmek [Mon, 28 Feb 2022 08:47:28 +0000 (09:47 +0100)] 
man: recommend built-in platform.freedesktop_os_release() in our page

Python gained support for reading os-release, let's advertise it a bit more.
Our open-coded example is still useful, but let's not suggest it as the
default implementation.

I added quotes around the printed string because it looks a bit better
this way.

2 years agologind: fix handle_action_valid()
Ludwig Nussel [Wed, 23 Feb 2022 07:49:56 +0000 (08:49 +0100)] 
logind: fix handle_action_valid()

2 years agoMerge pull request #22627 from yuwata/network-l2tp-cleanups
Luca Boccassi [Sun, 27 Feb 2022 18:01:14 +0000 (18:01 +0000)] 
Merge pull request #22627 from yuwata/network-l2tp-cleanups

network: cleanups for L2TP tunnel

2 years agonetwork: netdev: drop unused creation type NETDEV_CREATE_AFTER_CONFIGURED 22627/head
Yu Watanabe [Fri, 25 Feb 2022 05:02:10 +0000 (14:02 +0900)] 
network: netdev: drop unused creation type NETDEV_CREATE_AFTER_CONFIGURED

2 years agonetwork: l2tp: change create type to independent
Yu Watanabe [Fri, 25 Feb 2022 04:56:49 +0000 (13:56 +0900)] 
network: l2tp: change create type to independent

L2TP tunnel does not have underlying interface. Let's change its type to
independent.

2 years agonetwork: l2tp: make Local= optionally take interface name
Yu Watanabe [Fri, 25 Feb 2022 08:12:18 +0000 (17:12 +0900)] 
network: l2tp: make Local= optionally take interface name

2 years agonetwork: introduce {manager,link}_address_is_reachable()
Yu Watanabe [Fri, 25 Feb 2022 07:47:47 +0000 (16:47 +0900)] 
network: introduce {manager,link}_address_is_reachable()

2 years agonetwork: merge gateway_is_ready() and link_address_is_reachable()
Yu Watanabe [Fri, 25 Feb 2022 07:29:26 +0000 (16:29 +0900)] 
network: merge gateway_is_ready() and link_address_is_reachable()

As link_address_is_reachable() is used only by gateway_is_ready().

2 years agonetwork: address: introduce manager_get_address()
Yu Watanabe [Fri, 25 Feb 2022 03:59:58 +0000 (12:59 +0900)] 
network: address: introduce manager_get_address()

And make manager_has_address() return true only when the link which has
the address is ready.

2 years agoMerge pull request #22626 from yuwata/network-assorted-cleanups
Yu Watanabe [Sat, 26 Feb 2022 14:57:08 +0000 (23:57 +0900)] 
Merge pull request #22626 from yuwata/network-assorted-cleanups

network: assorted cleanups

2 years agoMerge pull request #22625 from yuwata/network-tc-cleanups
Luca Boccassi [Sat, 26 Feb 2022 10:39:18 +0000 (10:39 +0000)] 
Merge pull request #22625 from yuwata/network-tc-cleanups

network: cleanups for traffic control

2 years agonetwork: adjust assertions 22626/head
Yu Watanabe [Sat, 26 Feb 2022 03:01:41 +0000 (12:01 +0900)] 
network: adjust assertions

2 years agonetwork: netdev: drop NETDEV_CREATE_MASTER
Yu Watanabe [Sat, 26 Feb 2022 03:18:06 +0000 (12:18 +0900)] 
network: netdev: drop NETDEV_CREATE_MASTER

As there is no deference between NETDEV_CREATE_MASTER and
NETDEV_CREATE_INDEPENDENT.

2 years agonetwork: netdev: use netdev_is_stacked() at one more place
Yu Watanabe [Sat, 26 Feb 2022 03:17:28 +0000 (12:17 +0900)] 
network: netdev: use netdev_is_stacked() at one more place

2 years agonetwork: netdev: make link_get_local_address() refuse non-ready links and addresses
Yu Watanabe [Fri, 25 Feb 2022 04:20:59 +0000 (13:20 +0900)] 
network: netdev: make link_get_local_address() refuse non-ready links and addresses

2 years agonetwork: traffic control: drop detailed log messages 22625/head
Yu Watanabe [Sat, 26 Feb 2022 02:36:45 +0000 (11:36 +0900)] 
network: traffic control: drop detailed log messages

This also renames `req` -> `m`.

Follow-up for a79a8d16d5b5f8709361d8deb42fc84ff2fe9c30 and #22014.

2 years agonetwork: traffic control: drop meta from QDisc and TClass
Yu Watanabe [Thu, 24 Feb 2022 07:08:50 +0000 (16:08 +0900)] 
network: traffic control: drop meta from QDisc and TClass

Since #22248, it is not necessary to manage QDisc and TClass in same Set
or Hashmap. Let's manage them independently.

2 years agoMerge pull request #22619 from yuwata/network-netdev-cleanups
Yu Watanabe [Fri, 25 Feb 2022 23:13:38 +0000 (08:13 +0900)] 
Merge pull request #22619 from yuwata/network-netdev-cleanups

network: several netdev cleanups

2 years agonetwork: drop unused flag and counter 22619/head
Yu Watanabe [Thu, 24 Feb 2022 02:06:29 +0000 (11:06 +0900)] 
network: drop unused flag and counter

2 years agonetwork: split netdev_create() into two
Yu Watanabe [Thu, 24 Feb 2022 01:29:49 +0000 (10:29 +0900)] 
network: split netdev_create() into two

2 years agonetwork: assign corresponding NetDev object to Link
Yu Watanabe [Thu, 17 Feb 2022 15:01:28 +0000 (00:01 +0900)] 
network: assign corresponding NetDev object to Link

2 years agonetwork/netdev: drop unused argument
Yu Watanabe [Thu, 17 Feb 2022 15:20:34 +0000 (00:20 +0900)] 
network/netdev: drop unused argument

2 years agonetwork/netdev: do not assign value on failure
Yu Watanabe [Thu, 17 Feb 2022 14:50:07 +0000 (23:50 +0900)] 
network/netdev: do not assign value on failure

2 years agotest: accept both unpadded and padded partition sizes
Frantisek Sumsal [Fri, 25 Feb 2022 14:09:07 +0000 (15:09 +0100)] 
test: accept both unpadded and padded partition sizes

Since util-linux/util-linux@921c7da55ec78350e4067b3fd6b7de6f299106ee
libfdisk aligns the last partition (on GPT) for optimal I/O. Let's
account for that.

Fixes: #22606
2 years agomkosi: Add centos_epel config
Daan De Meyer [Fri, 4 Feb 2022 11:10:33 +0000 (11:10 +0000)] 
mkosi: Add centos_epel config

Now that mkosi has centos-stream 9 support, let's add a config in
the repo so that the mkosi CI tests that configuration as well.

Centos doesn't support btrfs so we use xfs instead. For some reason,
building --hostonly-initrd centos images breaks the qemu boot so I
disabled that option for centos.

We update the mkosi commit hash to https://github.com/systemd/mkosi/commit/0dd39c20a4b3a2fab6efdc54da92bffad7c7b7ca
which adds the PowerTools repo to CentOS Stream 8 which is required
to make all the necessary packages required to build systemd on
CentOS Stream 8 available.

2 years agomkosi: Remove Arch nspawn workaround
Daan De Meyer [Fri, 25 Feb 2022 11:01:07 +0000 (11:01 +0000)] 
mkosi: Remove Arch nspawn workaround

This has been fixed so the workaround can be removed.

2 years agoMerge pull request #22620 from yuwata/network-drop-detailed-log-messages
Zbigniew Jędrzejewski-Szmek [Fri, 25 Feb 2022 09:31:50 +0000 (10:31 +0100)] 
Merge pull request #22620 from yuwata/network-drop-detailed-log-messages

network: drop detailed log messages