1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

76742 Commits

Author SHA1 Message Date
Daan De Meyer
61808636a7
Merge pull request #34679 from DaanDeMeyer/bus-log
Various logging improvements
2024-10-09 11:42:26 +02:00
Lennart Poettering
1c62c2da43
Merge pull request #34656 from yuwata/private-users
core: drop implicit support of PrivateUsers=off
2024-10-09 10:39:30 +02:00
Lennart Poettering
0d5ca13026
Merge pull request #34651 from yuwata/polkit-transient-unit
dbus: pass transient unit name metadata to polkit
2024-10-09 10:35:19 +02:00
Lennart Poettering
93b078c3dd hwdb: move key 66/65 handling from specific to generic HP laptop coverage
This takes the idea from #18595 and implements it based on our current
hwdb: the original PR suggested the keys 66/65 are a generic HP thing,
and not limited to specific laptops. The current specific laptop entries
do not contradict that claim.

Hence, let's move them from the specific sections matching some HP
laptops to the generic section matching all.

This uses the correct key names, which have long been fixed (which used
to be a problem our CI was tripped off by).

This is not tested, but I think fairly risk-less, and should allow us to
get rid of a really old PR.

Replaces: #18595
2024-10-09 10:34:13 +02:00
Daan De Meyer
acb0f501f4 core: Log in more scenarios about which process initiated an operation
Exit/Reboot/Poweroff and similar operations are invasive enough that
logging about who initiated them is very useful to debug issues.
2024-10-09 10:27:56 +02:00
Daan De Meyer
4ee41be825 core: Bump log level of reexecute request to notice
A daemon-reload is important enough to deserve logging at notice
level.
2024-10-09 10:27:56 +02:00
Daan De Meyer
d8a77d55e6 bus-util: Log more information when connecting to a bus socket fails
Let's log about which bus we're trying to connect to and what transport
we're using to do it.
2024-10-09 10:27:53 +02:00
Lennart Poettering
0aaacc3a10
Merge pull request #34593 from Werkov/deprecate-aux-scopes
core/manager: Deprecate StartAuxiliaryScope() method
2024-10-09 10:25:30 +02:00
Lennart Poettering
6ce06e94b1
Merge pull request #34671 from yuwata/memory
tree-wide: several memory accounting cleanups
2024-10-09 10:24:10 +02:00
Lennart Poettering
e204346953 NEWS: announce the F20/F21/F22/F23 key mangling removal scheduled for v258
As per: https://github.com/systemd/systemd/pull/34325
And: https://github.com/systemd/systemd/issues/34323
2024-10-09 09:04:31 +02:00
Lennart Poettering
438348f7cc update TODO 2024-10-09 09:04:31 +02:00
Yu Watanabe
2e8a581b9c core: drop implicit support of PrivateTmp=off
Follow-up for 0e551b04ef.

Similar to the previous commit, but for PrivateTmp=.
2024-10-09 08:11:42 +09:00
Renjaya Raga Zenta
3a437f52b8 core/dbus: pass transient unit name metadata to polkit
Fixes #17224
2024-10-09 06:57:22 +09:00
Yu Watanabe
dc995a9b23 core/dbus: add assertions 2024-10-09 06:57:11 +09:00
Yu Watanabe
0881cf3d51 core/dbus: introduce bus_verify_manage_units_async_impl()
Then, make bus_verify_manage_units_async() and _full() inline.

Co-authored-by: Renjaya Raga Zenta <ragazenta@gmail.com>
2024-10-09 06:55:32 +09:00
Yu Watanabe
d030946765 core/dbus: move bus_verify_xyz() to dbus-util.c 2024-10-09 06:54:45 +09:00
Chen Guanqiao
00ad3f0227 mount: optimize mountinfo traversal by decoupling device discovery
In mount_load_proc_self_mountinfo(), device_found_node() is synchronously called
during the traversal of mountinfo entries. When there are a large number of
mount points, and the device types are not significantly different, this results
in excessive time consumption during device discovery, causing a performance
bottleneck. This issue is particularly prominent on servers with a large number
of cores in IDC.

This patch decouples device discovery from the mountinfo traversal process,
avoiding redundant device operations. As a result, it significantly improves
performance, especially in environments with numerous mount points.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
2024-10-08 22:36:59 +01:00
Yu Watanabe
edd3f4d9b7 core: drop implicit support of PrivateUsers=off
Follow-up for fa693fdc7e.

