]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agotmpfiles: correct error variable to use 23943/head
Lennart Poettering [Fri, 8 Jul 2022 07:59:57 +0000 (09:59 +0200)] 
tmpfiles: correct error variable to use

3 years agonamespace: fix propagated error number
Lennart Poettering [Thu, 7 Jul 2022 21:20:31 +0000 (23:20 +0200)] 
namespace: fix propagated error number

3 years agoMerge pull request #23941 from yuwata/test-60-improve-performance
Frantisek Sumsal [Fri, 8 Jul 2022 07:24:52 +0000 (07:24 +0000)] 
Merge pull request #23941 from yuwata/test-60-improve-performance

test: performance improvement for TEST-60

3 years agotest: use timeout command to improve performance 23941/head
Yu Watanabe [Thu, 7 Jul 2022 22:00:42 +0000 (07:00 +0900)] 
test: use timeout command to improve performance

c.f. #23723.

3 years agotest: remove /failed and /testok before running test script
Yu Watanabe [Thu, 7 Jul 2022 22:00:02 +0000 (07:00 +0900)] 
test: remove /failed and /testok before running test script

3 years agoMerge pull request #23937 from mrc0mmand/test-tweaks
Yu Watanabe [Thu, 7 Jul 2022 21:25:57 +0000 (06:25 +0900)] 
Merge pull request #23937 from mrc0mmand/test-tweaks

Several ASan-related test suite tweaks

3 years agoMerge pull request #23939 from mrc0mmand/TEST-70-fix-cleanup
Yu Watanabe [Thu, 7 Jul 2022 20:44:12 +0000 (05:44 +0900)] 
Merge pull request #23939 from mrc0mmand/TEST-70-fix-cleanup

Fix cleanup in TEST-70-TPM2

3 years agotest: use PBKDF2 with capped iterations instead of Argon2 23937/head
Frantisek Sumsal [Thu, 7 Jul 2022 15:16:31 +0000 (17:16 +0200)] 
test: use PBKDF2 with capped iterations instead of Argon2

to reduce the amount of resources the test needs (similarly to TEST-24
where we do the same thing).

3 years agotest: make TEST-64 a bit more ASan friendly
Frantisek Sumsal [Thu, 7 Jul 2022 14:56:42 +0000 (16:56 +0200)] 
test: make TEST-64 a bit more ASan friendly

Reduce the number of iterations in some of the test cases, since they
generate a huge amount of uevents and basically DoS udev (which can't
keep up while being slowed down by ASan). To avoid this, let's reduce
the number of iterations and bump the timeout when running under ASan,
since we're not interested in performance in such cases.

3 years agotest: avoid overriding an already existing EXIT handler 23939/head
Frantisek Sumsal [Thu, 7 Jul 2022 18:02:06 +0000 (20:02 +0200)] 
test: avoid overriding an already existing EXIT handler

TEST-70 specified its own EXIT handler, which replaced the
`cleanup_loopdev` handler, so the loop device was always hanging around
once this test was run. Let's use the new `add_at_exit_handler()` stuff
to mitigate this.

3 years agotest: allow multiple handlers for the EXIT signal
Frantisek Sumsal [Thu, 7 Jul 2022 18:00:46 +0000 (20:00 +0200)] 
test: allow multiple handlers for the EXIT signal

Bash allows only one handler per signal, so let's overcome this
limitation by having one dedicated EXIT signal which runs all registered
handlers from all over the place.

3 years agotest: bump the data partition size if we don't strip binaries
Frantisek Sumsal [Thu, 7 Jul 2022 12:13:32 +0000 (14:13 +0200)] 
test: bump the data partition size if we don't strip binaries

so we can run TEST-24 under sanitizers as well.

Also, when at it, use the 'named-fields' sfdisk format to make the code
a bit more descriptive without needing a manual.

3 years agotest: create an ASan wrapper for `getent` and `su`
Frantisek Sumsal [Thu, 7 Jul 2022 12:12:38 +0000 (14:12 +0200)] 
test: create an ASan wrapper for `getent` and `su`

since they "suffer" from the same issue as `login` and other binaries
that load PAM stuff

3 years agoMerge pull request #23931 from yuwata/systemctl-color-log
Frantisek Sumsal [Thu, 7 Jul 2022 13:15:59 +0000 (13:15 +0000)] 
Merge pull request #23931 from yuwata/systemctl-color-log

systemctl: colorize logs

3 years agotest: several cleanups for TEST-35-LOGIN
Yu Watanabe [Thu, 7 Jul 2022 01:10:05 +0000 (10:10 +0900)] 
test: several cleanups for TEST-35-LOGIN

