Commit Graph

41756 Commits

Author SHA1 Message Date
Kevin Kuehler 3a77f9fb4c systemctl: Default suffixes for timer and socket
* use .timer suffix by default for systemctl list-timers
* use .socket suffix by default for systemctl list-sockets
2019-10-04 08:27:56 +02:00
Zbigniew Jędrzejewski-Szmek 3509e678f8
Merge pull request #13690 from cdown/cgroup_rework
cgroup: Add support to check systemd-internal cgroup limits against the kernel
2019-10-03 22:09:56 +02:00
Zbigniew Jędrzejewski-Szmek e723fbd74e networkd: split out repeated code to a helper function
Follow-up for 156ddf8df7.
2019-10-03 22:08:34 +02:00
Franck Bui a5cede8c24 pid1: restore the original environment passed by the kernel when switching to a new system manager
PID1 may modified the environment passed by the kernel when it starts
running. Commit 9d48671c62 unset $HOME for
example.

In case PID1 is going to switch to a new root and execute a new system manager
which is not systemd, we should restore the original environment as the new
manager might expect some variables to be set by default (more specifically
$HOME).
2019-10-03 22:08:13 +02:00
Zbigniew Jędrzejewski-Szmek 694566454a
Merge pull request #13645 from danielstuart14/master
Add chromebook orientation quirk
2019-10-03 16:53:54 +02:00
Chris Down bc0623df16 cgroup: analyze: Report memory configurations that deviate from systemd
This is the most basic consumer of the new systemd-vs-kernel checker,
both acting as a reasonable standalone exerciser of the code, and also
as a way for easy inspection of deviations from systemd internal state.
2019-10-03 15:06:25 +01:00
Chris Down 6dfb92823f cgroup: analyze: Match standard dump format
We're the only ones left using = as the delimiter, which looks really
weird in `systemd-analyze dump`. Use `: ` like everyone else.
2019-10-03 15:06:25 +01:00
Chris Down 74b5fb272f cgroup: Allow checking systemd-internal limits against the kernel
We currently don't have any mitigations against another privileged user
on the system messing with the cgroup hierarchy, bringing the system out
of line with what we've set in systemd. We also don't have any real way
to surface this to the user (we do have logs, but you have to know to
look in the first place).

There are a few possible solutions:

1. Maintaining our own cgroup tree with the new fsopen API and having a
   read-only copy for everyone else. However, there are some
   complications on this front, and this may be infeasible in some
   environments. I'd rate this as a longer term effort that's tangential
   to this patch.
2. Actively checking for changes with {fa,i}notify and changing them
   back afterwards to match our configuration again. This is also
   possible, but it's also good to have a way to do passive monitoring
   of the situation without taking hard action. Also, currently daemons
   like senpai do actually need to modify the tree behind systemd's
   back (although hopefully this should be more integrated soon).

This patch implements another option, where one can, on demand, monitor
deviations in cgroup memory configuration from systemd's internal state.
Currently the only consumer is `systemd-analyze dump`, but the interface
is generic enough that it can also be exposed elsewhere later (for
example, over D-Bus).

Currently only memory limit style properties are supported, but later I
also plan to expand this out to other properties that systemd should
have ultimate control over.
2019-10-03 15:06:25 +01:00
Léonard Gérard e24918e295 Update sd_journal_print.xml
Fix the documentation part of the current limitation os sd_journal_print reported in #13706.
2019-10-03 15:56:57 +02:00
Mike Kazantsev fc103b3e34 cgroup: fix typo in BPF firewall support warning message 2019-10-03 15:48:57 +02:00
Chris Down 3a6da69a93 memory-util: Add PAGE_ALIGN_DOWN
For example, cgroup v2 rounds down to the previous page when returning
memory limits.
2019-10-03 14:43:30 +01:00
Zbigniew Jędrzejewski-Szmek 5afe558cfd
Merge pull request #12818 from yuwata/network-issue-8726
network: disable kernel creating prefix route when RouteTable= is set
2019-10-03 15:21:35 +02:00
Zbigniew Jędrzejewski-Szmek 86e94d95d0
Merge pull request #13246 from keszybz/add-SystemdOptions-efi-variable
Add efi variable to augment /proc/cmdline
2019-10-03 12:19:44 +02:00
Norbert Lange 68e70ac2b2 fix build with compilers with default stack-protector enabled
building systemd fails with a compiler that supports
-fstack-protector but does not enable it by default.
(will miss several __stack_chk_* symbols).

