1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00
Commit Graph

70676 Commits

Author SHA1 Message Date
nl6720
934288757c tree-wide: link to docs.kernel.org for kernel documentation
https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
These URLs are shorter and nicer looking.
2024-01-22 10:50:33 +00:00
Andika Triwidada
0c27049007 po: Translated using Weblate (Indonesian)
Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/id/
Translation: systemd/main
2024-01-22 10:15:22 +01:00
Adrian Vovk
720c618397 core: path: Re-enter waiting if target is deactivating
Previously, path units would remain in the running state while their
target unit is deactivating. This left a window of time where the target
unit is no longer operational (i.e. it is busy deactivating/cleaning
up/etc) but the path unit would continue to ignore inotify events. In
short: any inotify event that occurs while the target unit deactivates
would be completely lost.

With this commit, the path will go back into a waiting state when the
target unit starts deactivating. This means that any inotify event that
occurs while the target unit deactivates will queue a start job.
2024-01-21 10:34:45 +00:00
Yu Watanabe
1c62c4fe0b network/route: update MTU of IPv6 route even if the kernel returns -EEXIST 2024-01-20 22:17:26 +09:00
Mike Yuan
696f5da420
Merge pull request #31004 from AdrianVovk/misc-cleanups
Misc cleanups
2024-01-20 16:43:20 +08:00
Yu Watanabe
c29138697d test-local-addresses: add more test cases 2024-01-20 16:07:19 +09:00
Yu Watanabe
e5ee645344 local-addresses: introduce has_local_address() helper function
It will be used later.
2024-01-20 16:07:19 +09:00
Yu Watanabe
d10311f407 sd-netlink: drop unused parser for RTA_MULTIPATH 2024-01-20 16:07:19 +09:00
Yu Watanabe
16d95d6ff8 local-addresses: introduce own parser for RTA_MULTIPATH 2024-01-20 16:07:19 +09:00
Yu Watanabe
eb1f9ed6a0 local-addresses: also save weight of multipath routes 2024-01-20 16:07:19 +09:00
Yu Watanabe
0b2c0c3159 local-addresses: introduce generic setter add_local_addresses_full() 2024-01-20 16:07:19 +09:00
Yu Watanabe
1305fe4ecf local-addresses: RTA_OIF and RTA_MULTIPATH are exclusive 2024-01-20 16:07:19 +09:00
Yu Watanabe
4019bec852 local-addresses: fix memleak of 'multipath_routes'
Also reduces scopes of some variables.
2024-01-20 16:07:19 +09:00
Yu Watanabe
a64f60416c local-addresses: always sort and dedup even if addresses are not requested
Otherwise, the return value may different when ret is NULL or not.
2024-01-20 16:07:19 +09:00
Yu Watanabe
e90863f231 local-addresses: ignore tentative addresses
As tentative addresses may be dropped soon if DAD failed.
2024-01-20 16:07:19 +09:00
Yu Watanabe
5cb56068d0 local-addresses: check family more
Just for safety. No functional change, unless the kernel sends broken
messages.
2024-01-20 16:07:19 +09:00
Yu Watanabe
37359b1c81 local-addresses: rename metric -> priority
To make it consistent with the netlink attribute RTA_PRIORITY.
2024-01-20 16:07:19 +09:00
Yu Watanabe
d8a3e44a5c test-local-addresses: several modernization
- use size_t for number of addresses,
- use FOREACH_ARRAY() macro,
- use IN_ADDR_TO_STRING() macro, etc.
2024-01-20 16:07:19 +09:00
Lennart Poettering
e4924fb0d1 ptyfwd: when leaving a session with tinted background, clear to end of screen
So if we tint the background of a ptyfwd session with a color and the
session ends, then so far we reset the bg color and clear till the end
of line.

Let's instead clear till the end of the screen. This is nicer since it
means that any follow-up output will not be affected by the changed
background color anymore.
2024-01-20 01:11:48 +00:00
Lennart Poettering
87da1af78f run: the --background= switch expects an argument
We got this right when running as "uid0", but wrong when invoked under
"systemd-run". Let's fix that.
2024-01-20 01:10:46 +00:00
Lennart Poettering
3cdfd6acf1
Merge pull request #31016 from poettering/pid1-priority-rework
pid1 event source priorities rework
2024-01-20 00:13:39 +01:00
Mike Yuan
017f53e192 loginctl: add --json= and -j to help text
Follow-up for ea54517476
2024-01-19 18:01:17 +00:00
Luca Boccassi
204d52c4b7 cgtop: fix sscanf return code checks
sscanf can return EOF on error, so check that we get a result instead.

