Commit Graph

39562 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek cc5549ca12 scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)

Also remove the few vim config lines that were left. We should either have them
on all files, or none.

Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-12 08:30:31 +02:00
Zbigniew Jędrzejewski-Szmek 408c9a07e5 test: filter out messages when stripping binaries
We would get an error for every script, which is just noise.
2019-04-12 08:23:41 +02:00
Lennart Poettering 03abeb0baf
Merge pull request #12267 from keszybz/udev-settle-warning
Udev settle warning
2019-04-11 19:01:03 +02:00
Yu Watanabe 01234e1fe7 tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0 2019-04-11 19:00:37 +02:00
Lennart Poettering aa46c28418
Merge pull request #12153 from benjarobin/killall-show-not-killed
shutdown/killall: Show in the console the processes not yet killed
2019-04-11 18:58:43 +02:00
Lennart Poettering 3f0e934a37
Merge pull request #12226 from poettering/22bit-pids
sysctl: let's by default increase the numeric PID range from 2^16 to …
2019-04-11 18:58:08 +02:00
Lennart Poettering 54f802ff8a
Merge pull request #12037 from poettering/oom-state
add cgroupv2 oom killer event handling to service management
2019-04-11 18:57:47 +02:00
Lennart Poettering 3b21fd06ed
Merge pull request #12219 from keszybz/bootctl-check-entries
bootctl: check entries when showing them
2019-04-11 18:57:18 +02:00
Zbigniew Jędrzejewski-Szmek 1e5d2d6564 NEWS: update contributors and date 2019-04-11 18:28:36 +02:00
Sebastian Krzyszkowiak 155bc908bc hwdb: mark Apple Magic Trackpads as external
Applies only to USB - when connected via Bluetooth it already gets marked correctly.
2019-04-11 18:27:01 +02:00
Jonathan Lebon 30fdb8962a fstab-generator: use DefaultDependencies=no for /sysroot mounts
Otherwise we can end up with an ordering cycle. Since d54bab90, all
local mounts now gain a default `Before=local-fs.target` dependency.
This doesn't make sense for `/sysroot` mounts in the initrd though,
since those happen later in the boot process.

Closes: #12231
2019-04-11 17:04:24 +02:00
Lennart Poettering 574ef404d8
Merge pull request #12279 from keszybz/sd-bus-long-signatures
sd-bus: properly handle messages with overlong signatures
2019-04-11 17:03:57 +02:00
Lennart Poettering a3a1f24f81
Merge pull request #12274 from poettering/nss-fixlets
some nss module fixlets
2019-04-11 15:21:45 +02:00
Zbigniew Jędrzejewski-Szmek fb270a26b2 sd-bus: add define for the maximum name length
Less magic numbers in the code…
2019-04-11 14:07:22 +02:00
Zbigniew Jędrzejewski-Szmek cfcc0059bf sd-bus: add define for the maximum signature length
Less magic numbers in the code…
2019-04-11 14:02:59 +02:00
Zbigniew Jędrzejewski-Szmek f0ae945ecc bus-message: validate signature in gvariant messages
We would accept a message with 40k signature and spend a lot of time iterating
over the nested arrays. Let's just reject it early, as we do for !gvariant
messages.
2019-04-11 14:01:38 +02:00
Lennart Poettering 8baaf650ef nss-resolve: list more errors as cause for fallback
If dbus-daemon kicks us from the bus or hangs, we should fallback too.