- use test_append_files() to install additional commands
- drop use of expect
- include assert.sh and use assertions at several places
- use timeout command at several places
- always use logind-test-user
- etc

3 years agoresolvectl man page: Word correction
Frank Dana [Thu, 7 Jul 2022 10:56:04 +0000 (06:56 -0400)] 
resolvectl man page: Word correction

3 years agoMerge pull request #23932 from medhefgo/boot-misc
Yu Watanabe [Thu, 7 Jul 2022 10:59:05 +0000 (19:59 +0900)] 
Merge pull request #23932 from medhefgo/boot-misc

boot: Miscellaneous cleanups

3 years agoboot: Use UEFI protocol struct names 23932/head
Jan Janssen [Thu, 7 Jul 2022 08:24:14 +0000 (10:24 +0200)] 
boot: Use UEFI protocol struct names

These are somewhat pointless gnu-efi typedefs. Using the names from the
UEFI spec makes things clearer.

The one exception left is EFI_FILE as we use it a lot and
EFI_FILE_PROTOCOL is quite a handful.

3 years agoboot: Use typedef for PE structs
Jan Janssen [Thu, 7 Jul 2022 08:16:26 +0000 (10:16 +0200)] 
boot: Use typedef for PE structs

3 years agoboot: Constify PE sections type
Jan Janssen [Mon, 20 Jun 2022 11:43:47 +0000 (13:43 +0200)] 
boot: Constify PE sections type

3 years agoboot: Use void for base pointer
Jan Janssen [Mon, 20 Jun 2022 11:10:41 +0000 (13:10 +0200)] 
boot: Use void for base pointer

3 years agoboot: Use open_volume when creating cpio
Jan Janssen [Tue, 5 Jul 2022 08:28:30 +0000 (10:28 +0200)] 
boot: Use open_volume when creating cpio

3 years agosystemctl: drop color settings in log message 23931/head
Yu Watanabe [Thu, 7 Jul 2022 07:31:58 +0000 (16:31 +0900)] 
systemctl: drop color settings in log message

`log_warning()` colorize the message gracefully.

3 years agosystemctl: enable colorized logging by default
Yu Watanabe [Thu, 7 Jul 2022 07:38:54 +0000 (16:38 +0900)] 
systemctl: enable colorized logging by default

3 years agoMerge pull request #23569 from msekletar/pam-systemd-no-user-systemd
Yu Watanabe [Thu, 7 Jul 2022 01:33:21 +0000 (10:33 +0900)] 
Merge pull request #23569 from msekletar/pam-systemd-no-user-systemd

Don't spawn systemd --user instance for background (i.e. cron) sessions

3 years agoNEWS: mention change in default behavior of background sessions 23569/head
Michal Sekletar [Mon, 30 May 2022 13:13:13 +0000 (15:13 +0200)] 
NEWS: mention change in default behavior of background sessions

3 years agotests: add test for handling of background sessions
Michal Sekletar [Tue, 21 Jun 2022 16:41:46 +0000 (18:41 +0200)] 
tests: add test for handling of background sessions

3 years agologind: don't start user@UID.service instance for background sessions
Michal Sekletar [Fri, 27 May 2022 19:11:37 +0000 (21:11 +0200)] 
logind: don't start user@UID.service instance for background sessions

We have had background session class for a long time (since commit
e2acb67baa), but so far the only difference in handling of background
sessions was logging, i.e. we log some messages with LOG_DEBUG for such
sessions.

Previously there were complains [1] about excessive logging for each
time cron session is started. We used to advise user to enable lingering
for users if they want to avoid these log messages. However, on servers
with a lot of users the extra processes that result from lingering just
adds too much overhead. Hence I think that our current handling of
background sessions is not ideal and we should make better use of this
attribute.

This commit introduces a change in default behavior of logind. Logind is
now not going to start user instance of systemd when background session
is created and that should address excessive logging problem for cron
where background class is used by default. When the same user actually
logs in normally then user instance will be started as previously.

Also note that PAM_TTY variable is now always set to some value for PAM
sessions started via PAMName= option. Otherwise we would categorize such
sessions as "background" and user manager won't be started.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1825942

3 years agotest: fix typo
Yu Watanabe [Thu, 7 Jul 2022 00:33:11 +0000 (09:33 +0900)] 
test: fix typo

3 years agoTODO: fix typo
Yu Watanabe [Thu, 7 Jul 2022 00:31:43 +0000 (09:31 +0900)] 
TODO: fix typo