CodeQL#2386 and CodeQL#2387
2024-01-19 18:00:23 +00:00
Luca Boccassi
201f6241ae
Merge pull request #31022 from aafeijoo-suse/bash-completion-cryptenroll-2
fix typo and add some missing options to bash-completion
2024-01-19 18:00:10 +00:00
Adrian Vovk
a15b9768ec
docs: Fix typo in USER_RECORD 2024-01-19 12:27:06 -05:00
Adrian Vovk
a1bdae3645
fd-util: Close function for FD_TO_PTR
Just a function to be used as a destructor (i.e. in a _cleanup_
attribute, hash table operations, etc.) that closes an fd wrapped in
FD_TO_PTR

It just retrieves the fd via PTR_TO_FD and closes it
2024-01-19 12:27:05 -05:00
Luca Boccassi
a0cca4d1b0 portable: log structured message when attach/detach succeeds
Currently portabled is completely silent (when not using debug level). But
when the system state is changed (ie: a portable is attached or detached)
there are no traces left in the journal. Log at info level when either of
those operations succeed, as they are effectively changing the state of
the system.

Create new MESSAGE_IDs for these logs, and also append PORTABLE_ROOT=
(and PORTABLE_EXTENSION= if any), like the units themselves are
configured to do via LogExtraFields=, so that the same metadata can
be found in the attach/detach messages and in logs from the units
themselves.
2024-01-19 17:03:04 +01:00
Luca Boccassi
c03a321ef6 man: clarify description of Attach/Detach flags 2024-01-19 15:56:18 +00:00
Lennart Poettering
9d2a292246 test: add integration test for Type=exec robustness
This tests for #30799, so that it does not return.
2024-01-19 16:51:55 +01:00
Lennart Poettering
8a69bf0c57 manager: order idle jobs
Let's put the run queue really the last spot, as we should only start
doing more work if we really have nothing else to do anymore.

Let's move the service watchdog after the rewatch PID logic for similar
logic: it will possibly result in new jobs being enqueued to stop
things, and we should really have done all other work first.
2024-01-19 16:46:28 +01:00
Lennart Poettering
90c40ea4bf manager: renumber priorities
no actual change, let's just make sure the priorities are densely
defined without "holes". Just to make this prettier and less surprising.
2024-01-19 16:46:28 +01:00
Lennart Poettering
f3a269a935 manager: process exec_fd (i.e. Type=exec) events before SIGCHLD events
We want to make sure we don't confuse the case "process started
successfully but then failed quickly" from the case "process failed to
start". Hence we need to make sure we take notice of Type=exec before we
bother with SIGCHLD.

Hence move EVENT_PRIORITY_EXEC_FD to the front. In fact, let's move it
even further up than SIGCHLD, i.e. before sd_notify() handling, so that
we don't end up processing service state change notifications before we
even considered that the service is properly started.

This also gives the cgroup OOM handling and the exec_fd handling
different priorities, to improve robustness of the system, we should act
quickly on OOM, and it doesn't matter if a service started succcessfully
if we have to act on OOM anyway.

This is based on Andrew Onyshchuk <andryk.rv@gmail.com> work here:

See: #30799
Fixes: #28304
2024-01-19 16:46:28 +01:00
Lennart Poettering
d42b61d279 core: maintain a single table with event source priorities
It's hard to oversee the assigned processing priorities of the various
event sources we have. Let's unify them in a table (an enum), where we
can have a single consisten look at them, and then reference the table
entries by expressive symbols.

This doesn#t change behaviour in any way, it just gives each priority a
nice label, but doesn't change any of the priorities.

