]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agonetwork: make address_drop() accept NULL 17959/head
Yu Watanabe [Wed, 28 Oct 2020 09:09:51 +0000 (18:09 +0900)] 
network: make address_drop() accept NULL

4 years agonetwork: introduce log_address_debug()
Yu Watanabe [Wed, 28 Oct 2020 09:09:16 +0000 (18:09 +0900)] 
network: introduce log_address_debug()

4 years agoUpdate TODO
Lennart Poettering [Mon, 14 Dec 2020 12:15:31 +0000 (13:15 +0100)] 
Update TODO

4 years agotree-wide: fix typo
Yu Watanabe [Mon, 14 Dec 2020 00:40:45 +0000 (09:40 +0900)] 
tree-wide: fix typo

4 years agonspawn: remove outdated comment regarding bpffs
Ilya Dmitrichenko [Mon, 14 Dec 2020 09:35:08 +0000 (09:35 +0000)] 
nspawn: remove outdated comment regarding bpffs

bpffs fully respects mount namespaces since kernel version 4.7

References:

- https://github.com/torvalds/linux/commit/e27f4a942a0ee4b84567a3c6cfa84f273e55cbb7
- https://github.com/torvalds/linux/commit/612bacad78ba6d0a91166fc4487af114bac172a8

4 years agosd-device: make TAGS= property prefixed and suffixed with ":"
Yu Watanabe [Thu, 10 Dec 2020 23:34:13 +0000 (08:34 +0900)] 
sd-device: make TAGS= property prefixed and suffixed with ":"

The commit 6f3ac0d51766b0b9101676cefe5c4ba81feba436 drops the prefix and
suffix in TAGS= property. But there exists several rules that have like
`TAGS=="*:tag:*"`. So, the property must be always prefixed and suffixed
with ":".

Fixes #17930.

4 years agoMerge pull request #17928 from keszybz/nss-logging
Yu Watanabe [Mon, 14 Dec 2020 00:48:23 +0000 (09:48 +0900)] 
Merge pull request #17928 from keszybz/nss-logging

Enable logging in nss modules

4 years agoAdd Pull Request Labeler
Jameer Pathan [Sat, 12 Dec 2020 06:30:26 +0000 (12:00 +0530)] 
Add Pull Request Labeler

4 years agommap-cache: drop ret_size from mmap_cache_get()
Vito Caputo [Sun, 6 Dec 2020 08:21:17 +0000 (00:21 -0800)] 
mmap-cache: drop ret_size from mmap_cache_get()

The ret_size result is a bit of an awkward optimization that in a
sense enables bypassing the mmap-cache API, while encouraging
duplication of logic it already implements.

It's only utilized in one place; journal_file_move_to_object(),
apparently to avoid the overhead of remapping the whole object
again once its header, and thus its actual size, is known.

With mmap-cache's context cache, the overhead of simply
re-getting the object with the now known size should already be
negligible.  So it's not clear what benefit this brings, unless
avoiding some function calls that do very little in the hot
context-cache hit case is of such a priority.

There's value in having all object-sized gets pass through
mmap_cache_get(), as it provides a single entrypoint for
instrumentation in profiling/statistics gathering.  When
journal_file_move_to_object() bypasses getting the full object
size, you don't capture the full picture on the mmap-cache side
in terms of object sizes explicitly loaded from a journal file.

I'd like to see additional accounting in mmap_cache_get() in a
future commit, taking advantage of this change.

4 years agoUpdate 60-keyboard.hwdb
dropsignal [Sat, 12 Dec 2020 13:31:36 +0000 (07:31 -0600)] 
Update 60-keyboard.hwdb

added support for samsung series 3 np355v4c laptop keyboard

4 years agomeson: Fix reallocarray check
Khem Raj [Sun, 13 Dec 2020 00:15:57 +0000 (16:15 -0800)] 
meson: Fix reallocarray check

reallocarray() is defined in stdlib.h, so that would be right header to
check for its presense.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
4 years agopid1: stop making /dev noexec
Zbigniew Jędrzejewski-Szmek [Fri, 11 Dec 2020 11:28:44 +0000 (12:28 +0100)] 
pid1: stop making /dev noexec

Quoting Andy Lutomirski:
> The upcoming Linux SGX driver has a device node /dev/sgx.  User code opens
> it, does various setup things, mmaps it, and needs to be able to create
> PROT_EXEC mappings.  This gets quite awkward if /dev is mounted noexec.

We already didn't use noexec in spawn, and this extends this behaviour to other
systems.

Afaik, the kernel would refuse execve() on a character or block device
anyway. Thus noexec on /dev matters only for actual binaries copied to /dev,
which requires root privileges in the first place.

We don't do noexec on either /tmp or /dev/shm (because that causes immediate
problems with stuff like Java and cffi). And if you have those two at your
disposal anyway, having noexec on /dev doesn't seem important. So the 'noexec'
attribute on /dev doesn't really mean much, since there are multiple other
similar directories which don't require root privileges to write to.

C.f. https://salsa.debian.org/kernel-team/initramfs-tools/-/commit/33c10ef43b03dc6d9ee09a46c598f6ee34ad0b81.