3 years agoMerge pull request #23396 from msekletar/fix-idle-action-lock
Yu Watanabe [Wed, 6 Jul 2022 22:42:51 +0000 (07:42 +0900)] 
Merge pull request #23396 from msekletar/fix-idle-action-lock

logind: remember our idle state and use it to detect idle level transitions

3 years agoos-release: define SUPPORT_END=
Zbigniew Jędrzejewski-Szmek [Wed, 6 Jul 2022 15:19:27 +0000 (17:19 +0200)] 
os-release: define SUPPORT_END=

Fixes #21764.

I think is very simple, but flexible. The date may be set early, for distros
that have a fixed schedule, but it doesn't have to. So for example Debian could
push out an update that sets a few months before the release goes EOL. And
various tools, in particular graphical desktops, can start nagging people to
upgrade a few weeks before the date.

As discussed in the bug, we don't need granularity higher than a day. And this
means that we can use a simple human- and machine-readable format.
I was considering other names, e.g. something with "EOL", but I think that
"SUPPORT_END" is better because it doesn't imply that the machine will somehow
stop working. This is supposed to be an advisory, nothing more.

3 years agoMerge pull request #23918 from yuwata/dissect
Luca Boccassi [Wed, 6 Jul 2022 20:31:04 +0000 (21:31 +0100)] 
Merge pull request #23918 from yuwata/dissect

Revert "dissect: ID from os-release should be non-empty, not just non-NULL"

3 years agofundamental: adjust #if conditional for _fallthrough_ for clang
Thomas Haller [Wed, 6 Jul 2022 12:50:50 +0000 (14:50 +0200)] 
fundamental: adjust #if conditional for _fallthrough_ for clang

NetworkManager takes systemd sources. It gets compiler warnings
related to _fallthrough_. They probably can also affect systemd
itself.

A) on RHEL-7, gcc 4.8.5-44.el7 we get:

    ../src/libnm-systemd-shared/src/fundamental/macro-fundamental.h:45:22: error: "__clang__" is not defined [-Werror=undef]
     #if __GNUC__ >= 7 || __clang__
                          ^

   Presumably gcc older than 7 is supported, so fix this.

B) on Ubuntu 18.04, clang 1:6.0-41~exp5~ubuntu1 we get:

    ../src/libnm-systemd-core/src/libsystemd-network/sd-dhcp6-client.c:746:17: error: declaration does not declare anything [-Werror,-Wmissing-declarations]
                    _fallthrough_;
                    ^
    ../src/libnm-systemd-shared/src/fundamental/macro-fundamental.h:46:25: note: expanded from macro '_fallthrough_'
    #  define _fallthrough_ __attribute__((__fallthrough__))
                            ^

   Granted, README comments that clang >= 10 is required. However,
   parts of systemd build just fine with older clang. It seems unnecessary
   to break this and the fix helps NetworkManager.

Fixes: c0f5d58c9ab7 ('meson: Document why -Wimplicit-fallthrough is not used with clang')
3 years agoMerge pull request #15205 from jlebon/pr/preset-all-firstboot
Zbigniew Jędrzejewski-Szmek [Wed, 6 Jul 2022 17:11:01 +0000 (19:11 +0200)] 
Merge pull request #15205 from jlebon/pr/preset-all-firstboot

manager: optionally, do a full preset on first boot

3 years agomkosi: Update to latest release
Daan De Meyer [Wed, 6 Jul 2022 11:08:13 +0000 (13:08 +0200)] 
mkosi: Update to latest release

This fixes the mkosi github action to unbreak the mkosi CI

3 years agoman: "enabled commands are started at boot" is rubbish
Lennart Poettering [Wed, 6 Jul 2022 11:14:20 +0000 (13:14 +0200)] 
man: "enabled commands are started at boot" is rubbish

it's enabled units, and they might be started by various forms of
activation, not just "at boot".

Fix that.

3 years agoupdate TODO
Lennart Poettering [Wed, 6 Jul 2022 11:13:03 +0000 (13:13 +0200)] 
update TODO

3 years agodissect: refuse empty release ID 23918/head
Yu Watanabe [Wed, 6 Jul 2022 10:16:24 +0000 (19:16 +0900)] 
dissect: refuse empty release ID

3 years agoRevert "dissect: ID from os-release should be non-empty, not just non-NULL"
Yu Watanabe [Wed, 6 Jul 2022 05:38:23 +0000 (14:38 +0900)] 
Revert "dissect: ID from os-release should be non-empty, not just non-NULL"

This reverts commit a2cf73f0b602a93a32107cfc066a5e307263c577.

This is not necessary after 78ab2b5064a0f87579ce5430f9cb83bba0db069a.

