Commit Graph

30880 Commits

Author SHA1 Message Date
Lennart Poettering 67ca6412ab update TODO 2017-11-27 17:04:04 +01:00
Lennart Poettering 4050e47976 logind: use the new FDSTOREREMOVE=1 sd_notify() message
Let's explicitly tell PID 1 that we don't need an fd anymore, instead of
relying exclusively on POLLERR/POLLHUP for it to be removed.

Fixes: #6908
2017-11-27 17:04:04 +01:00
Lennart Poettering e78ee06de1 core: add a new sd_notify() message for removing fds from the FD store again
Currenly the only way to remove fds from the fdstore is to fully
stop the service, or to somehow trigger POLLERR/POLLHUP on the fd, in
which case systemd will remove the fd automatically.

Let's add another way: a new message that can be sent to remove fds
explicitly, given their name.
2017-11-27 17:04:04 +01:00
Lennart Poettering 8d1ab18a46 man: slightly improve the sd_notify() documentation regarding READY=1
READY=1 may be used to signal when a service finished startup, but also
when it finished reloading. Say so.
2017-11-27 17:01:09 +01:00
Lennart Poettering cc2b7b11b4 core: only process one of READY=1, STOPPING=1 or RELOADING=1 in sd_notify() handling
Of course, it's not really a valid sd_notify() message if multiple of
these fields are used in one, but let's handle this somewhat gracefully,
by only processing one of them, and ignoring the rest.
2017-11-27 17:01:00 +01:00
Lennart Poettering c45d11cb30 service: reorder sd_notify() handling a bit
Let's keep handling of WATCHDOG= and WATCHDOG_USEC= together. No
functional changes.
2017-11-27 16:59:52 +01:00
Lennart Poettering e328523777 service: split out sd_notify() message authorization code into a function of its own
Let's shorten service_notify_message() a bit, and do the authentication
outside of the main function body.

No functional changes.
2017-11-27 16:59:52 +01:00
Lennart Poettering 9711848ff1 core: only log about sd_notify() message contents, when debug logging is on
Let's optimize things a bit for the non-debug case. No change in
behaviour.

Main reason to do this is not so much the speed benefit though, but
merely to isolate the code from its surroundings more.
2017-11-27 16:39:43 +01:00
Vladislav Vishnyakov 534ab2ea1a Corrected Chuwi HiBook entry (#7483) 2017-11-27 16:32:07 +01:00
Patrik Flykt a86d329f22 networkd: Free Prefix in case allocation fails (#7480)
Set the code to call _cleanup_prefix_free_ in case the next allocation
fails so that Prefix does not leak memory.

Reported by evverx.
2017-11-27 13:07:22 +01: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