4 years agoudev-builtin-blkid: add VOLUME_ID, LOGICAL_VOLUME_ID, VOLUME_SET_ID and DATA_PREPARER_ID
Karel Zak [Thu, 10 Dec 2020 11:27:33 +0000 (12:27 +0100)] 
udev-builtin-blkid: add VOLUME_ID, LOGICAL_VOLUME_ID, VOLUME_SET_ID and DATA_PREPARER_ID

The new libblkid release will provide these variables. Let's keep is
accessible also from udev-db for the rest of the system.

4 years agoMerge pull request #17921 from yuwata/network-drop-assertion-17920
Luca Boccassi [Fri, 11 Dec 2020 22:53:33 +0000 (22:53 +0000)] 
Merge pull request #17921 from yuwata/network-drop-assertion-17920

network: drop assertions to check link state in netlink callback handlers

4 years agoMerge pull request #17935 from yuwata/network-fix-another-race-in-link-reconfigure...
Zbigniew Jędrzejewski-Szmek [Fri, 11 Dec 2020 10:39:44 +0000 (11:39 +0100)] 
Merge pull request #17935 from yuwata/network-fix-another-race-in-link-reconfigure-17929

network: do not reconfigure interface when the link gains carrier but udev not initialized it yet

4 years agonetwork: adjust comments 17935/head
Zbigniew Jędrzejewski-Szmek [Fri, 11 Dec 2020 10:39:16 +0000 (11:39 +0100)] 
network: adjust comments

Co-authored-by: Carlo Teubner <435950+c4rlo@users.noreply.github.com>
4 years agonetwork: do not configure static configs more than once simultaneously 17921/head
Yu Watanabe [Fri, 11 Dec 2020 05:39:46 +0000 (14:39 +0900)] 
network: do not configure static configs more than once simultaneously

4 years agonetwork: do not assume address ready callback is always set to static addresses
Yu Watanabe [Fri, 11 Dec 2020 05:22:35 +0000 (14:22 +0900)] 
network: do not assume address ready callback is always set to static addresses

4 years agonetwork: drop assertions to check link state in netlink callback handlers
Yu Watanabe [Thu, 10 Dec 2020 05:16:22 +0000 (14:16 +0900)] 
network: drop assertions to check link state in netlink callback handlers

As, the link may be dropped while configuring addresses or routes.

Fixes #17920.

4 years agonetwork: do not reconfigure interface when the link gains carrier but udev not initia...
Yu Watanabe [Fri, 11 Dec 2020 03:15:45 +0000 (12:15 +0900)] 
network: do not reconfigure interface when the link gains carrier but udev not initialized it yet

When an interface gains carrier but udev have not initialized the
interface or link_initialized_handler() has not been called yet,
then link_configure will be called twice. Thus LLDP client will be
configured twice, and triggers assertion.

Fixes #17929.

4 years agonss-mymachines: initialize logging 17928/head
Zbigniew Jędrzejewski-Szmek [Thu, 10 Dec 2020 11:46:23 +0000 (12:46 +0100)] 
nss-mymachines: initialize logging

No logging is done directly by nss-mymachines.c code, but we call into sd-bus,
which will log.

4 years agonss-systemd: initialize logging
Zbigniew Jędrzejewski-Szmek [Thu, 10 Dec 2020 11:45:48 +0000 (12:45 +0100)] 
nss-systemd: initialize logging

4 years agonss-resolve: initialize logging, log json errors
Zbigniew Jędrzejewski-Szmek [Thu, 10 Dec 2020 11:32:12 +0000 (12:32 +0100)] 
nss-resolve: initialize logging, log json errors

When the .so module is loaded, it gets a separate copy of stuff in src/basic,
including the log level variables. So any logging settings are unaffected by
the loading program calling log_parse_environment() or such. Let's also parse
the environment here so that we can have nice logging.

Initialization is done from each exported function, and pthread_once_t is used
to avoid duplicate initialization. I didn't merge PROTECT_ERRNO into
NSS_ENTRYPOINT_BEGIN because UNPROTECT_ERRNO is called in a bunch of places
and it would feel strange to have PROTECT_ERRNO hidden, but not UNPROTECT_ERRNO.

The most interesting stuff in this module is the varlink messages, and any
potential errors in json. So let's enable json logging when debug messages are
enabled.

With those changes, figuring out the issue in
https://github.com/systemd/systemd/pull/17823 is trivial:

$ LD_LIBRARY_PATH=build/ SYSTEMD_LOG_COLOR=1 SYSTEMD_LOG_LOCATION=1 SYSTEMD_LOG_LEVEL=debug getent hosts mirrors.fedoraproject.org
src/shared/varlink.c:237: n/a: varlink: setting state idle-client
src/shared/varlink.c:1240: n/a: Sending message: {"method":"io.systemd.Resolve.ResolveHostname","parameters":{"name":"mirrors.fedoraproject.org","family":10}}
src/shared/varlink.c:240: n/a: varlink: changing state idle-client → calling
src/shared/varlink.c:588: n/a: New incoming message: {"parameters":{"addresses":[{"ifindex":0,"family":10,"address":[42,5,208,20,0,16,120,3,247,116,77,124,226,119,164,87]},{"ifindex":0,"family":10,"address":[42,5,208,28,12,106,204,3,38,58,132,9,185,97,126,2]},{"ifindex":0,"family":10,"address":[38,32,0,82,0,3,0,1,222,173,190,239,202,254,254,215]},{"ifindex":0,"family":10,"address":[38,5,188,128,48,16,6,0,222,173,190,239,202,254,254,217]},{"ifindex":0,"family":10,"address":[38,4,21,128,254,0,0,0,222,173,190,239,202,254,254,209]},{"ifindex":0,"family":10,"address":[38,32,0,82,0,3,0,1,222,173,190,239,202,254,254,214]},{"ifindex":0,"family":10,"address":[38,16,0,40,48,144,48,1,222,173,190,239,202,254,254,211]},{"ifindex":0,"family":10,"address":[32,1,65,120,0,2,18,105,0,0,0,0,0,0,254,210]}],"name":"wildcard.fedoraproject.org","flags":1}}
src/shared/varlink.c:240: n/a: varlink: changing state calling → called
src/shared/varlink.c:240: n/a: varlink: changing state called → idle-client
src/nss-resolve/nss-resolve.c:84: (string):1:40: JSON field 'ifindex' is out of bounds for an interface index.