Prompted by: #30799
2024-01-19 16:46:28 +01:00
Nick Rosbrook
6327d30224 test: skip a systemd-run test if unprivileged userns is restricted
With newer versions of AppArmor, unprivileged user namespace creation
may be restricted by default, in which case user manager instances will
not be able to apply PrivateUsers=yes, which is implied by
PrivateTmp=yes in this systemd-run invocation.
2024-01-19 10:21:57 -05:00
Antonio Alvarez Feijoo
08c0b6efd8
dissect: fix typo 2024-01-19 16:01:13 +01:00
Antonio Alvarez Feijoo
43aaa1b3d3
bash-completion: add missing options to systemd-dissect 2024-01-19 15:50:15 +01:00
Antonio Alvarez Feijoo
c13d9199d6
bash-completion: add missing options to systemd-cryptenroll 2024-01-19 15:49:52 +01:00
Yu Watanabe
fe0c684b34 network: fix typo
Follow-up for 406fde1a4d.
2024-01-19 23:28:03 +09:00
Lennart Poettering
eb47cb6986
Merge pull request #31012 from YHNdnzj/pam-systemd-session-busy
pam_systemd: always check if session is busy
2024-01-19 15:08:37 +01:00
Lennart Poettering
f145216005
Merge pull request #31013 from YHNdnzj/logind-modernization-split
logind: minor modernizations
2024-01-19 15:06:17 +01:00
Luca Boccassi
b26be60efc
Merge pull request #31009 from yuwata/network-route-convert-before-requesting
network/route: convert routes before requesting
2024-01-19 13:20:32 +00:00
Mike Yuan
ef9eb646e5
logind-dbus: use SESSION_IS_{SELF,AUTO} instead of SEAT_* for sessions 2024-01-19 20:12:31 +08:00
Mike Yuan
f6e4b1e0af
logind-user: use RET_GATHER more 2024-01-19 20:12:31 +08:00
Mike Yuan
2948803177
pam_systemd: always check if session is busy
We need to check for BUS_ERROR_SESSION_BUSY no matter
whether pidfd is used, i.e. after we retry with
CreateSession().
2024-01-19 20:08:39 +08:00
Mike Yuan
79f36b6415
pam_systemd: close pidfd after use 2024-01-19 20:08:39 +08:00
Clayton Craft
fb7a902aed boot: don't print error if device tree fixup protocol isn't supported
This isn't a failure we care about, and it's somewhat alarming to see a
red error message flash up on the display when booting, so this just
simply returns EFI_SUCCESS and skips printing the "error" altogether.
2024-01-19 11:43:19 +00:00
Luca Boccassi
0d2e660d84
Merge pull request #30956 from yuwata/nspawn-network-pass-wifi
nspawn: support passing wireless interface to container
2024-01-19 11:41:58 +00:00
Frantisek Sumsal
b9f880d528 journalctl: consider shut down namespaced sd-journald instance synced
If the namespaced systemd-journald instance was shut down due to
inactivity, we can consider it synchronized, so avoid throwing an error
in such case.

This should help with the random TEST-44-LOG-NAMESPACE fails where we
might try to sync the namespace just after it was shut down:

[    7.682941] H testsuite-44.sh[381]: + systemd-run --wait -p LogNamespace=foobaz echo 'hello world'
[    7.693916] H systemd-journald[389]: Failed to open /dev/kmsg, ignoring: Operation not permitted
[    7.693983] H systemd-journald[389]: Collecting audit messages is disabled.
[    7.725511] H systemd[1]: Started systemd-journald@foobar.service.
[    7.726496] H systemd[1]: Listening on systemd-journald-varlink@foobaz.socket.
[    7.726808] H systemd[1]: Listening on systemd-journald@foobaz.socket.
[    7.750774] H systemd[1]: Started run-u3.service.
[    7.795122] H systemd[1]: run-u3.service: Deactivated successfully.
[    7.842042] H testsuite-44.sh[390]: Running as unit: run-u3.service; invocation ID: 56380adeb36940a8a170d9ffd2e1e433
[    7.842561] H systemd[1]: systemd-journald-varlink@foobaz.socket: Deactivated successfully.
[    7.842762] H systemd[1]: Closed systemd-journald-varlink@foobaz.socket.
[    7.846394] H systemd[1]: systemd-journald@foobaz.socket: Deactivated successfully.
[    7.846566] H systemd[1]: Closed systemd-journald@foobaz.socket.
[    7.852983] H testsuite-44.sh[390]: Finished with result: success
[    7.852983] H testsuite-44.sh[390]: Main processes terminated with: code=exited/status=0
[    7.852983] H testsuite-44.sh[390]: Service runtime: 44ms
[    7.852983] H testsuite-44.sh[390]: CPU time consumed: 8ms
[    7.852983] H testsuite-44.sh[390]: Memory peak: 880.0K
[    7.852983] H testsuite-44.sh[390]: Memory swap peak: 0B
[    7.853785] H testsuite-44.sh[381]: + journalctl --namespace=foobar --sync
[    7.860095] H systemd-journald[389]: Received client request to sync journal.
[    7.862119] H testsuite-44.sh[381]: + journalctl --namespace=foobaz --sync
[    7.868381] H journalctl[396]: Failed to connect to /run/systemd/journal.foobaz/io.systemd.journal: Connection refused
[    7.871498] H systemd[1]: testsuite-44.service: Main process exited, code=exited, status=1/FAILURE
[    7.871642] H systemd[1]: testsuite-44.service: Failed with result 'exit-code'.
[    7.930772] H systemd[1]: Failed to start testsuite-44.service.
2024-01-19 11:41:34 +00:00
Yu Watanabe
cfe8975a37 network/route-nexthop: configure as a simple gateway when MultipathRoute= is specified only once
The kernel handles such configuration completely equivalent to the case
that Gateway= is specified.
2024-01-19 19:20:29 +09:00
Yu Watanabe
e217da1380 network/route: drop unnecessary ownership transfer
Let's free Route objects on the caller side.
2024-01-19 19:20:29 +09:00