Addresses https://github.com/systemd/systemd/pull/23454#discussion_r913611798.

3 years agoMerge pull request #23916 from keszybz/assorted-patches
Yu Watanabe [Wed, 6 Jul 2022 05:15:50 +0000 (14:15 +0900)] 
Merge pull request #23916 from keszybz/assorted-patches

Assorted patches

3 years agojson: actually use numeric C locale we just allocated
Lennart Poettering [Tue, 5 Jul 2022 14:27:09 +0000 (16:27 +0200)] 
json: actually use numeric C locale we just allocated

This fixes formatting of JSON real values, and uses C locale for them.
It's kinda interesting that this wasn't noticed before: the C locale
object we allocated was not used, hence doing the dance had zero effect.

This makes "test-varlink" pass again on systems with non-C locale.

(My guess: noone noticed this because "long double" was used before by
the JSON code and that had no locale supporting printer or so?)

3 years agojournal: Make sd_journal_previous/next() return 0 at HEAD/TAIL
Daan De Meyer [Tue, 5 Jul 2022 13:22:01 +0000 (15:22 +0200)] 
journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL

Currently, both these functions don't return 0 if we're at HEAD/TAIL
and move in the corresponding direction. Let's fix that.

Replaces #23480

3 years agodocs: normalize uppercasing of titles of network doc
Lennart Poettering [Tue, 5 Jul 2022 12:14:23 +0000 (14:14 +0200)] 
docs: normalize uppercasing of titles of network doc

3 years agotree-wide: drop duplicated semicolons 23916/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Jul 2022 19:48:55 +0000 (21:48 +0200)] 
tree-wide: drop duplicated semicolons

3 years agoman: fix link to glob(3)
Zbigniew Jędrzejewski-Szmek [Mon, 4 Jul 2022 17:59:06 +0000 (19:59 +0200)] 
man: fix link to glob(3)

3 years agofuzz: rename samples to avoid long test names
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 15:43:29 +0000 (17:43 +0200)] 
fuzz: rename samples to avoid long test names

3 years agoMerge pull request #23855 from keszybz/drop-list-is-empty
Lennart Poettering [Tue, 5 Jul 2022 15:29:53 +0000 (17:29 +0200)] 
Merge pull request #23855 from keszybz/drop-list-is-empty

basic/list: drop LIST_IS_EMPTY

3 years agofirstboot: Don't skip passwd/shadow logic if only one of the files exists
Daan De Meyer [Tue, 5 Jul 2022 12:53:45 +0000 (14:53 +0200)] 
firstboot: Don't skip passwd/shadow logic if only one of the files exists

If one of the files exists but not the other one, we want to make sure
we create the other file to make sure the passwd database is in a valid
state.

3 years agoMerge pull request #23906 from poettering/isdigitisalpha
Lennart Poettering [Tue, 5 Jul 2022 14:40:39 +0000 (16:40 +0200)] 
Merge pull request #23906 from poettering/isdigitisalpha

tree-wide: add global ascii_isalpha() + ascii_isdigit() and use it everywhere

3 years agomachine: switch to BusLocator-oriented helpers
Quentin Deslandes [Tue, 5 Jul 2022 09:41:45 +0000 (02:41 -0700)] 
machine: switch to BusLocator-oriented helpers

Replace existing sd_bus_x calls with counterparts from bus-locator.h.

3 years agouser: delegate cpu controller, assign weights to user slices
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 08:33:49 +0000 (10:33 +0200)] 
user: delegate cpu controller, assign weights to user slices

So far we didn't enable the cpu controller because of overhead of the
accounting. If I'm reading things correctly, delegation was enabled for a while
for the units with user and pam context set, i.e. for user@.service too.
a931ad47a8623163a29d898224d8a8c1177ffdaf added the explicit Delegate=yes|no
switch, but it was initially set to 'yes'.
acc8059129b38d60c1b923670863137f8ec8f91a disabled delegation for user@.service
with the justication that CPU accounting is expensive, but half a year later
a88c5b8ac4df713d9831d0073a07fac82e884fb3 changed DefaultCPUAccounting=yes for
kernels >=4.15 with the justification that CPU accounting is inexpensive there.

In my (very noncomprehensive) testing, I don't see a measurable overhead if the
cpu controller is enabled for user slices. I tried some repeated compilations,
and there is was no statistical difference, but the noise level was fairly
high. Maybe better benchmarking would reveal a difference.

The goal of this change is very simple: currently all of the user session,
including services like the display server and pipewire are under user@.service.
This means that when e.g. a compilation job is started in the session's
app.slice, the processes in session.slice compete for CPU and can be starved.
In particular, audio starts to stutter, etc. With CPU controller enabled,
I can start start 'ninja -C build -j40' in a tab and this doesn't have any
noticable effect on audio.