4 years agocryptsetup: Fix crypto device missing issue after bootup
Jinyuan Si [Fri, 4 Dec 2020 02:38:28 +0000 (10:38 +0800)] 
cryptsetup: Fix crypto device missing issue after bootup

Normally, the udev rules operate on "change" events. But when
coldplugging, there's an "add" event present. The udev rules have to
recognize this and do some actions in this particular situation, too.
Also, we don't want the nodes to be created prematurely on "add"
events while not coldplugging. The udev rules will check
DM_UDEV_PRIMARY_SOURCE_FLAG to see if the device was activated
correctly before and if not, it ignore the "add" event totally.
This way the udev rules can support udev triggers generating "add"
events (e.g. "udevadm trigger --action=add" or
"echo add > /sys/block/<dm_device>/uevent").

In this case, the udevd service is started after
systemd-cryptsetup@config.service, is started, which will cause udevd
service to miss the "change" uevent with DM_UDEV_PRIMARY_SOURCE_FLAG
flag generated by systemd-cryptsetup@config.service. To solve this
issue, we let the cryptsetup service be started after the udevd
service.

4 years agoMerge pull request #17903 from yuwata/udev-options-log-level
Lennart Poettering [Thu, 10 Dec 2020 19:45:32 +0000 (20:45 +0100)] 
Merge pull request #17903 from yuwata/udev-options-log-level

udev: introduce OPTIONS="log_level=xxx" rule

4 years agoDrop compat "gateway" name
Zbigniew Jędrzejewski-Szmek [Thu, 10 Dec 2020 10:10:54 +0000 (11:10 +0100)] 
Drop compat "gateway" name

Back in 5248e7e1f11aba6859de0b28f0dd3778b22842f2 (July 2017) we moved over to
"_gateway", with the old name declared to be temporary measure. Since we're
doing a bunch of changes to resolved now, it seems to be a good moment to make
this simplification and not add support for the compat name in new code.

4 years agoveritysetup: also place udev socket dep
Lennart Poettering [Thu, 10 Dec 2020 10:48:37 +0000 (11:48 +0100)] 
veritysetup: also place udev socket dep

In light of #17848, also place udev socket dep in veritysetup, it's the
same issue after all.

4 years agoseccomp: don't install filters for archs that can't use syscalls
Greg Depoire--Ferrer [Wed, 28 Oct 2020 23:51:30 +0000 (00:51 +0100)] 
seccomp: don't install filters for archs that can't use syscalls

When seccomp_restrict_archs is called, architectures that are blocked
are replaced by the SECCOMP_LOCAL_ARCH_BLOCKED marker so that they are
not disabled again and filters are not installed for them.

This can make some service that use SystemCallArchitecture= and
SystemCallFilter= start faster.

4 years agommap-cache: bind prot(ection) to MMapFileDescriptor
Vito Caputo [Thu, 3 Dec 2020 06:11:23 +0000 (22:11 -0800)] 
mmap-cache: bind prot(ection) to MMapFileDescriptor

There are no mmap_cache_get() users that actually deviate prot
from the JournalFile's f->prot.

So there's no point in making this a separate parameter to
mmap_cache_get(), nor is there any need to store it in
JournalFile's f->prot.

Instead just pass it to mmap_cache_add_fd() at MMapFileDescriptor
creation, storing it in there for the mmap() callers, which
already receive MMapFileDescriptor *.

For functions receiving both an MMapFileDescriptor * and prot,
the prot argument has been simply removed and call sites updated.

Formalizing this fd:prot binding at the public API also enables
discarding the prot check in window_matches(), which is a hot
function on long window lists, so a minor CPU efficiency gain
should be had there as seen with the past removal of the fd
check.  Unnoticable for uncached journals, but maybe a little
runtime improvement when cached in specific circumstances.

window_matches_fd() has also been simplified to treat the
MMapFileDescrptor * as equivalent to its fd and prot.

4 years agothree spdx header fixes
Lennart Poettering [Thu, 10 Dec 2020 10:38:43 +0000 (11:38 +0100)] 
three spdx header fixes

4 years agobasic/static-destruct: fix grammar in comment
Zbigniew Jędrzejewski-Szmek [Thu, 10 Dec 2020 11:17:14 +0000 (12:17 +0100)] 
basic/static-destruct: fix grammar in comment

4 years agojson: log location also when there is no file
Zbigniew Jędrzejewski-Szmek [Thu, 10 Dec 2020 10:56:05 +0000 (11:56 +0100)] 
json: log location also when there is no file