The documentation says the option takes a boolean or one of the "self"
and "identity". But the parser uses private_users_from_string() which
also accepts "off". Let's drop the implicit support of "off".
2024-10-09 05:39:54 +09:00
Yu Watanabe
e607a7317f oomd: separate entries with comma for readability 2024-10-09 05:36:11 +09:00
Yu Watanabe
05314b1823 oomd: update system context when oomctl is invoked
Otherwise, oomctl shows 0 memory and swap usage when swap monitoring
is not enabled.
=======
$ oomctl
Dry Run: no
Swap Used Limit: 90.00%
Default Memory Pressure Limit: 60.00%
Default Memory Pressure Duration: 20s
System Context:
        Memory: Used: 0B Total: 0B
        Swap: Used: 0B Total: 0B
Swap Monitored CGroups:
Memory Pressure Monitored CGroups:
...
======
2024-10-09 05:36:11 +09:00
Yu Watanabe
0f1a09203e oomd: drop unused usec_now 2024-10-09 05:36:11 +09:00
Yu Watanabe
483ab07534 systemctl: separate memory usage with comma
Just for readability.

Before:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
     Memory: 4.7M (peak: 14.3M swap: 1M swap peak: 1.1M)

After:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
     Memory: 4.7M (peak: 14.3M, swap: 1M, swap peak: 1.1M)
2024-10-09 05:36:11 +09:00
Yu Watanabe
1cafbecabe core: suppress one debugging log
Otherwise, the log is shown even when getting properties.
Even though it is in the debug level, that's quite noisy.

[  338.785847] TEST-55-OOMD.sh[1624]: Oct 07 16:35:15 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.786985] TEST-55-OOMD.sh[1624]: Oct 07 16:35:17 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.787412] TEST-55-OOMD.sh[1624]: Oct 07 16:35:20 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.791776] TEST-55-OOMD.sh[1624]: Oct 07 16:35:22 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.792938] TEST-55-OOMD.sh[1624]: Oct 07 16:35:24 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793225] TEST-55-OOMD.sh[1624]: Oct 07 16:35:26 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793424] TEST-55-OOMD.sh[1624]: Oct 07 16:35:28 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.796448] TEST-55-OOMD.sh[1624]: Oct 07 16:35:31 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.797997] TEST-55-OOMD.sh[1624]: Oct 07 16:35:33 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.799206] TEST-55-OOMD.sh[1624]: Oct 07 16:35:35 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
2024-10-09 05:36:11 +09:00
Luca Boccassi
2b577d598b
Merge pull request #34675 from poettering/dupfd-query
fd-util: use F_DUPFD_QUERY for same_fd()
2024-10-08 19:30:57 +01:00
Luca Boccassi
8a1c78f33e
Merge pull request #34674 from yuwata/reallocarray
tree-wide: replace reallocarray() with GREEDY_REALLOC()
2024-10-08 19:27:43 +01:00
Luca Boccassi
d07e1e07fe
Merge pull request #34672 from yuwata/timestamp
analyze: fix timestamp
2024-10-08 19:21:28 +01:00
Michal Koutný
64f173324e core/manager: Deprecate StartAuxiliaryScope() method
The method was added with migration of resources in mind (e.g. process's
allocated memory will follow it to the new scope), however, such a
resource migration is not in cgroup semantics. The method may thus have
the intended users and others could be guided to StartTransientUnit().

Since this API was advertised in a regular release, start the removal
with a deprecation message to callers.
Eventually, the goal is to remove the method to clean up DBus API and
simplify code (removal of cgroup_context_copy()).

Part of DBus docs is retained to satisfy build checks.
2024-10-08 17:49:13 +02:00
Luca Boccassi
945ace18b4
Merge pull request #34678 from kalrish/documentation-fixes
Fix little errors in man pages `machinectl(1)` and `systemd-nspawn(1)`
2024-10-08 15:44:55 +01:00
David Joaquín Shourabi Porcel
a41da1e703
man: machinectl(1): Fix description of subcommand poweroff 2024-10-08 15:23:17 +02:00
David Joaquín Shourabi Porcel
f4e3c6e5b3
man: systemd-nspawn(1): Fix some typos 2024-10-08 15:23:07 +02:00
Lennart Poettering
ac42b151f8
Merge pull request #34556 from ryantimwilson/extra-fds
Add ExtraFileDescriptor property to StartTransientUnit dbus API
2024-10-08 13:26:59 +02:00
Lennart Poettering
e7f9053475 fd-util: use F_DUPFD_QUERY for same_fd()
Catch up with the nice little toys the kernel fs developers have added
for us. Preferably, let's make use of the new F_DUPFD_QUERY fcntl() call
that checks whether two fds are just duplicates of each other
(duplicates as in dup(), not as in open() of the same inode, i.e.
whether they share a single file offset and so on).