I don't think the particular values matter too much: the CPU controller is
work-convserving, and presumably the session slice would never need more than
e.g. one 1 full CPU, i.e. half or a quarter of available CPU resources on even
the smallest of today's machines. app.slice and session.slice are assigned
equal weights, background.slice is assigned a smaller fraction. CPUWeight=100
is the default, but I wrote it explicitly to make it easier for users to see
how the split is done. So effectively this should result in session.slice
getting as much power as it needs.

If if turns out that this does have a noticable overhead, we could make it
opt-in. But I think that the benefit to usability is important enough to enable
it by default. W/o something like this the session is not really usable with
background tasks.

3 years agotree-wide: add global ascii_isdigit() + ascii_isalpha() 23906/head
Lennart Poettering [Tue, 5 Jul 2022 09:55:26 +0000 (11:55 +0200)] 
tree-wide: add global ascii_isdigit() + ascii_isalpha()

We now have a local implementation in string-util-fundamental.c, but
it's useful at a lot of other places, hence let's give it a more
expressive name and share it across the tree.

Follow-up for: 8d9156660d6958c8d63b1d44692968f1b5d33920

3 years agosd-id128: don't allow chars > f in valid id128 values
Lennart Poettering [Tue, 5 Jul 2022 12:10:33 +0000 (14:10 +0200)] 
sd-id128: don't allow chars > f in valid id128 values

3 years agoupdate TODO
Lennart Poettering [Tue, 5 Jul 2022 09:54:55 +0000 (11:54 +0200)] 
update TODO

3 years agodocs: move some stuff into "Networking" section
Lennart Poettering [Tue, 5 Jul 2022 09:55:01 +0000 (11:55 +0200)] 
docs: move some stuff into "Networking" section

The "Networking" section has a lonely single document listed right now,
even though the "Concepts" section has two more network related docs.
Move them over, let's end this loneliness.

3 years agotree-wide: Remove the repeated ';' from code (#23901)
Li kunyu [Tue, 5 Jul 2022 07:06:47 +0000 (07:06 +0000)] 
tree-wide: Remove the repeated ';' from code (#23901)

3 years agotree-wide: link to docs.kernel.org for kernel documentation
nl6720 [Mon, 4 Jul 2022 14:26:30 +0000 (17:26 +0300)] 
tree-wide: link to docs.kernel.org for kernel documentation

https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
See https://git.kernel.org/pub/scm/docs/kernel/website.git/commit/?id=ebc1c372850f249dd143c6d942e66c88ec610520

These URLs are shorter and nicer looking.

3 years agoMerge pull request #23104 from mrc0mmand/resolved-tests
Yu Watanabe [Mon, 4 Jul 2022 14:46:16 +0000 (23:46 +0900)] 
Merge pull request #23104 from mrc0mmand/resolved-tests

Introduce systemd-resolved test suite

3 years agomeson: Assign tests a suite based on their directory
Daan De Meyer [Sun, 3 Jul 2022 11:44:05 +0000 (13:44 +0200)] 
meson: Assign tests a suite based on their directory

This can be used to run only a subset of tests, e.g.
"meson test -C build --suite journal" to run only the journal
unit tests.

3 years agotests: verify that Lock D-Bus signal is sent when IdleAction=lock 23396/head
Michal Sekletar [Fri, 1 Jul 2022 10:59:57 +0000 (12:59 +0200)] 
tests: verify that Lock D-Bus signal is sent when IdleAction=lock

3 years agotest: Introduce systemd-resolved test suite 23104/head
Frantisek Sumsal [Sun, 17 Apr 2022 13:50:16 +0000 (15:50 +0200)] 
test: Introduce systemd-resolved test suite

Resolves: #19599

3 years agotest: resize the terminal automagically with INTERACTIVE_DEBUG=yes
Frantisek Sumsal [Sun, 17 Apr 2022 17:49:17 +0000 (19:49 +0200)] 
test: resize the terminal automagically with INTERACTIVE_DEBUG=yes

3 years agotest: install /usr/libexec/vi as well
Frantisek Sumsal [Sat, 16 Apr 2022 12:43:17 +0000 (14:43 +0200)] 
test: install /usr/libexec/vi as well

since `/bin/vi` (at least on Fedora) is a shell wrapper which runs
either `/bin/vim` or `/usr/libexec/vi` based on availability.

3 years agoMerge pull request #23886 from keszybz/https-links-kernel
Yu Watanabe [Sat, 2 Jul 2022 15:55:59 +0000 (00:55 +0900)] 
Merge pull request #23886 from keszybz/https-links-kernel

tree-wide: use html links for kernel docs

3 years agoMerge pull request #23088 from yuwata/udev-event-blocker
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 15:08:45 +0000 (17:08 +0200)] 
Merge pull request #23088 from yuwata/udev-event-blocker

udev: cleanups for event blocker

3 years agoMerge pull request #23865 from keszybz/drop-memcpy-call
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 14:59:32 +0000 (16:59 +0200)] 
Merge pull request #23865 from keszybz/drop-memcpy-call