E.g. in nss-resolve it is still useful to print the location of the error:
src/test/test-nss.c:231: dlsym(0x0x1dc6fb0, _nss_resolve_gethostbyname2_r) → 0x0x7fdbfc53f626
(string):1:40: JSON field ifindex is out of bounds for an interface index.

I opted to use a partially duplicated if condition to avoid nesting. It's nice
to have the log calls vertically aligned. The compiler will optimize this nicely.

4 years agoMerge pull request #17851 from yuwata/network-address-compare-func
Lennart Poettering [Thu, 10 Dec 2020 09:43:47 +0000 (10:43 +0100)] 
Merge pull request #17851 from yuwata/network-address-compare-func

network: revert previous changes to address_compare_func()

4 years agommap-cache: separate context and window list cache hit accounting
Vito Caputo [Sun, 6 Dec 2020 08:16:17 +0000 (00:16 -0800)] 
mmap-cache: separate context and window list cache hit accounting

Account and log these statistics separately since their overheads
are potentially quite different when the window lists are large.

There should probably be a histogram of window list traversal
counts too.

4 years agonetworkd-test: add final newlines in generated files, use .format()
Zbigniew Jędrzejewski-Szmek [Wed, 9 Dec 2020 09:35:10 +0000 (10:35 +0100)] 
networkd-test: add final newlines in generated files, use .format()

4 years agoudev: Fix sound.target dependency
Takashi Iwai [Wed, 9 Dec 2020 09:56:51 +0000 (10:56 +0100)] 
udev: Fix sound.target dependency

The recent bug report indicated a race at device creation and the
sound.target dependencies, and the cause turned out to be the condition
of the sound.target trigger.  Currently it's set for "card*", but this
is actually the parent object; i.e. the sound.target is triggered before
the sound devices are created.

For assuring the whole sound device creations beforehand, we need to use
"controlC*" instead of "card*"; as already described in
78-sound-card.rules, this is guaranteed to be the last device, and can
be used as a synchronization point.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1179363
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoMerge pull request #17877 from yuwata/missing-syscall-sort
Yu Watanabe [Thu, 10 Dec 2020 03:42:35 +0000 (12:42 +0900)] 
Merge pull request #17877 from yuwata/missing-syscall-sort

missing: sort architectures in missing_syscall.h

4 years agoman: mention new OPTIONS=log_level= udev rule 17903/head
Yu Watanabe [Tue, 8 Dec 2020 14:11:03 +0000 (23:11 +0900)] 
man: mention new OPTIONS=log_level= udev rule

4 years agoudev: introduce new OPTIONS="log_level=" udev rule
Yu Watanabe [Tue, 8 Dec 2020 13:37:12 +0000 (22:37 +0900)] 
udev: introduce new OPTIONS="log_level=" udev rule

4 years agoudev: introduce log_device_uevent() helper function
Yu Watanabe [Tue, 8 Dec 2020 13:36:42 +0000 (22:36 +0900)] 
udev: introduce log_device_uevent() helper function

And this drops duplicated check for seqnum and device action.

4 years agoudev: drop meaningless size optimization
Yu Watanabe [Tue, 8 Dec 2020 12:49:34 +0000 (21:49 +0900)] 
udev: drop meaningless size optimization

These objects are not allocated multiple times simultaneously per
single process.

4 years agoMerge pull request #17869 from DaanDeMeyer/mkosi-gdb
Lennart Poettering [Wed, 9 Dec 2020 20:09:59 +0000 (21:09 +0100)] 
Merge pull request #17869 from DaanDeMeyer/mkosi-gdb

mkosi: Add gdb to final images

4 years agoMerge pull request #17884 from poettering/test-dlopen
Lennart Poettering [Wed, 9 Dec 2020 20:09:33 +0000 (21:09 +0100)] 
Merge pull request #17884 from poettering/test-dlopen

tests: add test that dlopen()s our weak shared library deps once

4 years agoudev: link_update() should fail if the entry in symlink dir couldn't have been created
Franck Bui [Wed, 9 Dec 2020 08:46:08 +0000 (09:46 +0100)] 
udev: link_update() should fail if the entry in symlink dir couldn't have been created

Follow-up for 30f6dce62cb3a738b20253f2192270607c31b55b

4 years agovirt: drop /proc/1/sched hack
Lennart Poettering [Wed, 9 Dec 2020 15:16:21 +0000 (16:16 +0100)] 
virt: drop /proc/1/sched hack

On really old kernels (< 4.14+) a bug in /proc/1/sched handling in the
kernel could be used to determine whether we are running in a PID
namespace. This hasn't worked for a long time, and there's little point
in making things work on old kernels we can't make work on current
kernels, hence let's drop that old cruft.

See: #8153

4 years agomkosi: Add strace to final images 17869/head
Daan De Meyer [Wed, 9 Dec 2020 17:28:51 +0000 (17:28 +0000)] 
mkosi: Add strace to final images

Useful for debugging purposes.

4 years agomkosi: Add gdb to final images
Daan De Meyer [Sun, 6 Dec 2020 11:42:45 +0000 (11:42 +0000)] 
mkosi: Add gdb to final images

Let's add a debugger to the mkosi images so we can debug coredumps
from inside mkosi qemu VMs (and hopefully in the future from
mkosi systemd-nspawn containers as well).