fix this by also adding the switch during linking.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
2019-10-03 12:19:29 +02:00
Nicolas Douma de1b29f375 nspawn: surrender controlling terminal to PID2 when using the PID1 stub 2019-10-03 12:13:03 +02:00
Zbigniew Jędrzejewski-Szmek 6e2d361d53
Merge pull request #13696 from keszybz/keep-dhcp-on-restart
Add a way to differentiate restart from stop and keep dhcp config on restart
2019-10-03 11:25:12 +02:00
Franck Bui c0000de87d pid1: fix DefaultTasksMax initialization
Otherwise DefaultTasksMax is always set to "inifinity".

This was broken by fb39af4ce4.
2019-10-03 11:24:27 +02:00
Torsten Hilbrich 751d8f7d54 hwdb: Add trackpoint rules for Lenovo Thinkpad 70, 80, 90
Extend the existing rules to match the Thinkpad models for the
previous 3 generations. It will work if a Synaptic Trackpoint is
built into the notebook. It will not work for Elantech trackpoints.

Succcessfully tested with T470s and T490 model.
2019-10-03 11:23:45 +02:00
Piotr Drąg e1ac3e6a4e po: update Polish translation 2019-10-02 16:11:52 +02:00
Dan Streetman 8084dcb9d7 src/core/automount: use DirectoryMode when calling mkdir -p
mkdir -p is called both when setting up the autofs mount, as well
as after being notified that the real mount unit should be called.
However the first mkdir -p is hardcoded with 0555, while the second
uses the value specified to DirectoryMode in the automount unit; the
second mkdir -p is only needed when called from coldplug, so under
normal operation the dirs are incorrectly created with mode 0555.

This replaces the hardcoded 0555 mode with the value of DirectoryMode.

Closes #13683.
2019-10-02 16:11:02 +02:00
Yu Watanabe 67acde4869 udevadm trigger: do not propagate EACCES and ENODEV
Inside container, writing file returns EACCESS. Moreover, some devices
return ENODEV rather than EACCES. So, let's also ignore these two
error causes.

Closes #13652.
2019-10-02 14:23:44 +02:00
Zbigniew Jędrzejewski-Szmek 8bea7e700f sd-dhcp-client: do not crash if sd_dhcp_client_send_release() is called with no lease
Again, a public function should not crash if called at an inopportune moment.

Also, make sure we don't call the function if we have no lease.
2019-10-02 14:01:42 +02:00
Zbigniew Jędrzejewski-Szmek 8ff4585ffa sd-dhcp-client: merge client_send_release() into sd_dhcp_client_send_release()
The public function and the implementation were split into two for
no particular reason.

We would assert() on the internal state of the client. This should not be done
in a function that is directly called from a public function. (I.e., we should
not crash if the public function is called at the wrong time.)
assert() is changed to assert_return().

And before anyone asks: I put the assert_returns() *above* the internal
variables on purpose. This makes it easier to see that the assert_returns()
are about the state that is passed in, and if they are not satisfied, the
function returns immediately. The compiler doesn't care either way, so
the ordering that is clearest to the reader should be chosen.
2019-10-02 14:01:42 +02:00
Zbigniew Jędrzejewski-Szmek 5f3b5f190f networkd: change SendRelease default to true
Now that we don't drop DHCP config on restart, this seems appropriate.
2019-10-02 14:01:42 +02:00
Zbigniew Jędrzejewski-Szmek 800603524a networkd: drop DHCPv4 config on stop, keep on restart, by default
This partially reverts 95355a281c.

It seems that other parts of link_stop_clients() should be skipped
when restarting, but I don't know enough about those other clients to have
an opinion if it is better to stop&start them on restart or not.
Anyway, that can be done in later patches now that the support for restarts
is there.

Fixes #13625.
2019-10-02 14:01:42 +02:00
Zbigniew Jędrzejewski-Szmek ab76be5581 networkd: use SIGUSR2 to do a restart
The code supports SIGTERM and SIGINT to termiante the process. It would
be possible to reporpose one of those signals for the restart operation,
but I think it's better to use a completely different signal to avoid
misunderstandings.
2019-10-02 14:01:42 +02:00
Zbigniew Jędrzejewski-Szmek 4ab1670f3d core: rework how logging level is calculated for kill operations
Setting the log level based on the signal made sense when signals that
were used were fixed. Since we allow signals to be configured, it doesn't
make sense to log at notice level about e.g. a restart or stop operation
just because the signal used is different.

This avoids messages like:
  six.service: Killing process 210356 (sleep) with signal SIGINT.
2019-10-02 14:01:40 +02:00
Zbigniew Jędrzejewski-Szmek b557f1c147 man: document the RestartKillSignal= setting 2019-10-02 14:01:27 +02:00
Zbigniew Jędrzejewski-Szmek a232ebcc2c core: add support for RestartKillSignal= to override signal used for restart jobs
v2:
- if RestartKillSignal= is not specified, fall back to KillSignal=. This is necessary
  to preserve backwards compatibility (and keep KillSignal= generally useful).