sd-id128: avoid an unnecessary function call in inline helper

3 years agotest: copy libgcc_s.so.1 to TPM2 test image on Debian-like systems
Nick Rosbrook [Tue, 28 Jun 2022 20:48:21 +0000 (16:48 -0400)] 
test: copy libgcc_s.so.1 to TPM2 test image on Debian-like systems

On Ubuntu, cryptsetup does not link against libgcc_s.so.1 which leads to
the following test failure in TEST-70-TPM2:

 systemd[1]: Starting testsuite-70.service...
 systemd[329]: testsuite-70.service: Executing: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh
 testsuite-70.sh[329]: + export SYSTEMD_LOG_LEVEL=debug
 testsuite-70.sh[329]: + SYSTEMD_LOG_LEVEL=debug
 testsuite-70.sh[329]: + img=/var/tmp/test.img
 testsuite-70.sh[329]: + dd if=/dev/zero of=/var/tmp/test.img bs=1024k count=20 status=none
 testsuite-70.sh[329]: + echo -n passphrase
 testsuite-70.sh[329]: + cryptsetup luksFormat -q --use-urandom /var/tmp/test.img /tmp/passphrase
 testsuite-70.sh[333]: libgcc_s.so.1 must be installed for pthread_exit to work
 testsuite-70.sh[329]: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh:
     line 12: 333 Aborted (core dumped) cryptsetup luksFormat -q --use-urandom $img /tmp/passphrase

To fix this, manually install libgcc_s.so.1 to the test image if running
on Debian-like systems.

3 years agoman/network: fix wording and syntax 23886/head
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 11:40:24 +0000 (13:40 +0200)] 
man/network: fix wording and syntax

Follow-up for 0bcc6557fbba32ebcdf323e76688ced50e3c8d8e. Docbook doesn't
know <variable>.

3 years agoMerge pull request #23835 from yuwata/nspawn-private-users-identity
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 10:58:06 +0000 (12:58 +0200)] 
Merge pull request #23835 from yuwata/nspawn-private-users-identity

nspawn: follow-ups for --private-users=identity

3 years agotest-list: rename field to indicate that it's a list 23855/head
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:46:47 +0000 (14:46 +0200)] 
test-list: rename field to indicate that it's a list

With this commit, lists are generally either names with plural (items),
or in a way that indicates a multi-item container (queue, *_list, or similar).

3 years agosystemctl: rename field for clarity
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:35:42 +0000 (14:35 +0200)] 
systemctl: rename field for clarity

3 years agoudev: rename field
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:25:11 +0000 (14:25 +0200)] 
udev: rename field

When we start, the contents of the variable match the name. But then
in the loop, the variable doesn't point at the old head any more. So let's
rename it to something with a plural.

3 years agosd-event: rename field to indicate that it's a list
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:22:33 +0000 (14:22 +0200)] 
sd-event: rename field to indicate that it's a list

3 years agosd-event: rename field to indicate that it's a list
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:21:12 +0000 (14:21 +0200)] 
sd-event: rename field to indicate that it's a list

3 years agosd-event: align table
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:19:41 +0000 (14:19 +0200)] 
sd-event: align table

3 years agoresolved: rename field to indicate that it's a list
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:17:44 +0000 (14:17 +0200)] 
resolved: rename field to indicate that it's a list

3 years agobasic/list: drop LIST_IS_EMPTY
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2022 16:37:34 +0000 (18:37 +0200)] 
basic/list: drop LIST_IS_EMPTY

This was a trivial wrapper that didn't provide any added value. With more
complicated structures like strvs, hashmaps, sets, and arrays, it is possible
to have an empty container. But in case of a list, the list is empty only when
the head is missing.

Also, we generally want the positive condition, so we replace many
if (!LIST_IS_EMPTY(x)) with just if (x).

3 years agohomework: silence gcc warning 23865/head
Zbigniew Jędrzejewski-Szmek [Fri, 1 Jul 2022 13:44:39 +0000 (15:44 +0200)] 
homework: silence gcc warning