Fixes: #12203
2019-04-11 11:13:11 +02:00
Lennart Poettering 547fde4759 nss-resolve: simplify condition
Of course, if the error is NXDOMAIN then it's not one of the errors
listed for fallback, hence don't bother...
2019-04-11 11:13:11 +02:00
Lennart Poettering 2b0c1bfd8d nss-mymachines: return NO_RECOVERY instead of NO_DATA when we fail to do D-Bus and similar
This makes more semantical sense and is what we do in nss-resolve in a
similar case, hence let's remove the differences here.
2019-04-11 11:13:10 +02:00
Lennart Poettering e09e7ac3c4 nss-myhostname: unify code that handles NOT_FOUND case
Just some minor rework to make this more like nss-resolve.
2019-04-11 11:13:10 +02:00
Lennart Poettering a62fc245d0 nss-resolve: resue a jump target
We can reuse "fail" here, since it does the same thing.
2019-04-11 11:13:10 +02:00
Lennart Poettering c7c468c92a nss-resolve: return error properly 2019-04-11 11:13:10 +02:00
Lennart Poettering 954cba660d nss-resolve: drop unnecessary variable
We assign the same value to "ret" always, let's just return the value
literally.
2019-04-11 11:13:10 +02:00
Lennart Poettering fcd0f82e16
Merge pull request #12271 from poettering/errno-accept-again
accept() errno fixes
2019-04-11 10:22:46 +02:00
Yu Watanabe 8b0f4bac72 test: make directory for drop-in config
Follow-up for a2fbac5875.
2019-04-11 09:58:47 +02:00
Zbigniew Jędrzejewski-Szmek 4ddff52640
Merge pull request #12270 from yuwata/test-set-longer-timeout
test: set longer timeout
2019-04-11 08:31:14 +02:00
Lennart Poettering 4ff9bc2ea6 tree-wide: port users over to use new ERRNO_IS_ACCEPT_AGAIN() call 2019-04-10 22:11:18 +02:00
Yu Watanabe a2fbac5875 test: set longer watchdog timeout for timedated 2019-04-11 03:25:08 +09:00
Lennart Poettering fb0302ddbc errno-util: add new ERRNO_IS_ACCEPT_AGAIN() test
This is modelled after the existing ERRNO_IS_RESOURCES() and in
particular ERRNO_IS_DISCONNECT(). It returns true for all transient
network errors that should be handled like EAGAIN whenever we call
accept() or accept4(). This is per documentation in the accept(2) man
page that explicitly says to do so in the its "RETURN VALUE" section.

The error list we cover is a bit more comprehensive, and based on
existing code of ours. For example EINTR is included too (since we need
that to cover cases where we call accept()/accept4() on a blocking
socket), and of course ERRNO_IS_DISCONNECT() is a bit more comprehensive
than the list in the man page too.
2019-04-10 20:03:38 +02:00
Lennart Poettering 7f00010601 errno-util: rework ERRNO_IS_RESOURCE() from macro into static inline function
No technical reason, except that later on we want to add a new
ERRNO_IS() which uses the parameter twice and where we want to avoid
double evaluation, and where we'd like to keep things in the same style.
2019-04-10 20:03:38 +02:00
Lennart Poettering 916a9ec7c6 errno-util: add three more error codes to ERRNO_IS_DISCONNECT()
This is based on the recommendations in accept4() and the listed error
codes there.
2019-04-10 20:03:38 +02:00
Lennart Poettering 7ebd758cf6 tree-wide: voidify some socket calls 2019-04-10 20:03:38 +02:00
Lennart Poettering e2d0fa6feb lgtm: complain about accept() [people should use accept4() instead, due to O_CLOEXEC] 2019-04-10 20:03:38 +02:00
Benjamin Robin 763e7b5da6 core/killall: Add documentation about broadcast_signal() 2019-04-10 19:30:38 +02:00
Benjamin Robin 2c32f4f47d core/killall: Log the process names not killed after 10s 2019-04-10 19:27:38 +02:00
Benjamin Robin 827156b330 shutdown: Bump sysctl kernel.printk log level in order to see info msg 2019-04-10 19:27:38 +02:00
Yu Watanabe 70f3336e96 test: set longer timeout for 'udevadm control' 2019-04-11 02:27:15 +09:00
Zbigniew Jędrzejewski-Szmek 1662732768 systemd-udev-settle.service: emit deprecation notice 2019-04-10 15:58:14 +02:00
Yu Watanabe 86a3d44de5 network: fix use-of-uninitialized-value or null dereference
This fixes a bug introduced by 6ef5c881dd.