4 years agolog: add helper set sets log level in all realms
Lennart Poettering [Wed, 9 Dec 2020 10:12:33 +0000 (11:12 +0100)] 
log: add helper set sets log level in all realms

Prompted-by: #17903
4 years agoman: document that automount units are privileged
Lennart Poettering [Wed, 9 Dec 2020 13:04:21 +0000 (14:04 +0100)] 
man: document that automount units are privileged

Fixes: #17886
4 years agoMerge pull request #17911 from yuwata/log-cli-program-use-journal
Luca Boccassi [Wed, 9 Dec 2020 14:30:32 +0000 (14:30 +0000)] 
Merge pull request #17911 from yuwata/log-cli-program-use-journal

log: open journal when cli program run in a service unit

4 years agoMerge pull request #17882 from poettering/logind-async-close
Luca Boccassi [Wed, 9 Dec 2020 14:27:03 +0000 (14:27 +0000)] 
Merge pull request #17882 from poettering/logind-async-close

logind: fix closing of button input devices

4 years agoSilence cgroups v1 read-only filesystem warning
Daan De Meyer [Mon, 7 Dec 2020 22:18:28 +0000 (22:18 +0000)] 
Silence cgroups v1 read-only filesystem warning

Avoid warning messages when booting systemd-nspawn containers and using
hybrid or legacy cgroups. systemd-nspawn mounts the cgroups v1 controller
tree as read-only so these errors are expected and not problematic.
Partially fixes #17862.

Test plan:

- Before: `mkosi --default .mkosi/mkosi.fedora boot`

```
‣ Processing default...
Spawning container image on /home/daan/projects/systemd/image.raw.
Press ^] three times within 1s to kill container.
systemd 247 running in system mode. (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
Detected virtualization systemd-nspawn.
Detected architecture x86-64.

Welcome to Fedora 33 (Thirty Three)!

Queued start job for default target Graphical Interface.
-.slice: Failed to migrate controller cgroups from , ignoring: Read-only file system
system.slice: Failed to delete controller cgroups /system.slice, ignoring: Read-only file system
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice system-modprobe.slice.
user.slice: Failed to delete controller cgroups /user.slice, ignoring: Read-only file system
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Process Core Dump Socket.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on User Database Manager Socket.
dev-hugepages.mount: Failed to delete controller cgroups /dev-hugepages.mount, ignoring: Read-only file system
         Mounting Huge Pages File System...
sys-fs-fuse-connections.mount: Failed to delete controller cgroups /sys-fs-fuse-connections.mount, ignoring: Read-only file system
         Mounting FUSE Control File System...
         Starting Journal Service...
         Starting Remount Root and Kernel File Systems...
system.slice: Failed to delete controller cgroups /system.slice, ignoring: Read-only file system
```

After: `mkosi --default .mkosi/mkosi.fedora boot`

```
‣ Processing default...
Spawning container image on /home/daan/projects/systemd/mkosi.output/image.raw.
Press ^] three times within 1s to kill container.
systemd 247 running in system mode. (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
Detected virtualization systemd-nspawn.
Detected architecture x86-64.

Welcome to Fedora 33 (Thirty Three)!

Queued start job for default target Graphical Interface.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice system-modprobe.slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Process Core Dump Socket.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on User Database Manager Socket.
         Mounting Huge Pages File System...
         Mounting FUSE Control File System...
         Starting Journal Service...
         Starting Remount Root and Kernel File Systems...
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Finished Remount Root and Kernel File Systems.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Finished Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Restore /run/initramfs on shutdown...
[  OK  ] Finished Restore /run/initramfs on shutdown.
[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[  OK  ] Finished Flush Journal to Persistent Storage.
         Starting Create Volatile Files and Directories...
[  OK  ] Finished Create Volatile Files and Directories.
         Starting Network Name Resolution...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Finished Update UTMP about System Boot/Shutdown.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Timers.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting Home Area Manager...
         Starting User Login Management...
         Starting Permit User Sessions...
[  OK  ] Finished Permit User Sessions.
[  OK  ] Started Console Getty.
[  OK  ] Reached target Login Prompts.
         Starting D-Bus System Message Bus...
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Started Home Area Manager.
[  OK  ] Started User Login Management.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Finished Update UTMP about System Runlevel Changes.
[  OK  ] Started Network Name Resolution.
[  OK  ] Reached target Host and Network Name Lookups.

Fedora 33 (Thirty Three) (built from systemd tree)
Kernel 5.9.11-arch2-1 on an x86_64 (console)
```

4 years agomeson: specify correct libqrencode version in meson dep 17884/head
Luca Boccassi [Wed, 9 Dec 2020 12:33:54 +0000 (13:33 +0100)] 
meson: specify correct libqrencode version in meson dep

4 years agotest: pull in weak deps into tests
Luca Boccassi [Wed, 9 Dec 2020 09:15:36 +0000 (10:15 +0100)] 
test: pull in weak deps into tests

(Pulled from @bluca's comment here:
https://github.com/systemd/systemd/pull/17884#issuecomment-740005624 and
turned into a commit by @poettering)

4 years agotest: add test that dlopen()'s all our weak library deps once
Lennart Poettering [Mon, 7 Dec 2020 13:15:36 +0000 (14:15 +0100)] 
test: add test that dlopen()'s all our weak library deps once