gcc was warning that found_fs_uuid was used unitialized. The issue stemmed from
the call to open(), where gcc seemingly didn't know that errno must be negative.
When that is set, we can drop some unnecessary initializations without warnings.

3 years agodebug-generator: shorten code a bit
Yu Watanabe [Fri, 1 Jul 2022 22:32:16 +0000 (07:32 +0900)] 
debug-generator: shorten code a bit

3 years agotree-wide: use html links for kernel docs
Zbigniew Jędrzejewski-Szmek [Fri, 1 Jul 2022 16:03:09 +0000 (18:03 +0200)] 
tree-wide: use html links for kernel docs

Instead of using "*.txt" as reference name, use the actual destination title.

3 years agoMerge pull request #23883 from yuwata/pid1-do-not-filter-out-systemd-unit
Yu Watanabe [Sat, 2 Jul 2022 00:42:09 +0000 (09:42 +0900)] 
Merge pull request #23883 from yuwata/pid1-do-not-filter-out-systemd-unit

core: do not filter out systemd.unit= from kernel command line

3 years agotest: add a simple test for daemon-reexec 23883/head
Frantisek Sumsal [Fri, 1 Jul 2022 20:21:52 +0000 (05:21 +0900)] 
test: add a simple test for daemon-reexec

3 years agocore: do not filter out systemd.unit= and run-level specifier from kernel command...
Yu Watanabe [Fri, 1 Jul 2022 19:18:41 +0000 (04:18 +0900)] 
core: do not filter out systemd.unit= and run-level specifier from kernel command line

Fixes a bug introduced by 846f1da465beda990c1c01346311393f485df467.

The commit 846f1da465beda990c1c01346311393f485df467 made systemd.unit=
filtered out from the command line. That causes debug-generator does not
work as expected on daemon-reexecute, and we cannot call `systemctl
daemon-reexecute` in our test suite running on nspawn.

Fixes issue reported in https://github.com/systemd/systemd/pull/23851#issuecomment-1170992052.

3 years agounit: prioritize module devices
Yu Watanabe [Fri, 1 Jul 2022 07:25:16 +0000 (16:25 +0900)] 
unit: prioritize module devices

Also, prioritize tty and network devices.

Follow-up for 2336bde96420475ccb054326f27290fa0228f27d

Fixes #23850.

3 years agosd-journal: silence bogus gcc warning
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jun 2022 12:32:49 +0000 (14:32 +0200)] 
sd-journal: silence bogus gcc warning

In function 'sd_id128_equal',
    inlined from 'journal_file_verify' at ../src/libsystemd/sd-journal/journal-verify.c:1047:29:
../src/systemd/sd-id128.h:119:43: error: 'entry_boot_id.qwords[0]' may be used uninitialized [-Werror=maybe-uninitialized]
  119 |         return a.qwords[0] == b.qwords[0] && a.qwords[1] == b.qwords[1];
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/libsystemd/sd-journal/journal-verify.c: In function 'journal_file_verify':
../src/libsystemd/sd-journal/journal-verify.c:823:20: note: 'entry_boot_id.qwords[0]' was declared here
  823 |         sd_id128_t entry_boot_id;
      |                    ^~~~~~~~~~~~~
cc1: all warnings being treated as errors

entry_boot_id is only used when entry_monotonic_set has been set, and that's
only done in one place where entry_boot_id is also initalized.

3 years agobuild(deps): bump meson from 0.62.0 to 0.62.2 in /.github/workflows
dependabot[bot] [Fri, 1 Jul 2022 09:08:56 +0000 (09:08 +0000)] 
build(deps): bump meson from 0.62.0 to 0.62.2 in /.github/workflows

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

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github/codeql-action from 2.1.6 to 2.1.15
dependabot[bot] [Fri, 1 Jul 2022 09:08:13 +0000 (09:08 +0000)] 
build(deps): bump github/codeql-action from 2.1.6 to 2.1.15

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.6 to 2.1.15.
- [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/28eead240834b314f7def40f6fcba65d100d99b1...3f62b754e23e0dd60f91b744033e1dc1654c0ec6)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years agojournalctl: fix to show user slice
Yu Watanabe [Fri, 1 Jul 2022 06:12:22 +0000 (15:12 +0900)] 
journalctl: fix to show user slice

Fixes #23867.

3 years agounits: add IgnoreOnIsolate=yes to systemd-journald too
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 11:14:37 +0000 (13:14 +0200)] 
units: add IgnoreOnIsolate=yes to systemd-journald too

