Jan Janssen [Mon, 20 Jun 2022 11:43:47 +0000 (13:43 +0200)]
boot: Constify PE sections type
Jan Janssen [Mon, 20 Jun 2022 11:10:41 +0000 (13:10 +0200)]
boot: Use void for base pointer
Jan Janssen [Tue, 5 Jul 2022 08:28:30 +0000 (10:28 +0200)]
boot: Use open_volume when creating cpio
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
Michal Sekletar [Mon, 30 May 2022 13:13:13 +0000 (15:13 +0200)]
NEWS: mention change in default behavior of background sessions
Michal Sekletar [Tue, 21 Jun 2022 16:41:46 +0000 (18:41 +0200)]
tests: add test for handling of 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
Yu Watanabe [Thu, 7 Jul 2022 00:33:11 +0000 (09:33 +0900)]
test: fix typo
Yu Watanabe [Thu, 7 Jul 2022 00:31:43 +0000 (09:31 +0900)]
TODO: fix typo
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
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.
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"
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')
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
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
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.
Lennart Poettering [Wed, 6 Jul 2022 11:13:03 +0000 (13:13 +0200)]
update TODO
Yu Watanabe [Wed, 6 Jul 2022 10:16:24 +0000 (19:16 +0900)]
dissect: refuse empty release ID
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.
Yu Watanabe [Wed, 6 Jul 2022 05:15:50 +0000 (14:15 +0900)]
Merge pull request #23916 from keszybz/assorted-patches
Assorted patches
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?)
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
Lennart Poettering [Tue, 5 Jul 2022 12:14:23 +0000 (14:14 +0200)]
docs: normalize uppercasing of titles of network doc
Zbigniew Jędrzejewski-Szmek [Tue, 5 Jul 2022 19:48:55 +0000 (21:48 +0200)]
tree-wide: drop duplicated semicolons
Zbigniew Jędrzejewski-Szmek [Mon, 4 Jul 2022 17:59:06 +0000 (19:59 +0200)]
man: fix link to glob(3)
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 15:43:29 +0000 (17:43 +0200)]
fuzz: rename samples to avoid long test names
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
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.
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
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.
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.
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
Lennart Poettering [Tue, 5 Jul 2022 12:10:33 +0000 (14:10 +0200)]
sd-id128: don't allow chars > f in valid id128 values
Lennart Poettering [Tue, 5 Jul 2022 09:54:55 +0000 (11:54 +0200)]
update TODO
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.
Li kunyu [Tue, 5 Jul 2022 07:06:47 +0000 (07:06 +0000)]
tree-wide: Remove the repeated ';' from code (#23901)
nl6720 [Mon, 4 Jul 2022 14:26:30 +0000 (17:26 +0300)]
tree-wide: link to docs. 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.
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
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.
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
Frantisek Sumsal [Sun, 17 Apr 2022 13:50:16 +0000 (15:50 +0200)]
test: Introduce systemd-resolved test suite
Resolves: #19599
Frantisek Sumsal [Sun, 17 Apr 2022 17:49:17 +0000 (19:49 +0200)]
test: resize the terminal automagically with INTERACTIVE_DEBUG=yes
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.
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
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
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
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.
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>.
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
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).
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:35:42 +0000 (14:35 +0200)]
systemctl: rename field for clarity
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.
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
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
Zbigniew Jędrzejewski-Szmek [Wed, 29 Jun 2022 12:19:41 +0000 (14:19 +0200)]
sd-event: align table
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
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).
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.
Yu Watanabe [Fri, 1 Jul 2022 22:32:16 +0000 (07:32 +0900)]
debug-generator: shorten code a bit
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.
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
Frantisek Sumsal [Fri, 1 Jul 2022 20:21:52 +0000 (05:21 +0900)]
test: add a simple test for daemon-reexec
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.
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.
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.
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>
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>
Yu Watanabe [Fri, 1 Jul 2022 06:12:22 +0000 (15:12 +0900)]
journalctl: fix to show user slice
Fixes #23867.
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.
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
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
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
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jun 2022 13:14:44 +0000 (15:14 +0200)]
docs/ARCHITECTURE: mention src/fundamental/ and add more details
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.
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.
Zbigniew Jędrzejewski-Szmek [Fri, 17 Jun 2022 13:14:31 +0000 (15:14 +0200)]
sd-bus: indentation
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.
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.
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.)
Zbigniew Jędrzejewski-Szmek [Thu, 23 Jun 2022 10:56:34 +0000 (12:56 +0200)]
sd-netlink: allow sd_netlink_message_read() to be used for union types
Before, sd_netlink_message_read() expected to fill a buffer completely,
and would return -EIO if the attribute being read was shorter than the
buffer. This means that the function can be used to "peek" into attributes
(by specifying a short buffer to just read part of the attribute), but
cannot be used to read something into a union without knowing beforehand
which specific field in the union is being filled. That latter operation
seems more useful (messages are short, so we don't really need to do partial
reads), so let's allow reads that don't fill the output buffer completely.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 09:17:33 +0000 (11:17 +0200)]
man: document sd_bus_message_read_strv_extend()
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 09:17:17 +0000 (11:17 +0200)]
sd-bus: export sd_bus_message_read_strv_extend()
The same story as before: it's a useful helper, other uses of the library
are likely to find it useful.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 09:02:54 +0000 (11:02 +0200)]
man: document sd_id128_string_equal()
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 08:38:14 +0000 (10:38 +0200)]
man: rework the text in sd-id128
In places the text was overly formal, e.g. "an 128-bit ID" was repeated, even
though it is clear from the context that we're talking about this type of ID.
OTOH, in other places the text was informal, e.g. "You can use …".
Also, "you may use f() to frob" → "f() frobs". The text without all the
flourishes is easier to read.
sd_id128_in_set_sentinel() was described only in passing when taking about
sd_id128_in_set(), now it gets is own brief paragraph.
The synopsis was missing.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 08:22:46 +0000 (10:22 +0200)]
sd-id128: rename and export sd_id128_string_equal()
We find this function useful in our code, so no reason not to export it.
I changed the order of last two words in the name to match the arguments.
(With "equal_string" I expected sd_id128_t first, string second, but in
actual use, the second argument is usually a long constant so it's nice
to keep this order of arguments.)
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 08:11:22 +0000 (10:11 +0200)]
man: document sd_bus_error_setfv()
The description for sd_bus_error_set_errnof/sd_bus_error_set_errnofv are
adjusted to use the same pattern.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 08:10:30 +0000 (10:10 +0200)]
meson: update man-generation rules for sd_hwdb_new_from_path
Forgotten in
60f0ba75569312825ff14680d05a4b4f95842951.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 08:02:15 +0000 (10:02 +0200)]
sd-bus: export sd_bus_error_setfv()
The usual: if we find that function useful, other users of the library
will too. In particular, the v-variants are necessary to build pass-thru
wrappers.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Jun 2022 08:00:22 +0000 (10:00 +0200)]
sd-bus: drop unused prototype
Function was exported in
07a0d22f9ec5a0cac2385b73dc08b12a811cead8,
but apparently we forgot to remove the old declaration.
Zbigniew Jędrzejewski-Szmek [Sun, 12 Jun 2022 20:09:49 +0000 (22:09 +0200)]
libsystemd: drop unexported sd-utf8
It had two symbols which were not actually exported because they were not
listed in libsystemd.sym. They were also entirely unused in our codebase.
I don't think it makes much sense to export just those two functions, and
it doesn't make to build a string processing library in systemd either.
History of the file shows that it was created in
faaa5728d956b7f0d24f27f3341d0b9fff30af00 'utf8: export utf8 validation functions as part of sd-bus'
and hasn't gone even one non-trivial change since then ;)
Zbigniew Jędrzejewski-Szmek [Sun, 12 Jun 2022 19:51:50 +0000 (21:51 +0200)]
libsystemd: export sd-netlink
It was added originally in
65f568bbeb9b8c70200e44c19a797df3a0bfd485. The API is
has stabilized pretty much, and generally follows the usual style for
libsystemd. We've held it as a public-but-private library for almost 10 years,
let's export it.
sd_netlink_sendv() and sd_nfnl_nft_*() are excluded.
libsystemd.so seems to grow by 12k.
Zbigniew Jędrzejewski-Szmek [Sun, 12 Jun 2022 19:42:51 +0000 (21:42 +0200)]
test-lib*-sym: print symbols names in addition to addresses
This makes it easier to see what the test is doing.
I converted the code to use f-strings. They are already used in other scripts
necessary for build, so IIUC this is OK.
Zbigniew Jędrzejewski-Szmek [Sun, 12 Jun 2022 18:32:29 +0000 (20:32 +0200)]
sd-daemon: remove sd_ prefix from static function
Zbigniew Jędrzejewski-Szmek [Sun, 12 Jun 2022 18:13:49 +0000 (20:13 +0200)]
sd-netlink: remove sd_ prefix from static function
Zbigniew Jędrzejewski-Szmek [Sun, 12 Jun 2022 14:52:57 +0000 (16:52 +0200)]
Turn mempool_enabled() into a weak symbol
Before we had the following scheme:
mempool_enabled() would check mempool_use_allowed, and
libsystemd-shared would be linked with a .c file that provides mempool_use_allowed=true,
while other things would linked with a different .c file with mempool_use_allowed=false.
In the new scheme, mempool_enabled() itself is a weak symbol. If it's
not found, we assume false. So it only needs to be provided for libsystemd-shared,
where it can return false or true.
test-set-disable-mempool is libshared, so it gets the symbol. But then we
actually disable the mempool via envvar. mempool_enable() is called to check
its return value directly.
Zbigniew Jędrzejewski-Szmek [Sun, 12 Jun 2022 18:51:41 +0000 (20:51 +0200)]
sd-id128: avoid an unnecessary function call in inline helper
When optimizing, the compiler will most likely replace the call to memcmp(),
but at -O0, the code that is emitted builds the call preamble and does the
call. Let's use the same pattern as with sd_id128_is_null() and
sd_id128_is_allf() and avoid the call.
Daan De Meyer [Wed, 29 Jun 2022 10:13:21 +0000 (12:13 +0200)]
journal: Fix missing parenthesis
Yu Watanabe [Tue, 28 Jun 2022 21:17:44 +0000 (06:17 +0900)]
virt: fix detection of Parallels virtualization
If Parallels virtualization is detected from DMI, then trust that over CPUID.
Fixes issue caused by
28b1a3eac252d471de4fbb6f317353af30d68878.
Fixes #23856.
Daan De Meyer [Wed, 29 Jun 2022 10:12:26 +0000 (12:12 +0200)]
Merge pull request #23836 from yuwata/journal-file-check-object-header
sd-journal: check object header before verifying object data
Yu Watanabe [Tue, 28 Jun 2022 19:52:54 +0000 (04:52 +0900)]
sd-journal: data object may be invalid after data_object_in_hash_table()
Fixes a bug introduced by
578cd1855b73d2710ae14a8d77c4fac1d8ea7f48.
The function `data_object_in_hash_table()` calls
`journal_file_move_to_object()` with `OBJECT_DATA`. Hence,
previously obtained pointer to a data object may be now invalid.
Fixes #23794.