This test should ensure we notice if distros update shared libraries
that broke so name, and we still use the old soname.

(In contrast to what the commit summary says, this currently doesn#t
cover really all such deps, specifically xkbcommon and PCRE are missing,
since they currently aren't loaded from src/shared/. This is stuff to
fix later)

4 years agoqrcode-util: make dlopen() logic more like the other cases
Lennart Poettering [Mon, 7 Dec 2020 13:09:37 +0000 (14:09 +0100)] 
qrcode-util: make dlopen() logic more like the other cases

Let's add a dlopen_qrencode() function that does the actual dlopen()
stuff and caches the result.

This is useful so that we later can automatically test for all dlopen
hookups to work correctly.

4 years agomanager: Fix HW watchdog when systemd starts before driver loaded
Michael Marley [Tue, 8 Dec 2020 02:27:38 +0000 (21:27 -0500)] 
manager: Fix HW watchdog when systemd starts before driver loaded

When manager_{set|override}_watchdog is called, set the watchdog timeout
regardless of whether the hardware watchdog was successfully initialized.  If
the watchdog was requested but could not be initialized, then instead of
pinging it, attempt to initialize it again.  This ensures that the hardware
watchdog is initialized even if the kernel module for it isn't loaded when
systemd starts (which is quite likely, unless it is compiled in).

This builds on work by @danc86 in https://github.com/systemd/systemd/pull/17460,
but fixes the issue of not updating the watchdog timeout with the actual value
from the hardware.

Fixes https://github.com/systemd/systemd/issues/17838

Co-authored-by: Dan Callaghan <djc@djc.id.au>
Co-authored-by: Michael Marley <michael@michaelmarley.com>
4 years agologind: use free_and_strdup() where appropriate 17882/head
Lennart Poettering [Wed, 9 Dec 2020 09:07:37 +0000 (10:07 +0100)] 
logind: use free_and_strdup() where appropriate

4 years agologind: fix closing of button input devices
Lennart Poettering [Mon, 7 Dec 2020 09:51:15 +0000 (10:51 +0100)] 
logind: fix closing of button input devices

This is a fix of #17751. Specifically:

1. Sort #include headers again

2. Remove tabs, as per coding style

3. Don't install fds in half-initialized objects

4. Use asynchronous_close() everywhere

That all said:

Quit frankly, I am not convinced we should do all this at all. If
close()ing of these input devices is really that slow, then this should
probably be fixed in the kernel, not worked around in userspace like
this.

4 years agoasync: add trivial cleanup wrapper for asynchronous_close()
Lennart Poettering [Wed, 9 Dec 2020 09:07:12 +0000 (10:07 +0100)] 
async: add trivial cleanup wrapper for asynchronous_close()

4 years agolog: open journal when cli program run in a service unit 17911/head
Yu Watanabe [Tue, 8 Dec 2020 16:49:13 +0000 (01:49 +0900)] 
log: open journal when cli program run in a service unit

Previously, cli programs like networkctl always use console for logging.

4 years agolog: make show_color variable tristate
Yu Watanabe [Tue, 8 Dec 2020 16:44:36 +0000 (01:44 +0900)] 
log: make show_color variable tristate

Should not change any behavior.

4 years agolog: merge conditions to reduce indentation
Yu Watanabe [Tue, 8 Dec 2020 16:21:31 +0000 (01:21 +0900)] 
log: merge conditions to reduce indentation

4 years agounit: make systemd-networkd.service support reload command 17906/head
Yu Watanabe [Tue, 8 Dec 2020 15:21:58 +0000 (00:21 +0900)] 
unit: make systemd-networkd.service support reload command

4 years agomount-util: fix typo
Yu Watanabe [Tue, 8 Dec 2020 18:04:43 +0000 (03:04 +0900)] 
mount-util: fix typo

4 years agocgroup: Also set blkio.bfq.weight
Pavel Hrdina [Wed, 25 Nov 2020 08:05:36 +0000 (09:05 +0100)] 
cgroup: Also set blkio.bfq.weight

Commit [1] added a workaround when unified cgroups are used but missed
legacy cgroups where there is the same issue.

[1] <https://github.com/systemd/systemd/commit/2dbc45aea747f25cc1c3848fded2ec0062f96bcf>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoMerge pull request #17871 from yuwata/sd-device-issue-17772
Zbigniew Jędrzejewski-Szmek [Tue, 8 Dec 2020 09:14:43 +0000 (10:14 +0100)] 
Merge pull request #17871 from yuwata/sd-device-issue-17772

sd-device: keep escaped strings in DEVLINK= property

4 years agomkosi: Enable --qemu-headless option for all distros
Daan De Meyer [Mon, 7 Dec 2020 23:00:37 +0000 (23:00 +0000)] 
mkosi: Enable --qemu-headless option for all distros

--qemu-headless configures the generated image and mkosi's qemu
command to connect to the VM via the serial port. This allows
spawning a qemu VM within the user's terminal instead of spawning
a graphical GTK GUI. --qemu-headless sets TERM, COLUMNS and LINES
in serial-getty@ttyS0.service in the container which makes the
terminal in the VM behave almost equivalent to the one on the host.

This change makes testing changes to systemd using mkosi + QEMU a
lot easier compared to before as commands can be executed in the VM
from the comfort of one's terminal compared to the Linux console
available when running via the GTK GUI.