We already had it on the socket units, so it's possible that
systemd-journald.service would be stopped and then restarted when trafic hits
the sockets when something logs. Let's not try to stop it. It is supposed to
run until the end and be eventually killed in the final killing spree.

This might (or not) help with #23287.

3 years agoMerge pull request #23868 from keszybz/lib-resplit-2
Yu Watanabe [Fri, 1 Jul 2022 04:13:42 +0000 (13:13 +0900)] 
Merge pull request #23868 from keszybz/lib-resplit-2

Export sd-netlink and clean up exported interfaces a bit

3 years agologind: log wall messages to the journal
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jun 2022 10:13:49 +0000 (12:13 +0200)] 
logind: log wall messages to the journal

Currently kde installs a fake utmp session to listen for this. This provides an
alternative mechanism as discussed in #23574.

Example with 'shutdown 6 -r' and shutdown -c':
    PRIORITY=6
    SYSLOG_FACILITY=4
    SYSLOG_IDENTIFIER=systemd-logind
    ...
    CODE_FILE=src/login/logind-utmp.c
    CODE_LINE=90
    CODE_FUNC=warn_wall
    MESSAGE_ID=9e7066279dc8403da79ce4b1a69064b2
    OPERATOR=root
    MESSAGE=The system will reboot at Thu 2022-06-30 12:16:43 CEST!
    ACTION=reboot

    PRIORITY=5
    SYSLOG_FACILITY=4
    SYSLOG_IDENTIFIER=systemd-logind
    ...
    OPERATOR=root
    CODE_FILE=src/login/logind-dbus.c
    CODE_LINE=2407
    CODE_FUNC=method_cancel_scheduled_shutdown
    MESSAGE=System shutdown has been cancelled
    MESSAGE_ID=249f6fb9e6e2428c96f3f0875681ffa3
    ACTION=reboot

3 years agologind: remember our idle state and use it to detect idle level transitions
Michal Sekletar [Wed, 20 Apr 2022 08:13:43 +0000 (10:13 +0200)] 
logind: remember our idle state and use it to detect idle level transitions

Fixes #16391

3 years agodocs/ARCHITECTURE: mention src/fundamental/ and add more details 23868/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jun 2022 13:14:44 +0000 (15:14 +0200)] 
docs/ARCHITECTURE: mention src/fundamental/ and add more details

3 years agobasic/socket-util: rename fd_inc_rcvbuf → fd_increase_rxbuf
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2022 13:17:35 +0000 (15:17 +0200)] 
basic/socket-util: rename fd_inc_rcvbuf → fd_increase_rxbuf

See previous commit for justification.

3 years agosd-netlink: rename sd_netlink_inc_rcvbuf → sd_netlink_increase_rxbuf
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jun 2022 08:47:28 +0000 (10:47 +0200)] 
sd-netlink: rename sd_netlink_inc_rcvbuf → sd_netlink_increase_rxbuf

We have RxBufferSize= and TxBufferSize= in .link files. Let's use the same
abbreviation here. OTOH, "inc" could be short for "increment" or "increase",
let's avoid that.

3 years agosd-bus: indentation
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jun 2022 13:14:31 +0000 (15:14 +0200)] 
sd-bus: indentation

3 years agosd-bus: use assert_return() in public function sd_bus_message_dump
Zbigniew Jędrzejewski-Szmek [Wed, 15 Jun 2022 08:25:08 +0000 (10:25 +0200)] 
sd-bus: use assert_return() in public function sd_bus_message_dump

Also, document that NULL is allowed.

3 years agosd-event: let sd_event_source_set_enabled accept NULL
Zbigniew Jędrzejewski-Szmek [Tue, 14 Jun 2022 12:40:30 +0000 (14:40 +0200)] 
sd-event: let sd_event_source_set_enabled accept NULL

Same story as before: disabling a non-existent event source shouldn't
need to be guarded by an if. I retained the wrapper so that that we don't
have to say SD_EVENT_OFF in the many places where this is called.

3 years agosd-event: allow sd_event_source_is_enabled() to return false for NULL
Zbigniew Jędrzejewski-Szmek [Tue, 14 Jun 2022 12:37:21 +0000 (14:37 +0200)] 
sd-event: allow sd_event_source_is_enabled() to return false for NULL

This is a natural use case, and instead of defining a wrapper to do this
for us, let's just make this part of the API. Calling with NULL was not
allowed, so this is not a breaking change to the interface.

(After sd_event_source_is_enabled was originally added, we introduced
sd_event_source_disable_unref() and other similar functions which accept
NULL. So not accepting NULL here is likely to confuse people. Let's just
make the API usable with minimal fuss.)