Fixes oss-fuzz#14157 and oss-fuzz#14158.
2019-04-10 18:18:11 +09:00
Zbigniew Jędrzejewski-Szmek 18a3882250 man: add a page for systemd-udev-settle.service 2019-04-10 10:12:43 +02:00
Paul Menzel 55a37d7117 Update UEFI URLs (#12260)
* Use more secure https://www.uefi.org

http://www.uefi.org directs to https://uefi.org/, so this saves one
redirect.

    $ curl -I http://www.uefi.org
    HTTP/1.1 302 Found
    Server: nginx
    Date: Tue, 09 Apr 2019 14:54:46 GMT
    Content-Type: text/html; charset=iso-8859-1
    Connection: keep-alive
    X-Content-Type-Options: nosniff
    Location: https://uefi.org/
    Cache-Control: max-age=1209600
    Expires: Tue, 23 Apr 2019 14:54:46 GMT

Run the command below to update all occurrences.

    git grep -l http://www.uefi.org | xargs sed -i 's,http://www.uefi.org,https://www.uefi.org,'

* Use https://uefi.org to save redirect

Save one redirect by using the target location.

    $ curl -I https://www.uefi.org
    HTTP/1.1 301 Moved Permanently
    Server: nginx
    Date: Tue, 09 Apr 2019 14:55:42 GMT
    Content-Type: text/html; charset=iso-8859-1
    Connection: keep-alive
    X-Content-Type-Options: nosniff
    Location: https://uefi.org/
    Cache-Control: max-age=1209600
    Expires: Tue, 23 Apr 2019 14:55:42 GMT

Run the command below to update all occurrences.

    git grep -l https://www.uefi.org | xargs sed -i 's,https://www.uefi.org,https://uefi.org,'
2019-04-09 18:37:46 +02:00
Zbigniew Jędrzejewski-Szmek 74b45889e4
Merge pull request #12252 from keszybz/libmount-dont-unescape
Don't unescape paths from libmount
2019-04-09 11:56:52 +02:00
Lennart Poettering 45497f4d3b sysctl: let's by default increase the numeric PID range from 2^16 to 2^22
This should PID collisions a tiny bit less likely, and thus improve
security and robustness.

2^22 isn't particularly a lot either, but it's the current kernel
limitation.

Bumping this limit was suggested by Linus himself:

https://lwn.net/ml/linux-kernel/CAHk-=wiZ40LVjnXSi9iHLE_-ZBsWFGCgdmNiYZUXn1-V5YBg2g@mail.gmail.com/

Let's experiment with this in systemd upstream first. Downstreams and
users can after all still comment this easily.

Besides compat concern the most often heard issue with such high PIDs is
usability, since they are potentially hard to type. I am not entirely sure though
whether 4194304 (as largest new PID) is that much worse to type or to
copy than 65563.

This should also simplify management of per system tasks limits as by
this move the sysctl /proc/sys/kernel/threads-max becomes the primary
knob to control how many processes to have in parallel.
2019-04-09 11:22:52 +02:00
Lennart Poettering 7d1d177b8d update TODO 2019-04-09 11:17:58 +02:00
Lennart Poettering 36869f3381 test: add test case for new OOM logic 2019-04-09 11:17:58 +02:00
Lennart Poettering 8e74bf7f9c man: document new OOMPolicy= setting 2019-04-09 11:17:58 +02:00
Lennart Poettering 34e86947e9 catalog: add a new catalog entry explaining the new OOM killer event log msg 2019-04-09 11:17:58 +02:00
Lennart Poettering afcfaa695c core: implement OOMPolicy= and watch cgroups for OOM killings
This adds a new per-service OOMPolicy= (along with a global
DefaultOOMPolicy=) that controls what to do if a process of the service
is killed by the kernel's OOM killer. It has three different values:
"continue" (old behaviour), "stop" (terminate the service), "kill" (let
the kernel kill all the service's processes).

On top of that, track OOM killer events per unit: generate a per-unit
structured, recognizable log message when we see an OOM killer event,
and put the service in a failure state if an OOM killer event was seen
and the selected policy was not "continue". A new "result" is defined
for this case: "oom-kill".

All of this relies on new cgroupv2 kernel functionality: the
"memory.events" notification interface and the "memory.oom.group"
attribute (which makes the kernel kill all cgroup processes
automatically).
2019-04-09 11:17:58 +02:00
Lennart Poettering a5b5aece01 service: beautify debug log message a bit 2019-04-09 11:17:58 +02:00
Lennart Poettering 0bb814c2c2 core: rename cgroup_inotify_wd → cgroup_control_inotify_wd
Let's rename the .cgroup_inotify_wd field of the Unit object to
.cgroup_control_inotify_wd. Let's similarly rename the hashmap
.cgroup_inotify_wd_unit of the Manager object to
.cgroup_control_inotify_wd_unit.

Why? As preparation for a later commit that allows us to watch the
"memory.events" cgroup attribute file in addition to the "cgroup.events"
file we already watch with the fields above. In that later commit we'll
add new fields "cgroup_memory_inotify_wd" to Unit and
"cgroup_memory_inotify_wd_unit" to Manager, that are used to watch these
other events file.

No change in behaviour. Just some renaming.
2019-04-09 11:17:57 +02:00