4 years agohwdb: add funcional keys for MSI Modern series (tested on Modern 14) (#17880)
l4gfcm [Tue, 8 Dec 2020 08:57:17 +0000 (10:57 +0200)] 
hwdb: add funcional keys for MSI Modern series (tested on Modern 14) (#17880)

4 years agoman: synthetize(d) -> synthesize(d)
Yu Watanabe [Tue, 8 Dec 2020 00:26:00 +0000 (09:26 +0900)] 
man: synthetize(d) -> synthesize(d)

4 years agomissing: update warning messages 17877/head
Yu Watanabe [Tue, 8 Dec 2020 06:35:57 +0000 (15:35 +0900)] 
missing: update warning messages

4 years agomissing: add missing syscalls for ia64, m68k, sparc, arc, and tilegx
Yu Watanabe [Tue, 8 Dec 2020 05:59:45 +0000 (14:59 +0900)] 
missing: add missing syscalls for ia64, m68k, sparc, arc, and tilegx

These are not tested, but several syscalls are defined for these
architectures. Let's add syscalls comprehensively.

4 years agomissing: drop redundant condition
Yu Watanabe [Tue, 8 Dec 2020 05:54:20 +0000 (14:54 +0900)] 
missing: drop redundant condition

4 years agomissing: support 32bit powerpc
Yu Watanabe [Tue, 8 Dec 2020 05:51:58 +0000 (14:51 +0900)] 
missing: support 32bit powerpc

4 years agomissing: sort architectures in missing_syscall.h
Yu Watanabe [Mon, 7 Dec 2020 04:32:04 +0000 (13:32 +0900)] 
missing: sort architectures in missing_syscall.h

4 years agonetwork: warn when NDISC and DHCPv6 provide the same address 17851/head
Yu Watanabe [Tue, 8 Dec 2020 04:35:48 +0000 (13:35 +0900)] 
network: warn when NDISC and DHCPv6 provide the same address

With some router, the address in NDISC generated with EUI-64 conflicts
with an address provided by DHCPv6.

Prompted by #17831.

4 years agonetwork: fix SIGABRT related to unreachable route with DHCP6
Yu Watanabe [Fri, 4 Dec 2020 11:50:34 +0000 (20:50 +0900)] 
network: fix SIGABRT related to unreachable route with DHCP6

After #17834, unreachable routes generated through DHCP6 are managed by
Manager. But they are referrenced by the DHCP6 uplink. So, the routes
managed by Manager must be freed after all Link objects are freed.

Follow-up for 575f14eef010101c60e9d4d970e542c815be1994.

Fixes SIGABRT reproted in #17831.

4 years agonetwork: use address_get() in address_exists()
Yu Watanabe [Fri, 4 Dec 2020 08:29:16 +0000 (17:29 +0900)] 
network: use address_get() in address_exists()

And rename address_exists() to link_has_ipv6_address().

4 years agonetwork: revert previous changes to address_compare_func()
Yu Watanabe [Fri, 4 Dec 2020 07:41:08 +0000 (16:41 +0900)] 
network: revert previous changes to address_compare_func()

This partially reverts fe841414ef157f7f01d339c5d5730126e7b5fe0a and
2a236f9fc0ff8fb2152032551436fde74da7217a.

For IPv4, kernel compares the local address, prefix, and prefixlen.
For IPv6, kernel compares only the local address.
Let's follow the kernel's comparison way.

Fixes #17831.

4 years agotest: add tests for device_new_from_nulstr() 17871/head
Yu Watanabe [Sun, 6 Dec 2020 12:12:17 +0000 (21:12 +0900)] 
test: add tests for device_new_from_nulstr()

4 years agosd-device: keep escaped strings in DEVLINK= property
Yu Watanabe [Sun, 6 Dec 2020 12:10:34 +0000 (21:10 +0900)] 
sd-device: keep escaped strings in DEVLINK= property

This fixes a bug introduced by 87a4d416e5126b6fb2528ae192a6a6a8033539ce.

Fixes #17772.

4 years agosd-device: use set_strjoin()
Yu Watanabe [Sun, 6 Dec 2020 11:11:37 +0000 (20:11 +0900)] 
sd-device: use set_strjoin()

This slightly changes TAGS= and CURRENT_TAGS= properties:

Before
E: TAGS=:aaa:bbb:

After
E: TAGS=aaa:bbb

4 years agoset: introduce set_strjoin()
Yu Watanabe [Sun, 6 Dec 2020 11:10:48 +0000 (20:10 +0900)] 
set: introduce set_strjoin()

4 years agoMerge pull request #17855 from poettering/more-socktops
Luca Boccassi [Mon, 7 Dec 2020 21:15:28 +0000 (21:15 +0000)] 
Merge pull request #17855 from poettering/more-socktops

socket-util: some helpers for various sockopts

4 years agosystemd-nspawn: Allow setting ambient capability set
Torsten Hilbrich [Fri, 4 Dec 2020 10:27:12 +0000 (11:27 +0100)] 
systemd-nspawn: Allow setting ambient capability set

The old code was only able to pass the value 0 for the inheritable
and ambient capability set when a non-root user was specified.

However, sometimes it is useful to run a program in its own container
with a user specification and some capabilities set. This is needed
when the capabilities cannot be provided by file capabilities (because
the file system is mounted with MS_NOSUID for additional security).

This commit introduces the option --ambient-capability and the config
file option AmbientCapability=. Both are used in a similar way to the
existing Capability= setting. It changes the inheritable and ambient
set (which is 0 by default). The code also checks that the settings
for the bounding set (as defined by Capability= and DropCapability=)
and the setting for the ambient set (as defined by AmbientCapability=)
are compatible. Otherwise, the operation would fail in any way.

Due to the current use of -1 to indicate no support for ambient
capability set the special value "all" cannot be supported.

Also, the setting of ambient capability is restricted to running a
single program in the container payload.

4 years agoMerge pull request #17766 from weblate/weblate-systemd-master
Zbigniew Jędrzejewski-Szmek [Mon, 7 Dec 2020 18:56:13 +0000 (19:56 +0100)] 
Merge pull request #17766 from weblate/weblate-systemd-master

Translations update from Weblate

4 years agoMake support for nscd flushing optional
Zbigniew Jędrzejewski-Szmek [Mon, 7 Dec 2020 07:45:15 +0000 (08:45 +0100)] 
Make support for nscd flushing optional

Fedora will deprecate support for nscd in the upcoming release [1] and plans to
drop it in the next one [2]. At that point we might as well build systemd
without that support too, since there'll be nothing to talk too.

[1] https://fedoraproject.org/wiki/Changes/DeprecateNSCD
[2] https://fedoraproject.org/wiki/Changes/RemoveNSCD

4 years agosocket-util: add common API for querying socket MTU 17855/head
Lennart Poettering [Mon, 16 Nov 2020 14:01:03 +0000 (15:01 +0100)] 
socket-util: add common API for querying socket MTU

4 years agosocket-util: add getsockopt_int() helper
Lennart Poettering [Mon, 16 Nov 2020 11:41:39 +0000 (12:41 +0100)] 
socket-util: add getsockopt_int() helper

4 years agosocket-util: add sockopt helper for controlling IP_RECVFRAGSIZE
Lennart Poettering [Mon, 16 Nov 2020 11:41:23 +0000 (12:41 +0100)] 
socket-util: add sockopt helper for controlling IP_RECVFRAGSIZE

4 years agoMerge pull request #17874 from DaanDeMeyer/mkosi-build-verbosity
Zbigniew Jędrzejewski-Szmek [Mon, 7 Dec 2020 09:12:33 +0000 (10:12 +0100)] 
Merge pull request #17874 from DaanDeMeyer/mkosi-build-verbosity

Reduce mkosi build script verbosity

4 years agonss-resolve: varlink_call() set error_id only when r >= 0
Yu Watanabe [Sun, 6 Dec 2020 13:41:35 +0000 (22:41 +0900)] 
nss-resolve: varlink_call() set error_id only when r >= 0

Fixes #17870.

4 years agonetwork: mtu is neither a boolean nor a pointer
Yu Watanabe [Mon, 7 Dec 2020 05:10:45 +0000 (14:10 +0900)] 
network: mtu is neither a boolean nor a pointer

4 years agomissing: Define several syscall numbers for Alpha arch
Matt Turner [Sun, 6 Dec 2020 23:45:49 +0000 (18:45 -0500)] 
missing: Define several syscall numbers for Alpha arch

4 years agomeson: Respect MESON_INSTALL_QUIET 17874/head
Daan De Meyer [Sun, 6 Dec 2020 18:16:59 +0000 (18:16 +0000)] 
meson: Respect MESON_INSTALL_QUIET

MESON_INSTALL_QUIET is set when --quiet is passed to meson install.
Make sure we check the variable in our custom install scripts and
don't output anything if it is set.

4 years agomkosi: Silence locale checking in mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 18:16:00 +0000 (18:16 +0000)] 
mkosi: Silence locale checking in mkosi.build

Avoid warning and error logs from locale charmap and export LC_CTYPE
by piping to dev/null and checking if locales are available before
using them.

4 years agomkosi: Remove explicit default_hierarchy=unified option from mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 16:47:25 +0000 (16:47 +0000)] 
mkosi: Remove explicit default_hierarchy=unified option from mkosi.build

default_hierarchy is set to unified in meson_options already so
we can remove it from mkosi.build.

4 years agomkosi: Add --quiet and --no-rebuild options to meson install in mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 16:45:45 +0000 (16:45 +0000)] 
mkosi: Add --quiet and --no-rebuild options to meson install in mkosi.build

By default, meson install prints a line for every file it installs.
This is verbose and doesn't provide much value. Let's silence the
meson install step to remove this output from the mkosi build step.

The --no-rebuild option removes some additional duplicate output
by the meson install step.

Ubuntu Focal still has meson 0.53.0 so we add a version check and
only use the new feature if the meson version supports it.

4 years agomkosi: Remove bash -x option from mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 16:45:01 +0000 (16:45 +0000)] 
mkosi: Remove bash -x option from mkosi.build

-x is for debugging purposes. During regular usage, using -x mostly
prints useless output when building the mkosi image.

4 years agomkosi: Use meson install instead of ninja install in build script
Daan De Meyer [Sun, 6 Dec 2020 16:43:58 +0000 (16:43 +0000)] 
mkosi: Use meson install instead of ninja install in build script

Allows using extra options not available when using ninja.