This API is much nicer, since it is a core kernel feature, unlike the
kcmp() call we so far used, which is part of the (optional)
checkpoint/restore stuff.

F_DUPFD_QUERY is available since kernel 6.10.
2024-10-08 13:13:49 +02:00
Lennart Poettering
6056663a14 fd-util: introduce fd_validate() helper
It just uses F_GETFD to validate an fd. it's a bit easier to read
though, and handles the < 0 case internally.
2024-10-08 13:13:44 +02:00
Yu Watanabe
223a67e572 tree-wide: replace reallocarray() with GREEDY_REALLOC() 2024-10-08 19:56:09 +09:00
Yu Watanabe
5f9f38b8df sd-bus: introduce bus_process_cmsg()
- Close all fds on failure.
- Close pidfd on success.
2024-10-08 19:56:00 +09:00
Yu Watanabe
483db6867a analyze: use RET_GATHER() 2024-10-08 19:36:50 +09:00
Yu Watanabe
25999f868f test: add test cases for timestamp with time zone 2024-10-08 19:36:38 +09:00
Yu Watanabe
6d3012bab4 time-util: copy input string before fork()
Fixes #34670.
2024-10-08 19:15:54 +09:00
Yu Watanabe
eb87d3e1e9 time-util: fix parsing timestamp with NZ timezone
Fixes a bug caused by ef658a63f8.
2024-10-08 19:15:00 +09:00
Lennart Poettering
86eb9b4f38 resolved: use SOCKADDR_LEN() where appropriate 2024-10-08 12:09:34 +02:00
Lennart Poettering
5699e4c2d4 resolved: fix fastopen fallback
We should not invalidate the socket address size before we use it.

Fixes: #34579
2024-10-08 12:09:34 +02:00
Yu Watanabe
9f0d2d64cc core: use memdup_suffix0() at one more place 2024-10-08 14:43:23 +09:00
Yu Watanabe
858eac353b prioq: use GREEDY_REALLOC() and structured initializer
No functional change, just refactoring.
2024-10-08 14:43:23 +09:00
Yu Watanabe
bf34d642bc
Merge pull request #34669 from bluca/semaphore
Update mkosi debian ref and try to speed up semaphore build
2024-10-08 14:42:26 +09:00
Luca Boccassi
0d7f5a9ae6 mkosi: mark test as skipped when QEMU crashes
On Ubuntu/Debian infrastructure QEMU crashes a lot, so mark the test
as skipped in that case as there's nothing we can do about it and
we shouldn't mark runs as failed
2024-10-07 23:58:38 +01:00
Luca Boccassi
d58a904d35 semaphore: do not build docs
There are other CI runs that build manpages, speed up build which is close to 1hr limit
2024-10-07 19:40:58 +01:00
Luca Boccassi
3bc5480bac semaphore: stop building and running extra unit tests
This slows down the build, which is often near the 1hr limit. There are
other jobs running the extra unit tests.
2024-10-07 19:38:45 +01:00
Luca Boccassi
ee2d86bd52 mkosi: update debian commit reference
* 51389fefca Upstream profile: skip dh_strip_nondeterminism
* 647fd0d40c Install kernel-install uki.conf example
* ddfeb24f55 autopkgtest: skip gdm3 on armel for smoke tests
2024-10-07 19:38:45 +01:00
Ryan Wilson
3543456f84 Add ExtraFileDescriptor property to StartTransientUnit dbus API
This adds the ExtraFileDescriptor property to StartTransient dbus API
with format "a(hs)" - array of (file descriptor, name) pairs. The FD
will be passed to the unit via sd_notify like Socket and OpenFile.

systemctl show also shows ExtraFileDescriptorName for these transient
units. We only show the name passed to dbus as the FD numbers will
change once passed over the unix socket and are duplicated, so its
confusing to display the numbers.

We do not add this functionality for systemd-run or general systemd
service units as it is not useful for general systemd services.
Arguably, it could be useful for systemd-run in bash scripts but we
prefer to be cautious and not expose the API yet.

Fixes: #34396
2024-10-07 09:01:48 -07:00
Daan De Meyer
a417592b06
Merge pull request #34472 from ikruglov/ikruglov/io-systemd-Machine
machine: implement varlink interfaces io.systemd.Machine.{List, Unregister, Terminate, Kill}
2024-10-07 17:22:31 +02:00