Commit graph

41699 commits

Author SHA1 Message Date
Chris Down 2b0ea8d739
Merge pull request #13689 from cdown/default_memory_min
cgroup: A bunch of protection-related fixes
2019-10-01 03:08:15 +01:00
Chris Down 184e989d7d cgroup: Mark memory protections as explicitly set in transient units
A later version of the DefaultMemory{Low,Min} patch changed these to
require explicitly setting memory_foo_set, but we only set that in
load-fragment, not dbus-cgroup.

Without these, we may fall back to either DefaultMemoryFoo or
CGROUP_LIMIT_MIN when we really shouldn't.
2019-09-30 22:27:21 +01:00
Anita Zhang fe6aff6a45
Merge pull request #13687 from cdown/cgroupv2_docs
cgroup: minor doc improvements
2019-09-30 14:00:38 -07:00
Chris Down 64fe532e90 cgroup: Respect DefaultMemoryMin when setting memory.min
This is an oversight from https://github.com/systemd/systemd/pull/12332.

Sadly the tests didn't catch it since it requires a real cgroup
hierarchy to see, and it wasn't seen in prod since we're only currently
using DefaultMemoryLow, not DefaultMemoryMin. :-(
2019-09-30 18:41:21 +01:00
Chris Down 7c9d2b7993 cgroup: Check ancestor memory min for unified memory config
Otherwise we might not enable it when we should, ie. DefaultMemoryMin is
set in a parent, but not MemoryMin in the current unit.
2019-09-30 18:24:26 +01:00
Kenneth D'souza ff7d6a740b Consider smb3 as remote filesystem
Currently systemd will treat smb3 as local filesystem and cause
can't boot failures. Add smb3 to the list of remote filesystems
to fix this issue.

Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
2019-10-01 02:02:00 +09:00
Chris Down ba79e19cb2 cgroup: docs: memory.high doc fixups
The docs just tautologically call this the "high limit". Just call it
throttling as we do in cgroup-v2.rst.
2019-09-30 14:30:14 +01:00
Chris Down b62087d4d0 cgroup: docs: Mention unbounded protection for memory.{low,min}
I got asked why Memory{Low,Min} don't allow "infinity". They do, but the
docs don't say that like they already do for Memory{High,Max}.
2019-09-30 14:23:32 +01:00
Michael Olbrich 28e68bb235 Handle d_type == DT_UNKNOWN correctly
As documented in the man-page, readdir() may return a directory entry with
d_type == DT_UNKNOWN. This must be handled for regular filesystems.

dirent_ensure_type() is available to set d_type if necessary. Use it in
some more places.

Without this systemd will fail to boot correctly with nfsroot and some
other filesystems.

Closes #13609
2019-09-30 13:29:59 +01:00
Frantisek Sumsal 501deda1ce test: allow use of nested KVM
Introduce TEST_NESTED_KVM variable, which allows use of nested KVM for
QEMU VMs (which is disabled by default by KVM autodetection).
2019-09-27 15:42:38 -07:00
Anita Zhang c4fed80522
Merge pull request #13651 from cdown/find_binary_2
util-lib: Don't propagate EACCES from find_binary PATH lookup to caller
2019-09-27 09:39:10 -07:00
Frantisek Sumsal b80aca0fd9 shared: fix a copy-paste error in ethtool-util
CID#1405818
2019-09-27 16:11:16 +02:00
Chris Down 4e1ddb6612 util-lib: Don't propagate EACCES from find_binary PATH lookup to caller
On one of my test machines, test-path-util was failing because the
find_binary("xxxx-xxxx") was returning -EACCES instead of -ENOENT. This
happens because the PATH entry on that host contains a directory which
the user in question doesn't have access to. Typically applications
ignore permission errors when searching through PATH, for example in
bash:

    $ whoami
    cdown
    $ PATH=/root:/bin type sh
    sh is /bin/sh

This behaviour is present on zsh and other shells as well, though. This
patch brings our PATH search behaviour closer to other major Unix tools.
2019-09-26 09:19:20 +01:00
Siddharth Chandrasekara afe42aef39 dhcp4: make IPServiceType configurable
IPServiceType set to CS6 (network control) causes problems on some old
network setups that continue to interpret the field as IP TOS.

Make DHCP work on such networks by allowing this field to be set to
CS4 (Realtime) instead, as this maps to IPTOS_LOWDELAY.

Signed-off-by: Siddharth Chandrasekaran <csiddharth@vmware.com>
2019-09-26 11:39:46 +09:00
Yu Watanabe 55a1729fd0 network: drop noisy log message
Closes #13595.
2019-09-26 11:37:50 +09:00
Yu Watanabe 10b843efb0
Merge pull request #13649 from keszybz/arphrd-minimization
Arphrd minimization
2019-09-26 00:12:20 +09:00
cbzxt 37afb0ac78 Updated log message when the timesync happens for the first time (#13624) 2019-09-26 00:02:46 +09:00
Zbigniew Jędrzejewski-Szmek 508133917d units: make systemd-binfmt.service easier to work with no autofs
See https://bugzilla.redhat.com/show_bug.cgi?id=1731772:
when autofs4 is disabled in the kernel,
proc-sys-fs-binfmt_misc.automount is not started, so the binfmt_misc module is
never loaded. If we added a dependency on proc-sys-fs-binfmt_misc.mount
to systemd-binfmt.service, things would work even if autofs4 was disabled, but
we would unconditionally pull in the module and mount, which we don't want to do.
(Right now we ony load the module if some binfmt is configured.)
But let's make it easier to handle this case by doing two changes:
1. order systemd-binfmt.service after the .mount unit (so that the .service
   can count on the mount if both units are pulled in, even if .automount
   is skipped)
2. add [Install] section to the service unit. This way the user can do
   'systemctl enable proc-sys-fs-binfmt_misc.mount' to get the appropriate behaviour.
2019-09-25 23:44:01 +09:00
Zbigniew Jędrzejewski-Szmek 35bdba2115 basic/arphrd: stop discriminating against NETROM and CISCO
ARPHRD_NETROM was excluded, most likely just because it is protocol No. 0,
and ARPHRD_CISCO was reported under its alias name "HDLC". Let's just
allow defined aliases under the main name.
2019-09-25 12:17:51 +02:00
Zbigniew Jędrzejewski-Szmek 7e833f301e basic: massively reduce the size of arphdr lookup functions
Our biggest object in libsystemd was a table full of zeros, for the arphdr
names. Let's use a switch (which gcc nicely optimizes for us), instead a
table with a gap between 826 and 65534:

$ ls -l build{,2}/src/basic/a6ba3eb@@basic@sta/arphrd-list.c.o
-rw-rw-r--. 1 zbyszek zbyszek 540232 Sep 22 00:29 build/src/basic/a6ba3eb\@\@basic\@sta/arphrd-list.c.o
-rw-rw-r--. 1 zbyszek zbyszek  20512 Sep 25 11:56 build2/src/basic/a6ba3eb\@\@basic\@sta/arphrd-list.c.o

$ ls -l build{,2}/src/shared/libsystemd-shared-243.so
-rwxrwxr-x. 1 zbyszek zbyszek 6774368 Sep 22 00:29 build/src/shared/libsystemd-shared-243.so
-rwxrwxr-x. 1 zbyszek zbyszek 6254808 Sep 25 12:16 build2/src/shared/libsystemd-shared-243.so

No functional change.
2019-09-25 12:17:22 +02:00
Chris Down 182a7df57d
Merge pull request #13648 from evverx/unbreak-semaphore
semaphore: turn on systemd-networkd in lxc-containers on Semaphore
2019-09-25 11:41:03 +02:00
Zbigniew Jędrzejewski-Szmek 5a2904a2f7 test-arphdr-list: modernize and provide some useful output 2019-09-25 11:39:10 +02:00
Chris Down 511dbd5c05
Merge pull request #13636 from traylenator/manpage
Corect man page reference in systemd-nologin.conf comments
2019-09-25 11:32:20 +02:00
Chris Down 86f1aa77c2
Merge pull request #13641 from pwithnall/machinectl-docs-typo
man: Add a missing space in machinectl(1)
2019-09-25 11:24:11 +02:00
Filipe Brandenburger 28b77ab246 log: Add missing "%" in "%m" log format strings
These were clearly intended to be "%m" to display the human readable version
of the error stored in errno.
2019-09-25 09:28:26 +02:00
Evgeny Vereshchagin 6eee120dbc semaphore: turn on systemd-networkd in lxc-containers on Semaphore
It appears networking.service has broken down on Debian Buster.
2019-09-25 05:19:12 +00:00
Chris Down a007d6fc2a
Merge pull request #13481 from Antique/cgroupv2
cgroup: introduce support for cgroup v2 CPUSET controller
2019-09-24 21:57:06 +02:00
Philip Withnall abdc57dfe1 man: Add a missing space in machinectl(1)
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-24 16:07:23 +01:00
Susant Sahani 224ded670f link: Add support to configure NIC ring buffer size 2019-09-24 16:33:35 +02:00
Zbigniew Jędrzejewski-Szmek c569d529ec test-mountpoint-util: improve output a bit 2019-09-24 15:22:28 +02:00
Pavel Hrdina 1fbbb526ee cgroup-util: fix obsolete comment about supported controllers
The list might grow so make the comment more generic to not worry about
it if some controller is implemented.
2019-09-24 15:16:11 +02:00
Pavel Hrdina 047f5d63d7 cgroup: introduce support for cgroup v2 CPUSET controller
Introduce support for configuring cpus and mems for processes using
cgroup v2 CPUSET controller.  This allows users to limit which cpus
and memory NUMA nodes can be used by processes to better utilize
system resources.

The cgroup v2 interfaces to control it are cpuset.cpus and cpuset.mems
where the requested configuration is written.  However, it doesn't mean
that the requested configuration will be actually used as parent cgroup
may limit the cpus or mems as well.  In order to reflect the real
configuration cgroup v2 provides read-only files cpuset.cpus.effective
and cpuset.mems.effective which are exported to users as well.
2019-09-24 15:16:07 +02:00
Steve Traylen 7a72a95741 Corect man page reference in systemd-nologin.conf comments
The reference to the man page of `systemd-user-sessions.service`
in the comments of `tmpfiles.d/systemd-nologin.conf` is corrected.
2019-09-24 09:48:03 +02:00
Lennart Poettering 68c2b5ddb1
Merge pull request #13600 from keszybz/ratelimit
Clean up ratelimit functions and disable /dev/kmsg ratelimit
2019-09-23 12:59:09 +02:00
Yu Watanabe 82d1264048
Merge pull request #11883 from yuwata/network-dhcp-renew
network: dhcp renew
2019-09-22 07:44:23 +02:00
Yu Watanabe fc9d85b9bc
Merge pull request #13610 from yuwata/network-check-one-more-section
network: assorted follow-ups
2019-09-22 07:18:28 +02:00
Michael Biebl decef551af man: fix typo 2019-09-22 07:17:46 +02:00
Frantisek Sumsal 38288f0bb8 tree-wide: various code-formatting improvements
Reported/found by Coccinelle
2019-09-22 07:17:27 +02:00
Yu Watanabe 308e7dfdce networkctl: add renew command 2019-09-21 20:27:43 +09:00
Yu Watanabe ae65d7dbe3 network: introduce new bus method Renew() and RenewLink() 2019-09-21 20:27:36 +09:00
Yu Watanabe 714a199e48 network: add one more section validty check
Follow-up for 203d4df573.
2019-09-21 20:17:15 +09:00
Yu Watanabe 9b6dddd170 po: update Japanese translations
Follow-up for ea2552639b.
2019-09-21 20:16:22 +09:00
AsciiWolf 1697a28567 l10n: update Czech Translation 2019-09-21 08:26:09 +00:00
Chris Down 2c7e06de6d
Merge pull request #13605 from cdown/ono
Fixes for recent SIP work
2019-09-20 18:10:34 +02:00
Zbigniew Jędrzejewski-Szmek 78158d134b basic/log: put a ratelimit on our logging to /dev/kmsg
See the inline comment for details.
2019-09-20 16:05:53 +02:00
Zbigniew Jędrzejewski-Szmek 6123dfaa72 pid1: disable printk ratelimit in early boot
We have the problem that many early boot or late shutdown issues are harder
to solve than they could be because we have no logs. When journald is not
running, messages are redirected to /dev/kmsg. It is also the time when many
things happen in a rapid succession, so we tend to hit the kernel printk
ratelimit fairly reliably. The end result is that we get no logs from the time
where they would be most useful. Thus let's disable the kernels ratelimit.

Once the system is up and running, the ratelimit is not a problem. But during
normal runtime, things also log to journald, and not to /dev/kmsg, so the
ratelimit is not useful. Hence, there doesn't seem to be much point in trying
to restore the ratelimit after boot is finished and journald is up and running.

See kernel's commit 750afe7babd117daabebf4855da18e4418ea845e for the
description of the kenrel interface. Our setting has lower precedence than
explicit configuration on the kenrel command line.
2019-09-20 16:05:53 +02:00
Zbigniew Jędrzejewski-Szmek 5ac1530eca tree-wide: say "ratelimit" not "rate_limit"
"ratelimit" is a real word, so we don't need to use the other form anywhere.
We had both forms in various places, let's standarize on the shorter and more
correct one.
2019-09-20 16:05:53 +02:00
Zbigniew Jędrzejewski-Szmek 7bf081a1e5 pid1: rename start_limit to start_ratelimit
This way it is clearer what the type is. We also have auto_stop_ratelimit adjacent,
and it feels ugly to have a different suffix for those two.
2019-09-20 16:05:53 +02:00
Zbigniew Jędrzejewski-Szmek 8c227e7f2b Drop RATELIMIT macros
Using plain structure initialization is both shorter _and_ more clearer.
We get type safety for free.
2019-09-20 16:05:53 +02:00
Georg Müller ef90b6a4fb sd-radv: if lifetime < SD_RADV_DEFAULT_MAX_TIMEOUT_USEC, adjust timeout (#13491)
The RFC states that lifetime (AdvDefaultLifetime) must be at least
MaxRtrAdvInterval (which more or less corresponds to SD_RADV_DEFAULT_MAX_TIMEOUT_USEC
in systemd).

To fulfill this limit, virtually lower MaxRtrAdvInterval and MinRtrAdvInterval
accordingly.

Also check that min is not lower than 3s and max is not lower than 4s.
2019-09-20 13:52:29 +00:00