1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
Commit Graph

30856 Commits

Author SHA1 Message Date
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
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
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
Daniel Lockyer
a7419dbc59 Replace use of snprintf with xsprintf 2017-11-24 10:36:04 +00:00
Daniel Lockyer
f9ecfd3bbe Replace free and reassignment with free_and_replace 2017-11-24 10:33:41 +00:00
Daniel Lockyer
5fecf46d76 Replace free and return NULL with return mfree 2017-11-24 10:31:49 +00:00
Daniel Lockyer
95333b2bed Replace free and nullify by mfree 2017-11-24 09:37:50 +00:00
Daniel Lockyer
87e4e28dcf Replace empty ternary with helper method 2017-11-24 09:31:08 +00:00
Yu Watanabe
8b3c4b5757 test-execute: test more % specifiers (#7450) 2017-11-24 10:17:28 +01:00
Shawn Landden
fb8e74a499 __attribute__((fallthrough)) only when -Wimplicit-fallthrough (#7448)
That is version 7 or greater
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

Fix regression of https://github.com/systemd/systemd/pull/7389
82a27ba821
on older gccs

bumping to re-run CI
upstream             FAIL timed out
boot-smoke           FAIL non-zero exit status 1
2017-11-24 10:08:12 +01:00
Lennart Poettering
9b3f8e5968 journalctl: add --output-fields= to --help text (#7443)
Follow-up for #7181
2017-11-24 10:04:14 +01:00
Lennart Poettering
371c0b794e core: track scope controllers on the bus
This watches controllers on the bus, and unsets them automatically when
they disappear.

Note that this is primarily a cosmetical fix. Since unique bus names are not
recycled, there's strictly no need to forget about them, but it's a lot
nicer to do so.
2017-11-23 21:47:48 +01:00
Lennart Poettering
f2c49c8658 core: refuse accepting a scope controller unless we are called on the API bus
Let's make sure clients get early errors if they try something weird.
2017-11-23 21:47:48 +01:00
Lennart Poettering
abdb9b08f6 nspawn: make use of the RequestStop logic of scope units
Since time began, scope units had a concept of "Controllers", a bus peer
that would be notified when somebody requested a unit to stop. None of
our code used that facility so far, let's change that.

This way, nspawn can print a nice message when somebody invokes
"systemctl stop" on the container's scope unit, and then react with the
right action to shut it down.
2017-11-23 21:47:48 +01:00
Lennart Poettering
33fe0afe9a core: serialize the "controller" field in scope units
We forgot to serialize it previously, hence daemon reload flushed it
out, since we also didn't write it to any unit file...
2017-11-23 21:47:48 +01:00
Lennart Poettering
b8afec2107 man: reorder/add sections to systemd.exec(5) (#7412)
The long long list of settings is getting too confusing, let's add some
sections and reorder things in them.

This makes no changes regarding contents, it only reorders things,
sometimes reindents them, and adds sections that made sense to me to
some degree.

Within each sections the settings are ordered by relevance (at least
according to how relevant I personally find them), and not
alphabetically.
2017-11-23 21:20:48 +01:00
Lennart Poettering
e2cd893bda
Merge pull request #7436 from poettering/mount-util-fixup
mount-util.c fixes regarding name_to_handle_at()
2017-11-23 21:01:12 +01:00
Susant Sahani
8dc787d185 networkd: fix commit 5f04a209ea (#7432)
If classless route not provided configure default routes.
Something went wrong in the rebase.
2017-11-24 01:38:08 +09:00