2019-10-02 14:01:25 +02:00
Frantisek Sumsal 065a74a7d8 basic: fix ASSERT_SIDE_EFFECT Coverity report in assert_se() 2019-10-02 10:43:47 +01:00
Chris Down 2bfd08ce38
Merge pull request #13691 from mrc0mmand/coverity-fixes
Coverity fixes for unchecked return values
2019-10-02 10:42:53 +01:00
Jonas Thelemann 56783ddf22 hwdb: Correct WWWW Pattern In Documentation Comment 2019-10-02 09:45:39 +09:00
Zbigniew Jędrzejewski-Szmek c78c095b1e nspawn: rename UNIFIED_CGROUP_HIERARCHY to SYSTEMD_NSPAWN_UNIFIED_HIERARCHY
We should never have used an unprefixed environment variable name.
All other systemd-nspawn variables have the "SYSTEMD_NSPAWN_" prefix,
and all other systemd variables have the "SYSTEMD_" prefix.

The new variable name takes precedence, but we fall back to checking the
old one. If only the old one is found, a warning is emitted.

In addition, SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="" is accepted as an override
to avoid looking for the old variable name.

We have a variable with the same name ($UNIFIED_CGROUP_HIERARCHY) in tests,
which governs both systemd-nspawn and qemu behaviour. It is not renamed.
2019-10-01 10:21:13 -07:00
Zbigniew Jędrzejewski-Szmek 490486842b nspawn: consistenly fail if parsing the environment fails
We would parse the environment twice (to re-apply settings after reading
config from disk), but we would not check the return code first time.
This means that for some settings we would ignore invalid values, while
for others, we'd fail at some point.

Let's just consistently fail. Those environment variables define important
aspects of behaviour, and it is better for the user if we ignore invalid
values. (Unknown settings are still ignored, so forward compatibility is
maintained.)
2019-10-01 10:21:13 -07:00
Zbigniew Jędrzejewski-Szmek 75b0d8b89d nspawn: default to unified hierarchy if --as-pid2 is used
See comment added in the patch.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1756143.
2019-10-01 10:21:13 -07:00
Susant Sahani 2805536bff network: DHCPv6 client add support for prefix delegation hint
Add support for prefix hint lenth and prefix hint address
```
Frame 43: 177 bytes on wire (1416 bits), 177 bytes captured (1416 bits) on interface 0
Ethernet II, Src: f6:c1:08:4d:45:f1 (f6:c1:08:4d:45:f1), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::d250:c82:7f6e:28d6, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x5c7902
    Rapid Commit
    Identity Association for Non-temporary Address
    Fully Qualified Domain Name
    Identity Association for Prefix Delegation
        Option: Identity Association for Prefix Delegation (25)
        Length: 41
        Value: 1b97b1690000000000000000001a0019ffffffffffffffff…
        IAID: 1b97b169
        T1: 0
        T2: 0
        IA Prefix
            Option: IA Prefix (26)
            Length: 25
            Value: ffffffffffffffff3c000000000000000000000000000000…
            Preferred lifetime: infinity
            Valid lifetime: infinity
            Prefix length: 60
            Prefix address: ::
    Option Request
    Client Identifier
    Elapsed time
```
2019-10-01 23:52:40 +09:00
Zbigniew Jędrzejewski-Szmek 28a2dfe801 core: add helper function to check job status
Since job.h includes unit.h, and unit.h includes job.h, imports need to
be adjusted to make sure unit.h is included first if the helper is used.
2019-10-01 15:05:27 +02:00
Zbigniew Jędrzejewski-Szmek fa036b6114 core: remove unused prototypes 2019-10-01 14:25:10 +02:00
Zbigniew Jędrzejewski-Szmek c436a4981e core: minor formatting adjustment 2019-10-01 14:13:35 +02:00
Jay Strict d90874b4e2 cryptsetup: bump minimum libcryptsetup version to v2.0.1
libcryptsetup v2.0.1 introduced new API calls, supporting 64 bit wide
integers for `keyfile_offset`. This change invokes the new function
call, gets rid of the warning that was added in #7689, and removes
redundant #ifdefery and constant definitions.
See https://gitlab.com/cryptsetup/cryptsetup/issues/359.

Fixes #7677.
2019-10-01 13:34:06 +02:00
Frantisek Sumsal 54756dce57 execute: explicitly ignore fd_wait_for_event()'s return value
Fixes CID#1402316
2019-10-01 10:25:36 +02:00
Frantisek Sumsal a5d27871f7 sd-event: explicitly ignore waitipid()'s return value
Fixes CID#1393252
2019-10-01 10:25:12 +02:00
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