Commit graph

38066 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 5745ca8ed8 hwdb: update
Looks to be additions and corrections again. It seems somebody removed
some whitespace in variuos places by mistake, let's hope this gets corrected
upstream. Doing such corrections downstream is not worth the trouble.
2019-01-22 11:12:14 +01:00
Zbigniew Jędrzejewski-Szmek 3a57413c26
Merge pull request #11448 from poettering/rlimit-pid1-fixo
RLIMIT_MEMLOCK fixes
2019-01-22 10:07:52 +01:00
Lennart Poettering fea46786ce resolved: preferably route single-label lookups to unicast DNS scopes with search domains (#11485)
Fixes: #11391
2019-01-22 09:57:49 +01:00
Yu Watanabe a9bc94e558 man: udevadm: clarify the behavior when multiple matching rules are specified
Closes #2995.
2019-01-22 09:33:49 +01:00
Zbigniew Jędrzejewski-Szmek 0a44684bcf
Merge pull request #11519 from yuwata/udevadm-info-2476
udevadm info: make -P imply -x and update man page
2019-01-22 08:30:26 +01:00
Michal Sekletar 07d16cc098 man: document db_persist udev rules OPTION
Fixes #1551
2019-01-22 08:20:09 +01:00
Yu Watanabe f0c29bbf83 man: add more explanation about options for "udevadm test"
Closes #2476.
2019-01-22 15:57:53 +09:00
Yu Watanabe 2277e84560 udevadm info: make --export-prefix imply --export
Setting --export without --export-prefix is meaningless.
2019-01-22 15:07:27 +09:00
Yu Watanabe 61a38e0265 wait-online: do not fail if we receive invalid messages
Fixes #11486.
2019-01-21 15:54:50 +01:00
Yu Watanabe 838b2f7a30 network: unset Network::manager when loading .network file fails
Otherwise, LIST_REMOVE() in network_free() fails.

This fixes the following assertion:
```
systemd-networkd[2595]: Bus bus-api-network: changing state UNSET → OPENING
systemd-networkd[2595]: Bus bus-api-network: changing state OPENING → AUTHENTICATING
systemd-networkd[2595]: timestamp of '/etc/systemd/network' changed
systemd-networkd[2595]: /etc/systemd/network/10-hoge.network:1: Invalid section header '[Network]Address=192.168.0.1'
systemd-networkd[2595]: /etc/systemd/network/10-hoge.network:1: Failed to parse file: Bad message
systemd-networkd[2595]: Assertion '*_head == _item' failed at ../../home/watanabe/git/systemd/src/network/networkd-network.c:378, function network_free(). Aborting.
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== Process terminating with default action of signal 6 (SIGABRT): dumping core
valgrind[2595]: ==2595==    at 0x4BCA53F: raise (in /usr/lib64/libc-2.28.so)
valgrind[2595]: ==2595==    by 0x4BB4894: abort (in /usr/lib64/libc-2.28.so)
valgrind[2595]: ==2595==    by 0x4955F09: log_assert_failed_realm (log.c:795)
valgrind[2595]: ==2595==    by 0x417101: network_free (networkd-network.c:378)
valgrind[2595]: ==2595==    by 0x415E99: network_freep (networkd-network.h:282)
valgrind[2595]: ==2595==    by 0x416AB2: network_load_one (networkd-network.c:101)
valgrind[2595]: ==2595==    by 0x416C39: network_load (networkd-network.c:293)
valgrind[2595]: ==2595==    by 0x414031: manager_load_config (networkd-manager.c:1502)
valgrind[2595]: ==2595==    by 0x40B258: run (networkd.c:82)
valgrind[2595]: ==2595==    by 0x40B74A: main (networkd.c:117)
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== HEAP SUMMARY:
valgrind[2595]: ==2595==     in use at exit: 32,621 bytes in 201 blocks
valgrind[2595]: ==2595==   total heap usage: 746 allocs, 545 frees, 241,027 bytes allocated
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== LEAK SUMMARY:
valgrind[2595]: ==2595==    definitely lost: 0 bytes in 0 blocks
valgrind[2595]: ==2595==    indirectly lost: 0 bytes in 0 blocks
valgrind[2595]: ==2595==      possibly lost: 0 bytes in 0 blocks
valgrind[2595]: ==2595==    still reachable: 32,621 bytes in 201 blocks
valgrind[2595]: ==2595==         suppressed: 0 bytes in 0 blocks
valgrind[2595]: ==2595== Reachable blocks (those to which a pointer was found) are not shown.
valgrind[2595]: ==2595== To see them, rerun with: --leak-check=full --show-leak-kinds=all
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== For counts of detected and suppressed errors, rerun with: -v
valgrind[2595]: ==2595== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
systemd-coredump[2600]: Process 2595 (memcheck-amd64-) of user 192 dumped core.
```
2019-01-21 15:53:12 +01:00
Yu Watanabe d0d7e10241 man: mention that 'udevadm control --exit' restarts systemd-udevd.service
Closes #1802.
2019-01-21 11:42:29 +01:00
Mike Gilbert f356aabe98 test-process-util: do not assume PID 1 has UID=0
Gentoo's Portage package manager uses a PID namespace for process
isolation and cleanup. In this namespace, PID 1 has UID=250 (portage).

Bug: https://bugs.gentoo.org/674458
2019-01-21 11:41:37 +01:00
Jonathon Kowalski 78218e6243 Enable some more debug logging for transaction building 2019-01-21 11:39:06 +01:00
Topi Miettinen 10d44e72ec Document weaknesses with MDWE and suggest hardening
Closes #11473
2019-01-21 11:37:46 +01:00
Frantisek Sumsal e4e039bce4 test: mark plymouth as optional dependency
rescue.service pulls in /bin/plymouth, which doesn't exist on some
distributions (e.g. Arch Linux). Let's mark it as optional, as it's not
even required by the referencing unit and causes unwanted fails in the
integration testsuite.
2019-01-21 11:35:24 +01:00
Louis Taylor a77f438b6a NEWS: add section about backslashes in EnvironmentFile
As a follow-up from #11427.
2019-01-21 11:35:00 +01:00
Frantisek Sumsal bb0e960448 meson: bump timeout for test-udev to 180s
On some (mainly virtual) machines the last test takes more than 30
seconds, which causes unnecessary fails, as the test itself is working
properly.
2019-01-21 11:33:54 +01:00
Zbigniew Jędrzejewski-Szmek 4b8183c153 Revert "hwdb: Fix secondary backslash on MSI GS65 laptop"
This reverts commit e05c8b4462.

The key in question is labeled as "|\" in the US version, and e.g. "<>" in
European version. In the US version there are two keys with the same label
and they are both mapped to the same keycode. Let's revert the patch, to unbreak
the non-US users.

US users should apply some local work-around, possibly simply keeping the
contents of the patch as a file in hwdb.d/.
2019-01-21 09:59:29 +01:00
Louis Taylor 8464d9e0dc mkosi: add qrencode to arch package list
Before adding this, I got errors about the library being missing such
as:

        journalctl: error while loading shared libraries: libqrencode.so.4: cannot open shared object file: No such file or directory

Fixes #7367.
2019-01-19 07:41:34 +09:00
Lennart Poettering 0efa18d636
Merge pull request #11424 from yuwata/fix-11420
timedate: refuse setting time when unit is in 'activating' or friends
2019-01-18 17:58:20 +01:00
Zbigniew Jędrzejewski-Szmek b0a28c2956
Merge pull request #11349 from yuwata/udevadm-control-ping
Add 'udevadm control --ping'
2019-01-18 17:41:00 +01:00
Lennart Poettering ce932d2d33 execute: make sure to call into PAM after initializing resource limits
We want that pam_limits takes precedence over our settings, after all.

Fixes: #11386
2019-01-18 17:31:36 +01:00
Lennart Poettering 498e265df1 fd-util: rework how we determine highest possible fd 2019-01-18 17:31:36 +01:00
Lennart Poettering 99a2fd3bca main: when generating the resource limit to pass to children, take FD_SETSIZE into consideration
When we synthesize a "struct rlimit" structure to pass on for
RLIMIT_NOFILE to our children, let's explicitly make sure that the soft
limit is not above FD_SETSIZE, for compat reason with select().

Note this only applies when we derive the "struct rlimit" from what we
inherited. If the user configures something explicitly it always takes
precedence.
2019-01-18 17:31:36 +01:00
Lennart Poettering cda7faa9a5 main: don't bump resource limits if they are higher than we need them anyway
This matters in particular in the case of --user, since there we lack
the privs to bump the limits up again later on when invoking children.
2019-01-18 17:31:36 +01:00
Lennart Poettering ddfa8b0b3b main: add commenting, clean up handling of saved resource limits
This doesn't really change behaviour, but adds comments and uses more
symbolic names for everything, to make this more readable.
2019-01-18 17:31:36 +01:00
Lennart Poettering c0d7695908 main: when bumping RLIMIT_MEMLOCK, save the previous value to pass to children
Let's make sure that the bumping of RLIMIT_MEMLOCK does not leak into
our children.
2019-01-18 17:31:36 +01:00
Yu Watanabe f77bb3a3bd bash-completion: udevadm: support recently added options 2019-01-18 16:10:01 +01:00
Yu Watanabe d30f43eec5 udevd: rename control command SYNC -> PING in log message 2019-01-18 16:10:01 +01:00
Yu Watanabe 2001622c58 udevadm: add --wait-daemon option to 'trigger' command 2019-01-18 16:10:01 +01:00
Yu Watanabe a82340cc03 udevadm: add --ping option to 'control' command
This exposes `udev_ctrl_send_ping()`.
2019-01-18 16:10:01 +01:00
Zbigniew Jędrzejewski-Szmek f26ad32197 NEWS: retroactively describe .include deprecation
Closes #11479.
2019-01-18 13:55:16 +01:00
Yu Watanabe 3e4eb8e73d sd-event: introduce event_free_signal_data()
We already have event_free_inotify_data() and event_free_inode_data().
2019-01-18 13:53:43 +01:00
Lennart Poettering 37b8602fb8
Merge pull request #11450 from keszybz/drop-nolegacy
Drop unused NOLEGACY define
2019-01-18 13:51:15 +01:00
Jonathon Kowalski 03ff2dc71e Change job mode of manager triggered restarts to JOB_REPLACE
Fixes: #11305
Fixes: #3260
Related: #11456

So, here's what happens in the described scenario in #11305. A unit goes
down, and that triggeres stop jobs for the other two units as they were
bound to it. Now, the timer for manager triggered restarts kicks in and
schedules a restart job with the JOB_FAIL job mode. This means there is
a stop job installed on those units, and now due to them being bound to
us they also get a restart job enqueued. This however is a conflicts, as
neither stop can merge into restart, nor restart into stop. However,
restart should be able to replace stop in any case. If the stop
procedure is ongoing, it can cancel the stop job, install itself, and
then after reaching dead finish and convert itself to a start job.
However, if we increase the timer, then it can always take those units
from inactive -> auto-restart.

We change the job mode to JOB_REPLACE so the restart job cancels the
stop job and installs itself.

Also, the original bug could be worked around by bumping RestartSec= to
avoid the conflicting.

This doesn't seem to be something that is going to break uses. That is
because for those who already had it working, there must have never been
conflicting jobs, as that would result in a desctructive transaction by
virtue of the job mode used.

After this change, the test case is able to work nicely without issues.
2019-01-18 13:50:52 +01:00
Lennart Poettering 8d4798e821
Merge pull request #11427 from kragniz/10659-env-file-quotes
util-lib: follow shell syntax for escape in quotes
2019-01-18 13:50:15 +01:00
Mike Auty 0912c0b80e Add multiple initrd file support to kernel-install
Instead of having just a single INITRD field, add support for all
additional parameters being INITRD fields in order.

Signed-off-by: Mike Auty <mike.auty@gmail.com>
2019-01-18 13:49:52 +01:00
dcanuhe 72de945726 add hwdb rule for Bangho touchpad (#11475)
add hwdb rule for Bangho touchpad
2019-01-18 13:49:29 +01:00
Lennart Poettering 5356ad6c36
Merge pull request #11465 from poettering/daemon-bus-flush
flush+close bus connections explicitly when our daemons go down
2019-01-18 13:48:52 +01:00
Lennart Poettering 8274a4132c
Merge pull request #11449 from keszybz/udev-link-naming-again
Make udev link re-renaming conditional
2019-01-17 20:06:55 +01:00
Lennart Poettering 92e29d82e6 tree-wide: fix some trailing whitespace
@bl33pbl0p, please fix your editor

(Apparently you never configured the source tree? If you did, then the
git pre-commit hook would have been enabled which doesn't allow
commiting non-whitespace clean stuff...)
2019-01-17 20:06:28 +01:00
Lennart Poettering c1642d7bf8
Merge pull request #11378 from keszybz/export-dbus-address-conditionally
Export dbus address conditionally
2019-01-17 18:36:01 +01:00
Lennart Poettering a8ea2833cf
Merge pull request #11375 from daxtens/issue5882
network: Fix IPv6 PreferredSource routes
2019-01-17 18:08:01 +01:00
Jörg Thalheim 990bb60a6f tools/choose-default-locale.sh: set shebang to /bin/sh
The script does not use any bash features.
On NixOS we have /bin/sh and /usr/bin/env for posix compatibility
but not /bin/bash as it is stored in our nix store.
With this change one can run the `meson configure` without patching
which greatly helps, when working on upstream contributions.
2019-01-17 18:06:16 +01:00
Louis Taylor e768a4f032 tree-wide: use '"' instead of '\"'
The escape used previously was redundant and made things more confusing.
2019-01-17 16:46:29 +00:00
Lennart Poettering 81a40363f5 core: shorten code by using new helper 2019-01-17 16:12:38 +01:00
Lennart Poettering b1a4981aed tree-wide: whenever we allocate a new bus object, close it before dropping final ref
This doesn't really change much, but feels more correct to do, as it
ensures that all messages currently queued in the bus connections are
definitely unreffed and thus destryoing of the connection object will
follow immediately.

Strictly speaking this change is entirely unnecessary, since nothing
else could have acquired a ref to the connection and queued a message
in, however, now that we have the new sd_bus_close_unref() helper it
makes a lot of sense to use it here, to ensure that whatever happens
nothing that might have been queued fucks with us.
2019-01-17 16:12:38 +01:00
Lennart Poettering aae82d1a36 initctl: shorten and update code a bit 2019-01-17 16:12:38 +01:00
Lennart Poettering 92e31da100 tree-wide: make sure to flush/close all bus connections when our daemons exit
Let's make sure everything is written out ebfore we exit, so that no
messages keep our bus connections referenced.

Fixes: #11462
2019-01-17 16:12:38 +01:00
Lennart Poettering bd62b74486 sd-bus: add sd_bus_close_unref() helper
It's similar to sd_bus_flush_close_unref() but doesn't do the flushing.
This is useful since this will still discnnect the connection properly
but not synchronously wait for the peer to take our messages.

Primary usecase is within _cleanup_() expressions where synchronously
waiting on the peer is not OK.
2019-01-17 16:12:38 +01:00