1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
Commit Graph

30871 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
cfc4529b01 networkd: unbork rule serialization
We'd write something like

RULE=from=250.250.240.0/24 to=(null)/0 tos=0 fwmark=0/0 table=12
RULE=from=250.250.250.0/24 to=(null)/0 tos=0 fwmark=0/0 table=11
2017-11-27 10:06:55 +00:00
Lennart Poettering
401e33ed56 logind: make sure we don't acces m->action_what if it's not initialized (#7475)
Fixes: #7466
2017-11-27 08:15:07 +01:00
Lennart Poettering
c8ace1bf5d
Merge pull request #7472 from keszybz/tests-on-a-slow-disk
Tests on a slow disk
2017-11-26 18:37:00 +01:00
Susant Sahani
97e7fb39a8 networkd: DHCP client do not get into a loop while setting MTU (#7460)
Some devices get reset itself while setting the MTU. we get in to a LOOP .
Once the MTU changed then the DHCP client talking with DHCP server never stops.
networkd gets into a loop and generates endless DHCP requests.

fixes #6593
fixes #7380
2017-11-26 15:21:45 +01:00
Zbigniew Jędrzejewski-Szmek
3113b5aca0 test: increase the timeout for hwdb-test
This test does a lot of mmap/madvise/unmmap, which is slow under address sanitizer.
Just increase the timeout to avoid spurious failure.
2017-11-26 15:07:53 +01:00
Zbigniew Jędrzejewski-Szmek
76b38997c9 test: increase timeout for test-journal-enum
This reads the journal from the host system, and in case of a slow
disk, the 30s default can be easily exceeded.
2017-11-26 15:07:53 +01:00
Evgeny Vereshchagin
3f19974091 exec-util: initialize new before using it (#7471)
CID #1383004
2017-11-26 12:46:56 +01:00
Zbigniew Jędrzejewski-Szmek
b45f436f61
Merge pull request #7464 from poettering/cgroup-control-fix
various cgroup fixes
2017-11-26 11:34:24 +01:00
Yu Watanabe
dd5082a9de
Merge pull request #7468 from yuwata/fix-7362
test and meson cleanups
2017-11-26 12:35:07 +09:00
Zbigniew Jędrzejewski-Szmek
07920ba095
Merge pull request #7467 from yuwata/fix-7302
nspawn: adjust path to static resolv.conf to support split usr
2017-11-25 23:13:12 +01:00
Yu Watanabe
7accca234d fileio: include sys/mman.h 2017-11-26 02:40:23 +09:00
Yu Watanabe
e481645174 meson: update header file to detect memfd_create() 2017-11-26 02:17:06 +09:00
Lennart Poettering
48f1b5e51d update TODO 2017-11-25 17:08:21 +01:00
Lennart Poettering
a4634b214c core: warn about left-over processes in cgroup on unit start
Now that we don't kill control processes anymore, let's at least warn
about any processes left-over in the unit cgroup at the moment of
starting the unit.
2017-11-25 17:08:21 +01:00
Lennart Poettering
e98b2fbbe9 core: generalize the cgroup empty check on GC
Let's move the cgroup empty check for all unit types into the generic
unit_check_gc() call, out of the per-unit-type _check_gc() type. This
not only allows us to share some code, but also hooks up mount and
socket units with this kind of check, for free, as it was missing there
previously.
2017-11-25 17:08:21 +01:00
Lennart Poettering
e9a4f67609 cgroup: remove logic for maintaining /control subcgroup for the service unit type
Previously, in the service unit type we ran all control processes in a
special subcgroup /control of the unit's main cgroup. Remove that, and
run the control program in the main cgroup instead.

The concept conflicts with cgroupv2's logic of "no processes in inner
nodes": if a unit has a main daemon process running in the main cgroup,
and a reload control process would be started in the /control subcgroup,
then this would necessarily fail, as the main daemon process would
become an inner node process that way.

We could in theory continue to support this in cgroupv1, but in the
interest in keeping behaviour similar in both hierarchies, let's drop
this altogether.

Philosophically maybe it wasn't the greatest idea anyway to just go
berserk and SIGKILL all those processes — loud warning logging might
have sufficed, too.
2017-11-25 17:08:21 +01:00
Lennart Poettering
60c728adf7 unit: initialize bpf cgroup realization state properly
Before this patch, the bpf cgroup realization state was implicitly set
to "NO", meaning that the bpf configuration was realized but was turned
off. That means invalidation requests for the bpf stuff (which we issue
in blanket fashion when doing a daemon reload) would actually later
result in a us re-realizing the unit, under the assumption it was
already realized once, even though in reality it never was realized
before.

This had the effect that after each daemon-reload we'd end up realizing
*all* defined units, even the unloaded ones, populating cgroupfs with
lots of unneeded empty cgroups.

With this fix we properly set the realiazation state to "INVALIDATED",
i.e. indicating the bpf stuff was never set up for the unit, and hence
when we try to invalidate it later we won't do anything.
2017-11-25 17:08:21 +01:00
Lennart Poettering
2aa57a6550 cgroup: when dispatching the cgroup realization queue, check again if we shall actually realize
We add units to the cgroup realization queue when propagating realizing
requests to sibling units, and when invalidating cgroup settings because
some cgroup setting changed. In the time between where we add the unit
to the queue until the cgroup is actually dispatched the unit's state
might have changed however, so that the unit doesn't actually need to be
realized anymore, for example because the unit went down. To handle
that, check the unit state again, if realization makes sense.

Redundant realization is usually not a problem, except when the unit is
not actually running, hence check exactly for that.
2017-11-25 17:08:21 +01:00
Lennart Poettering
0f2d84d2cc cgroup: drop unused parameter from function 2017-11-25 17:08:21 +01:00
Lennart Poettering
62b9bb2661 cgroup-util: merge cg_set_tasks_access() and cg-set_group_access() into one
We never use these functions seperately, hence don't bother splitting
them into to.

Also, simplify things a bit, and maintain tables for the attribute files
to chown. Let's also update those tables a bit, and include thenew
"cgroup.threads" file in it, that needs to be delegated too, according
to the documentation.
2017-11-25 17:08:21 +01:00
Lennart Poettering
deb3b156ac mkosi: let's switch to the unified mode for mkosi
This is a toolconfiguration for developers, and hence most likely should
be the first thing to be switched over. Do so.
2017-11-25 17:08:21 +01:00
Yu Watanabe
07b3a02643 test: set log_level to info in test-hwdb and check-help-*
These tests check the stderr. So, if the systemd.log_level=debug
is set in the kernel command line, then these tests fail.
This set log_level to info in hwdb-test.sh and meson-check-help.sh,
the kernel command line not to change the output of the target
programs.

Fixes #7362.
2017-11-26 00:01:55 +09:00
Vladislav Vishnyakov
7c3bdf5452 Added Chuwi HiBook support (#7465) 2017-11-25 15:40:55 +01:00
Zbigniew Jędrzejewski-Szmek
a0a7ba6598
Merge pull request #7449 from yuwata/clang-warnings
Several cleanups
2017-11-25 15:38:08 +01:00
Yu Watanabe
62b1e758d3 nspawn: adjust path to static resolv.conf to support split usr
Fixes #7302.
2017-11-25 21:11:07 +09:00
Yu Watanabe
359b496f66 meson: remove abbreviations in status 2017-11-25 20:35:24 +09:00
Yu Watanabe
a7353b4d14 firstboot: do not write vconsole.conf when arg_keymap is empty 2017-11-25 19:11:57 +09:00
Yu Watanabe
4540ae7400 machine: remove unused variables 2017-11-25 19:00:49 +09:00
Yu Watanabe
5354b0b7c0 journald: add _printf_ attribute to server_driver_message() 2017-11-25 19:00:44 +09:00
Lennart Poettering
2482f88d2a tests: make "test-execute" work in "sudo ninja -C build test" (#7463)
In this mode USER/LOGNAME still point to the original caller, and our
tests get confused by that.

Follow-up for: #7450
2017-11-24 22:56:44 +01:00
Lukasz Rubaszewski
3d22bc8636 tmpfiles: check if not too many symbolic links. (#7423)
Some filesystems do not set d_type value when
readdir is called, so entry type is unknown.
Therefore check if accessing entry does not
return ELOOP error.
2017-11-24 22:28:14 +01:00
Christian Brauner
1ff654e28b core: remove empty cgroups (#7457)
When we skip an unwritable cgroup also remove the empty mountpoint.
2017-11-24 21:05:16 +01:00
Michael Vogt
64b21ece8c networkd: auto promote links if "promote_secondaries" is unset (#7167)
The DHCP code in systemd-networkd relies on the
`net.ipv4.conf.{default,all,<if>}.promote_secondaries` sysctl to be set
(the kernels default is that it is unset). If this sysctl is not set
DHCP will work most of the time, however when the IP address changes
between leases then the system will loose its IP.

Because some distributions decided to not ship these defaults (Debian
is an example and via downstream Ubuntu) networkd by default will now
enable this sysctl opton automatically.
2017-11-24 21:03:05 +01:00
Lennart Poettering
d381c8a6bf nspawn: hash the machine name, when looking for a suitable UID base (#7437)
When "-U" is used we look for a UID range we can use for our container.
We start with the UID the tree is already assigned to, and if that
didn't work we'd pick random ranges so far. With this change we'll first
try to hash a suitable range from the container name, and use that if it
works, in order to make UID assignments more likely to be stable.

This follows a similar logic PID 1 follows when using DynamicUser=1.
2017-11-24 20:57:19 +01:00
Lennart Poettering
a8027a18f1
Merge pull request #7442 from poettering/scope-fixes
some fixes to the scope unit type
2017-11-24 17:15:09 +01:00
Lennart Poettering
b068c6f587 systemctl: ignore shutdown's "-t" argument (#7459)
We should not only ignore "-t" itself, but also whatever is passed to
it.

This pretty much reverts the core of
a4420f7b8e, and adds back in the status
quo ante. What a difference a ':' can make.

This also adds a quick comment for this, so that we don't make this
mistake again.

Fixes: #7413
2017-11-24 17:01:32 +01:00
Lennart Poettering
5f33279244
Merge pull request #7446 from poettering/efi-firmware-boot-fixes
logind efi boot-into-firmware fixes
2017-11-24 15:42:32 +01:00
Lennart Poettering
ff659c3491
Merge pull request #7458 from keszybz/two-build-fixes
Two build fixes
2017-11-24 15:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
8700b4da0e firstboot: remove some unnecessary code (#7456)
Inspired by #7449.
2017-11-24 15:40:24 +01:00
Lennart Poettering
dd202b8859 test: skip DELEGATE test if the kernel can't do cgroupv2 (#7445)
Fixes: #7440
2017-11-24 15:29:06 +01:00
Lennart Poettering
698470609c test: handle gracefully if decompressor tools are not installed (#7455)
Fixes: #7441
2017-11-24 14:08:51 +01:00
Zbigniew Jędrzejewski-Szmek
559d215b67 meson: restore building of man pages on demand even if -Dman=false
I want to configure -Dman=false for speed, but be able to build a specific
man page sometimes to check my edits. Commit 5b316b9ea6 broke this by mistake.
Let's adjust the condition to better match the logic of disabling tests only
if xsltproc is really not found.
2017-11-24 14:00:29 +01:00
Zbigniew Jędrzejewski-Szmek
8a8a4b6e3e Fix build without libkmod
All other places where libkmod.h is included are guarded. Build would
fail with:

In file included from ../src/core/kmod-setup.c:35:0:
../src/basic/module-util.h:23:10: fatal error: libkmod.h: No such file or directory
 #include <libkmod.h>
          ^~~~~~~~~~~
compilation terminated.
2017-11-24 13:54:20 +01:00
Lennart Poettering
cfb56a72ce
Merge pull request #7415 from keszybz/udev-alloca
udev: modernize style in path_id
2017-11-24 13:32:03 +01:00
Lennart Poettering
f170504825
Merge pull request #7453 from neosilky/coccinelle-fixes
Applied fixes from Coccinelle
2017-11-24 13:29:48 +01:00
Lennart Poettering
e92b78b561
Merge pull request #7454 from neosilky/cocci-fixes
Apply more fixes from Coccinelle
2017-11-24 13:29:32 +01:00
Lennart Poettering
846ab104ca efivars: if OsIndicationsSupported does not exist, assume that reboot-to-firmware is not available
It's not advertised and hence not available.

Fixes: #7424
2017-11-24 12:00:09 +01:00
Lennart Poettering
e22c567fea efivars: minor coding style improvements 2017-11-24 12:00:09 +01:00
Lennart Poettering
6f302ce676 logind: don't propagate firmware misbehaviours to bus clients
If for some reason we can't query the firmware state, don't propagate
that to clients, but instead log about it, and claim that
reboot-to-firmware is not available (which is the right answer, since it
is not working).

Let's log about this though, as this is certainly relevant to know, even
though not for the client.
2017-11-24 11:57:23 +01:00
Daniel Lockyer
4600a396d5 Remove NULL as last parameter to strjoin 2017-11-24 10:37:08 +00:00