Georges Basile Stavracas Neto [Mon, 14 Mar 2022 13:50:45 +0000 (10:50 -0300)]
hwdb: Add AV production access to Elgado Stream Deck devices
The Stream Deck products from Elgato are simple key pads
intended to be used as macro pads. They're popular within
the streaming community.
This commit adds all 5 Stream Deck variants available to
the AV production file.
See https://www.elgato.com/en/stream-deck
Be [Sat, 28 Aug 2021 03:30:50 +0000 (22:30 -0500)]
Add AV production controllers to hwdb and add uaccess
This adds support for AV production controller devices, such
as DJ tables, music-oriented key pads, and others.
The USB vendor and product IDs come from Mixxx, Ctlra, and
Ardour.
Fixes #20533
Co-developed-by: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Yu Watanabe [Mon, 14 Mar 2022 01:59:13 +0000 (10:59 +0900)]
Merge pull request #22721 from mrc0mmand/journalctl-tweaks
journal: convert --list-boots to a table
Frantisek Sumsal [Sun, 13 Mar 2022 19:32:18 +0000 (20:32 +0100)]
test: extend format-table tests with negative numbers
Yu Watanabe [Sun, 13 Mar 2022 13:33:27 +0000 (22:33 +0900)]
man: replace full stop with colon
Fixes #22724.
Frantisek Sumsal [Sat, 12 Mar 2022 19:37:16 +0000 (20:37 +0100)]
journal: convert --list-boots to a table
so it can be output as JSON as well.
```
$ build-san/journalctl --list-boots --file boot-test.journal
IDX BOOT ID FIRST ENTRY LAST ENTRY
-3
39d66eb1925f4d01b8464d502650a714 Sat 2022-03-05 15:20:33 CET Sat 2022-03-05 16:19:21 CET
-2
5dffeb08a27344d5ae9e2fc244bbcbc5 Fri 2022-03-11 17:23:57 CET Fri 2022-03-11 17:38:31 CET
-1
c8ebd52915b642c39eda4bf00f864f79 Fri 2022-03-11 17:38:41 CET Fri 2022-03-11 20:03:46 CET
0
00bcba97c7094fa88cc5d1cf2a389057 Sat 2022-03-12 20:39:08 CET Sat 2022-03-12 20:40:18 CET
$ build-san/journalctl --list-boots --file boot-test.journal -q
-3
39d66eb1925f4d01b8464d502650a714 Sat 2022-03-05 15:20:33 CET Sat 2022-03-05 16:19:21 CET
-2
5dffeb08a27344d5ae9e2fc244bbcbc5 Fri 2022-03-11 17:23:57 CET Fri 2022-03-11 17:38:31 CET
-1
c8ebd52915b642c39eda4bf00f864f79 Fri 2022-03-11 17:38:41 CET Fri 2022-03-11 20:03:46 CET
0
00bcba97c7094fa88cc5d1cf2a389057 Sat 2022-03-12 20:39:08 CET Sat 2022-03-12 20:40:18 CET
$ build-san/journalctl --list-boots --file boot-test.journal -o json-pretty
[
{
"index" : -3,
"boot_id" : "
39d66eb1925f4d01b8464d502650a714",
"first_entry" :
1646490033438495,
"last_entry" :
1646493561047353
},
{
"index" : -2,
"boot_id" : "
5dffeb08a27344d5ae9e2fc244bbcbc5",
"first_entry" :
1647015837289036,
"last_entry" :
1647016711595489
},
{
"index" : -1,
"boot_id" : "
c8ebd52915b642c39eda4bf00f864f79",
"first_entry" :
1647016721056382,
"last_entry" :
1647025426397414
},
{
"index" : 0,
"boot_id" : "
00bcba97c7094fa88cc5d1cf2a389057",
"first_entry" :
1647113948506002,
"last_entry" :
1647114018943637
}
]
```
Resolves: #14625
Frantisek Sumsal [Sun, 13 Mar 2022 13:45:03 +0000 (14:45 +0100)]
macro: account for negative values in DECIMAL_STR_WIDTH()
With negative numbers we wouldn't account for the minus sign, thus
returning a string with one character too short, triggering buffer
overflows in certain situations.
Yu Watanabe [Sun, 13 Mar 2022 09:34:39 +0000 (18:34 +0900)]
doc: fix error code
Frantisek Sumsal [Sat, 12 Mar 2022 11:17:46 +0000 (12:17 +0100)]
time-util: support parsing OUTPUT_SHORT and OUTPUT_SHORT_PRECISE timestamps
so we can feed journalctl the localized syslog-style timestamps it shows
by default, e.g.:
```
$ LANG=cs_CZ.utf-8 build-san/journalctl -b --no-hostname | head -n1
led 30 22:13:54 systemd-journald[981]: System Journal (/var/log/journal/
1588e1d9d0b74acdbaada907b163b837) is 4.1G, max 4.0G, 0B free.
$ LANG=cs_CZ.utf-8 build-san/journalctl --no-hostname --since 'led 30 22:13:54' -n1
led 30 22:13:54 systemd-journald[981]: System Journal (/var/log/journal/
1588e1d9d0b74acdbaada907b163b837) is 4.1G, max 4.0G, 0B free.
$ LANG=cs_CZ.utf-8 build-san/journalctl --no-hostname --since 'led 30 22:13:54.9999' -n1
led 30 22:13:58 rsyslogd[1300]: imjournal: journal files changed, reloading... [v8.2102.0-4.fc35 try https://www.rsyslog.com/e/0 ]
```
Resolves: #15899
Luca Boccassi [Sat, 12 Mar 2022 17:17:28 +0000 (17:17 +0000)]
Merge pull request #22463 from poettering/kernel-install-propagate-machine-id
kernel-install: clean-up machine-id handling
Yu Watanabe [Sat, 12 Mar 2022 05:27:48 +0000 (14:27 +0900)]
Merge pull request #22711 from yuwata/c11
move to C11 (gnu11) and use u8 specifier for special characters
Luca Boccassi [Fri, 11 Mar 2022 19:03:38 +0000 (19:03 +0000)]
Merge pull request #22714 from mrc0mmand/codeql-docs
A couple of doc updates
Frantisek Sumsal [Fri, 11 Mar 2022 15:55:55 +0000 (16:55 +0100)]
resolve: update the referenced RFC & section for mDNS
Resolves: #20386
Frantisek Sumsal [Fri, 11 Mar 2022 15:51:53 +0000 (16:51 +0100)]
test: document how to run CodeQL/LGTM stuff manually
Let's have this documented somewhere so I don't have to relearn all this
stuff every time I need it.
Luca Boccassi [Fri, 11 Mar 2022 10:48:45 +0000 (10:48 +0000)]
Merge pull request #22631 from yuwata/network-redesign-request-queue
network: re-design request queue
Lennart Poettering [Tue, 15 Feb 2022 16:59:36 +0000 (17:59 +0100)]
NEWS: add NEWS entry highlighting what the "entry-token" logic means for "gold image" builders
Lennart Poettering [Thu, 10 Feb 2022 17:01:36 +0000 (18:01 +0100)]
bootctl: update to new kernel-install semantics
This makes a bunch of closely related changes:
1. The "entry-token" concept already introduced in kernel-install is now
made use of. i.e. specifically there's a new option --entry-token=
that can be used to explicitly select by which ID to identify boot
loader entries: the machine ID, or some OS ID (ID= or IMAGE_ID= from
/etc/os-release, or even some completely different string. The
selected string is then persisted to /etc/kernel/entry-token, so that
kernel-install can find it there.
2. The --make-machine-id-directory= switch is renamed to
--make-entry-directory= since after all it's not necessarily the
machine ID the dir is named after, but can be any other string as
selected by the entry token.
3. This drops all code to make automatic changes to /etc/machine-info.
Specifically, the KERNEL_INSTALL_MACHINE_ID= field is now more
generically implemented in /etc/kernel/entry-token described above,
hence no need to place it at two locations. And the
KERNEL_INSTALL_LAYOUT= field is not configurable by user switch or
similar anyway in bootctl, but only read from
/etc/kernel/install.conf, and hence copying it from one configuration
file to another appears unnecessary, the second copy is fully
redundant. Note that this just drops writing these fields, they'll
still be honoured when already set.
Lennart Poettering [Thu, 10 Feb 2022 14:27:45 +0000 (15:27 +0100)]
man: document recent changes
This drops documentation of KERNEL_INSTALL_MACHINE_ID as machine-info
field (though we'll still read it for compat).
This updates the kernel-install man page to always say "ENTRY-TOKEN"
instead of "MACHINE-ID" where appropriate, to clear the confusion up
between the two.
This also tries to fix how we denote env vars (always prefix with $ and
without = suffix), and other vars (without $ but with = suffix)
Other fixes.
Lennart Poettering [Thu, 10 Feb 2022 13:37:37 +0000 (14:37 +0100)]
kernel-install: add new "inspect" verb, showing paths and parameters we discovered
Lennart Poettering [Thu, 10 Feb 2022 13:27:22 +0000 (14:27 +0100)]
kernel-install: search harder for kernel image/initrd drop-in dir
If not explicitly configured, let's search a bit harder for the
ENTRY_TOKEN, and let's try the machine ID, the IMAGE_ID and ID fields of
/etc/os-release and finally "Default", all below potential $XBOOTLDR.
Lennart Poettering [Wed, 9 Feb 2022 13:44:48 +0000 (14:44 +0100)]
kernel-install: only generate systemd.boot_id= in kernel command line if used for naming the boot loader spec files/dirs
Now that we can distinguish the naming of the boot loader spec
dirs/files and the machine ID let's tweak the logic for suffixing the
kernel cmdline with systemd.boot_id=: let's only do that when we
actually need the boot ID for naming these dirs/files. If we don't,
let's not bother.
This should be beneficial for "golden" images that shall not carry any
machine IDs at all, i.e acquire their identity only once the final
userspace is actually reached.
Lennart Poettering [Wed, 9 Feb 2022 13:29:19 +0000 (14:29 +0100)]
kernel-install: add a new $ENTRY_TOKEN variable for naming boot entries
This cleans up naming of boot loader spec boot entries a bit (i.e. the
naming of the .conf snippet files, and the directory in $BOOT where the
kernel images and initrds are placed), and isolates it from the actual machine
ID concept.
Previously there was a sinlge concept for both things, because typically
the entries are just named after the machine ID. However one could also
use a different identifier, i.e. not a 128bit ID in which cases issues
pop up everywhere. For example, the "machine-id" field in the generated
snippets would not be a machine ID anymore, and the newly added
systemd.machine_id= kernel parameter would possibly get passed invalid
data.
Hence clean this up:
$MACHINE_ID → always a valid 128bit ID.
$ENTRY_TOKEN → usually the $MACHINE_ID but can be any other string too.
This is used to name the directory to put kernels/initrds in. It's also
used for naming the *.conf snippets that implement the Boot Loader Type
1 spec.
Lennart Poettering [Wed, 9 Feb 2022 12:59:36 +0000 (13:59 +0100)]
kernel-install: don't try to persist used machine ID locally
This reworks the how machine ID used by the boot loader spec snippet
generation logic. Instead of persisting it automatically to /etc/ we'll
append it via systemd.machined_id= to the kernel command line, and thus
persist it in the generated boot loader spec snippets instead. This has
nice benefits:
1. We do not collide with read-only root
2. The machine ID remains stable across factory reset, so that we can
safely recognize the path in $BOOT we drop our kernel images in
again, i.e. kernel updates will work correctly and safely across
kernel factory resets.
3. Previously regular systems had different machine IDs while in
initrd and after booting into the host system. With this change
they will now have the same.
This then drops implicit persisting of KERNEL_INSTALL_MACHINE_ID, as its
unnecessary then. The field is still honoured though, for compat
reasons.
This also drops the "Default" fallback previously used, as it actually
is without effect, the randomized ID generation already took precedence
in all cases. This means $MACHNE_ID/KERNEL_INSTALL_MACHINE_ID are now
guaranteed to look like a proper machine ID, which is useful for us,
given you need it that way to be able to pass it to the
systemd.machine_id= kernel command line option.
Lennart Poettering [Fri, 11 Mar 2022 10:33:07 +0000 (11:33 +0100)]
Merge pull request #22618 from yuwata/network-safe-string
network: dhcp-server: refuse unsafe filename
Marcel Hellwig [Fri, 11 Mar 2022 07:23:45 +0000 (08:23 +0100)]
fix signature of sd_journal_print_with_location in docs
Clyde Byrd III [Fri, 11 Mar 2022 01:43:26 +0000 (17:43 -0800)]
gitignore: ignore mkosi.installdir
Yu Watanabe [Fri, 11 Mar 2022 08:19:29 +0000 (17:19 +0900)]
lgtm: disable cpp/missing-return
As it does not handle assert_not_reahed() gracefully.
Yu Watanabe [Fri, 11 Mar 2022 06:59:58 +0000 (15:59 +0900)]
qrcode-util: use u8 literal specifier
Yu Watanabe [Fri, 11 Mar 2022 06:53:18 +0000 (15:53 +0900)]
hostnamectl: use u8 literal specifier
Yu Watanabe [Fri, 11 Mar 2022 06:34:27 +0000 (15:34 +0900)]
glyph-util: use u8 literal specifier for special characters
Yu Watanabe [Fri, 11 Mar 2022 06:13:23 +0000 (15:13 +0900)]
meson: move to c_std=gnu11
Recently, the kernel communitiy started to discuss to move C11 (gnu11) [1],
and it seems to come near future.
Let's also move to c_std=gnu11. Unlike the kernel, we already uses
gnu99, hence hopefully we can move to C11 without changing anything.
[1] https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/
Yu Watanabe [Mon, 28 Feb 2022 01:55:51 +0000 (10:55 +0900)]
network: re-design request queue
This makes Request object takes hash, compare, free, and process functions.
With this change, the logic in networkd-queue.c can be mostly
independent of the type of the request or the object (e.g. Address) assigned
to the request, and it becomes simpler.
Yu Watanabe [Mon, 28 Feb 2022 02:21:24 +0000 (11:21 +0900)]
network: increment reference counters of Link and Request before processing requests
To prevent the request or link is freed while processing requests.
Yu Watanabe [Mon, 28 Feb 2022 02:03:11 +0000 (11:03 +0900)]
network: merge RequestType and SetLinkOperation
These two enum indicate how we process the request. Hence, it is not
necessary to introduce two separated indicators.
Yu Watanabe [Mon, 28 Feb 2022 02:15:01 +0000 (11:15 +0900)]
network: refuse to configure link properties when in initialized state
The condition should be satisfied only when users request to reconfigure
the link, and in that case, all request will be cancelled. Hence, it is
not necessary to process the request.
Yu Watanabe [Mon, 28 Feb 2022 02:00:56 +0000 (11:00 +0900)]
network: drop unnecessary link_enter_failed()
As returning negative errno makes the link will enter the failed state.
Yu Watanabe [Mon, 28 Feb 2022 00:20:42 +0000 (09:20 +0900)]
network: introduce request_call_netlink_async()
In most netlink handlers, we do the following,
1. decrease the message counter,
2. check the link state,
3. error handling,
4. update link state via e.g. link_check_ready().
The first two steps are mostly common, hence let's extract it.
Moreover, this is not only extracting the common logic, but provide a
strong advantage; `request_call_netlink_async()` assigns the relevant
Request object to the userdata of the netlink slot, and the request object
has full information about the message we sent. Hence, in the future,
netlink handler can print more detailed error message. E.g. when
an address is failed to configure, then currently we only show an
address is failed to configure, but with this commit, potentially we can
show which address is failed explicitly.
This does not change such error handling yet. But let's do that later.
Yu Watanabe [Sun, 27 Feb 2022 06:39:16 +0000 (15:39 +0900)]
network: make Request object take Manager*
Previously, even though all Request object are owned by Manager, they
do not have direct reference to Manager, but through Link or NetDev
object. But, as Link or NetDev can be NULL, we need to conditionalize
how to access Manager from Request with the type of the request.
This makes the way simpler, as now Request object has direct reference
to Manager.
This also rename request_drop() -> request_detach(), as in the previous
commit, the reference counter is introduced, so even if a reference of
a Request object from Manager is dropped, the object may still alive.
The naming `request_drop()` sounds the object will freed by the
function. But it may not. And `request_detach()` suggests the object
will not be managed by Manager any more, and I think it is more
appropreate.
This is just a cleanup, and should not change any behavior.
Yu Watanabe [Sun, 27 Feb 2022 06:18:01 +0000 (15:18 +0900)]
network: introduce reference counter for Request object
Currently, all Request object are always owned by Manager, and freed
when it is processed, especially, soon after a netlink message is sent.
So, it is not necessary to introduce the reference counter.
In a later commit, the Request object will _not_ be freed at the time
when a netlink message is sent, but assigned to the relevant netlink
slot as a userdata, and will be freed when a reply is received. So, the
owner of the Request object is changed in its lifetime. In that case, it
is convenient that the object has reference counter to avoid memleak or
double free.
Yu Watanabe [Sat, 26 Feb 2022 06:56:39 +0000 (15:56 +0900)]
network: make request_process_address() and friends take Link and corresponding object
This also renames e.g. request_process_address() -> address_process_request().
Also, this drops type checks such as `assert(req->type == REQUEST_TYPE_ADDRESS)`,
as in the later commits, the function of processing request, e.g.
`address_process_request()`, will be assigned to the Request object when
it is created. And the request type will be used to distinguish and to
avoid deduplicating requests which do not have any assigned objects,
like REQUEST_TYPE_DHCP4_CLIENT. Hence, the type checks in process functions
are mostly not necessary and redundant.
This is mostly cleanups and preparation for later commits, and should
not change any behavior.
Yu Watanabe [Fri, 11 Mar 2022 01:40:59 +0000 (10:40 +0900)]
network: make address_configure() and friends take Request object
This should not change any behavior.
Just a preparation for a later commit which introduces
request_call_netlink_async().
Yu Watanabe [Fri, 11 Mar 2022 01:38:59 +0000 (10:38 +0900)]
network: tc: assign netlink handlers into Request object
This should not change any behavior, as req->netlink_handler is always
qdisc_handler or tclass_handler.
This is just a preparation for a later commit which introduces
request_call_netlink_async().
Yu Watanabe [Fri, 18 Feb 2022 06:24:23 +0000 (15:24 +0900)]
alloc-util: introduce mfree_func_type_t
Yu Watanabe [Mon, 7 Mar 2022 10:57:09 +0000 (19:57 +0900)]
network: dhcp: rename NextServer= and Filename= settings
And make the settings configures DHCP option 66 and 67.
Follow-ups for #22615.
Fixes #22661.
Luca Boccassi [Fri, 11 Mar 2022 01:09:33 +0000 (01:09 +0000)]
Merge pull request #22701 from poettering/raise-memlock
pid1/nspawn: raise RLIMIT_MEMLOCK to 8M matching kernel 5.16's new default
Clyde Byrd III [Thu, 10 Mar 2022 08:47:20 +0000 (00:47 -0800)]
core/dbus-job: Use new way of specifying sd-bus vtable parameter names
Lennart Poettering [Thu, 10 Mar 2022 17:20:11 +0000 (18:20 +0100)]
hostname-util: normalize get_pretty_hostname() call semantics
get_pretty_hostname() so far had semantics not in line with our usual
ones: the return parameter was actually freed before the return string
written into it, because that's what parse_env_file() does. Moreover,
when the value was not set it would return NULL but succeed.
Let's normalize this, and only fill in the return value if there's
something set, and never read from it, like we usually do with return
parameter, and in particular those named "ret_xyz".
The existing callers don't really care about the differences, but it's
nicer to normalize behaviour to minimize surprises.
Luca Boccassi [Thu, 10 Mar 2022 21:45:34 +0000 (21:45 +0000)]
Merge pull request #22705 from mrc0mmand/pretty_hostname_specifier
core: introduce %R specifier for pretty hostname
Frantisek Sumsal [Thu, 10 Mar 2022 14:18:45 +0000 (15:18 +0100)]
cgls: mangle user-provided unit names
so the CLI interface is now similar to `systemctl`, i.e. if no unit name
suffix is provided, assume `.service`.
Fixes: #20492
Before:
```
$ systemd-cgls --unit user@1000
Failed to query unit control group path: Invalid argument
Failed to list cgroup tree: Invalid argument
```
After:
```
$ build/systemd-cgls --unit user@1000
Unit user@1000.service (/user.slice/user-1000.slice/user@1000.service):
├─session.slice (#4939)
│ ├─pipewire-pulse.service (#5203)
│ │ └─7711 /usr/bin/pipewire-pulse
...
```
Luca Boccassi [Thu, 10 Mar 2022 01:30:08 +0000 (01:30 +0000)]
core: support ExtensionDirectories in user manager
Unprivileged overlayfs is supported since Linux 5.11. The only
change needed to get ExtensionDirectories to work is to avoid
hard-coding the staging directory to the system manager runtime
directory, everything else just works (TM).
Temuri Doghonadze [Thu, 10 Mar 2022 18:17:00 +0000 (19:17 +0100)]
po: Translated using Weblate (Georgian)
Currently translated at 100.0% (189 of 189 strings)
Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ka/
Translation: systemd/main
Frantisek Sumsal [Thu, 10 Mar 2022 15:15:54 +0000 (16:15 +0100)]
core: introduce %R specifier for pretty hostname
Resolves: #20054
Lennart Poettering [Thu, 10 Mar 2022 17:34:20 +0000 (18:34 +0100)]
Merge pull request #22460 from bluca/monitor_refactor
core: split $MONITOR_METADATA and return it only if a single unit triggers OnFailure/OnSuccess
Lennart Poettering [Thu, 10 Mar 2022 12:22:57 +0000 (13:22 +0100)]
pid1,nspawn: raise default RLIMIT_MEMLOCK to 8M
This mirrors a similar check in Linux kernel 5.16
(
9dcc38e2813e0cd3b195940c98b181ce6ede8f20) that raised the
RLIMIT_MEMLOCK to 8M.
This change does two things: raise the default limit for nspawn
containers (where we try to mimic closely what the kernel does), and
bump it when running on old kernels which still have the lower setting.
Fixes: #16300
See: https://lwn.net/Articles/876288/
Lennart Poettering [Thu, 10 Mar 2022 12:22:32 +0000 (13:22 +0100)]
main: add 'const' on two function arguments
Luca Boccassi [Thu, 10 Mar 2022 17:25:44 +0000 (17:25 +0000)]
Merge pull request #22682 from bluca/start_skip
core: do not return 'skipped' when Condition*= fail with StartUnitWithFlags()
Luca Boccassi [Thu, 10 Mar 2022 16:42:50 +0000 (16:42 +0000)]
Merge pull request #22695 from poettering/crash-handle-refactor
pid1: add comment clarifying not to use memory allocation from crash handler
Frantisek Sumsal [Thu, 10 Mar 2022 16:14:04 +0000 (17:14 +0100)]
core: be a bit more defensive when resolving specifiers
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.
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.
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.
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.
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 10:33:07 +0000 (11:33 +0100)]
manager: log how many OnSuccess/OnFailure jobs were started
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 10:33:28 +0000 (11:33 +0100)]
manager: adjust comment
Zbigniew Jędrzejewski-Szmek [Tue, 1 Mar 2022 12:03:31 +0000 (13:03 +0100)]
various: align vertically for ease of reading
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.
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 ;)
Luca Boccassi [Wed, 9 Feb 2022 11:58:30 +0000 (11:58 +0000)]
NEWS: note backward-incompatible MONITOR_METADATA change
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
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
Luca Boccassi [Tue, 8 Mar 2022 22:16:29 +0000 (22:16 +0000)]
NEWS: note backward-incompatible change in StartUnitWithFlags()
Luca Boccassi [Tue, 8 Mar 2022 22:13:37 +0000 (22:13 +0000)]
core: do not return 'skipped' when Condition*= fail with StartUnitWithFlags()
Backward incompatible change to avoid returning 'skipped' if a condition causes
a job activation to be skipped when using StartUnitWithFlags().
Job results are broadcasted, so it is theoretically possible that existing
software could get confused if they see this result.
Replaces https://github.com/systemd/systemd/pull/22369
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
Lennart Poettering [Thu, 10 Mar 2022 08:33:05 +0000 (09:33 +0100)]
pid1: split out crash handler logic into its own .c/.h file
This stuff is sufficiently different from the rest of main.c, let's move
it to its own .c/.h file, to make main.c a bit shorter.
No code changes, just some refactoring.
Lennart Poettering [Thu, 10 Mar 2022 08:22:32 +0000 (09:22 +0100)]
pid1: add comment to crash handler about memory allocations
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
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.
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
Yu Watanabe [Mon, 7 Mar 2022 10:23:43 +0000 (19:23 +0900)]
dhcp: list all known message type
Yu Watanabe [Mon, 7 Mar 2022 10:17:05 +0000 (19:17 +0900)]
sd-dhcp6-client: rename timezone options
To make them follow corresponding DHCPv4 options.
Yu Watanabe [Mon, 7 Mar 2022 10:13:31 +0000 (19:13 +0900)]
dhcp: list all known DHCP options
Yu Watanabe [Thu, 10 Mar 2022 05:40:18 +0000 (14:40 +0900)]
conf-parser: introduce config_parse_dns_name() and config_parse_hostname()
This makes nspawn refuse hostnames which are invalid DNS domain names.
Yu Watanabe [Mon, 7 Mar 2022 06:45:17 +0000 (15:45 +0900)]
network: refuse string which contains non-safe or non-ascii characters for Filename=
The string will be used when the client load additional config file to
boot, and it must be a valid path or url. Hence, let's refuse non-safe or
non-characters.
Yu Watanabe [Mon, 7 Mar 2022 07:09:23 +0000 (16:09 +0900)]
conf-parser: introduce CONFIG_PARSE_STRING_ASCII flag
When the flag is set, the string which contains non-ascii characters
will be refused.
Yu Watanabe [Mon, 7 Mar 2022 06:39:07 +0000 (15:39 +0900)]
conf-parser: merge config_parse_string() and config_parse_safe_string()
This also makes unsafe strings escaped when logged. Otherwise,
journalctl may not show the log message unless '--all' is specified.
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
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.
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.
Lennart Poettering [Tue, 22 Feb 2022 12:24:40 +0000 (13:24 +0100)]
logind: drop unused prototype
Lennart Poettering [Tue, 22 Feb 2022 12:23:52 +0000 (13:23 +0100)]
logind: minor whitespace fix
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.
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.
Lennart Poettering [Wed, 9 Mar 2022 13:25:43 +0000 (14:25 +0100)]
update TODO
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.
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.
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
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
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.
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;
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.