Commit graph

41958 commits

Author SHA1 Message Date
Kevin Kuehler 965c5d1d5a systemctl: Add TriggeredBy and Triggers to status
For all units that aren't timers, if it is activated by another unit,
add the triggering unit under the  "TriggeredBy:" header. If a unit can
trigger other units, print the units it triggers other the "Triggers:"
header.
2019-11-05 21:51:31 +01:00
Anita Zhang 644ee25461
Merge pull request #13676 from ClydeByrdIII/service-result-patch
Update service result table
2019-10-29 11:35:41 -07:00
Michael Tretter 09ee387e08 boot-loader-spec: add devicetree-overlay key
Device tree overlays are a convenient way to patch device trees, e.g.,
add new devices to a device tree or enable/disable devices. This is
useful for non-discoverable but configurable hardware. Device tree
overlays are commonly used for displays on the Raspberry Pi or for
describing the content of FPGA bitstreams.

Add the devicetree-overlay key to boot loader specification entries to
allow boot loaders to apply overlays.

See #13537
2019-10-29 11:24:19 +01:00
Zbigniew Jędrzejewski-Szmek 228ae7ff11
Merge pull request #13864 from fbuihuu/no-more-swap-autoactivation
No more swap autoactivation
2019-10-29 11:16:45 +01:00
David Pedersen e6d6645517 network-generator: Add missing help for --root 2019-10-29 09:22:45 +09:00
Franck Bui d336ba9fa6 core: drop 'wants' parameter from unit_add_node_dependency()
Since Wants dependency is no more automagically added to swap and mount units,
this parameter is no more used hence this patch drops it.
2019-10-28 18:51:23 +01:00
Franck Bui 9b88bb5023 swap: do not make swap units wanted by its device unit anymore
It was done for mount units already (see commit 142b8142d7). For the
same reasons and for consistency we should also stop activating automagically
swaps when their device is hot-plugged.
2019-10-28 18:46:26 +01:00
Zbigniew Jędrzejewski-Szmek a5f6f346d3
Merge pull request #13423 from pwithnall/12035-session-time-limits
Add `RuntimeMaxSec=` support to scope units (time-limited login sessions)
2019-10-28 14:57:00 +01:00
Zbigniew Jędrzejewski-Szmek fec837e96e modules-load: do not fail service if modules are not present
It is pretty common for the service to fail in the initramfs (for example
because certain modules have not been copied over or haven't been built yet in
case of dkms modules). This seems to be more trouble than it is worth. Let's
change the service to simply log any missing modules at error level, but not
fail the whole service.

https://bugzilla.redhat.com/show_bug.cgi?id=1254340
2019-10-28 22:55:36 +09:00
Yu Watanabe 1c507a6db5
Merge pull request #13844 from keszybz/resolved-proprties
Emit dbus PropertyChanged notifications for systemd-resolved
2019-10-28 22:52:16 +09:00
Zbigniew Jędrzejewski-Szmek 9432f882a5 pid1: order .automount units after local-fs-pre.target
From the bug:
> According to the documentation of systemd.automount if the automoint point is
> automagically created if it doesn't exist yet. This ofcourse means the
> filesystem underneath has to be writable, which for / means not only does
> -.mount need to be started but also systemd-remount-fs.service has to be run,
> which isn't guaranteed by the default automount dependencies.
>
> For .mount units there is an automatic default After= dependency on
> local-fs-pre.target, would probably make sense to do the same for automount
> units to avoid it failing on the corner-case where it has to create directory.

Fixes #13306.
2019-10-28 22:44:32 +09:00
Philip Withnall adc09af234 pam_systemd: Forward systemd.runtime_max_sec setting to session scope
Allow earlier PAM modules to set `systemd.runtime_max_sec`. If they do,
parse it and set it as the `RuntimeMaxUSec=` property of the session
scope, to limit the maximum lifetime of the session. This could be
useful for time-limiting login sessions, for example.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #12035
2019-10-28 09:44:31 +01:00
Philip Withnall 9ed7de605d scope: Support RuntimeMaxSec= directive in scope units
Just as `RuntimeMaxSec=` is supported for service units, add support for
it to scope units. This will gracefully kill a scope after the timeout
expires from the moment the scope enters the running state.

This could be used for time-limited login sessions, for example.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #12035
2019-10-28 09:44:31 +01:00
Zbigniew Jędrzejewski-Szmek e9cfc71222
Merge pull request #13635 from fbuihuu/no-aliases-with-enable
man: alias names can't be used with enable command
2019-10-28 09:23:08 +01:00
Piotr Drąg 880a116ce3 po: update Polish translation 2019-10-26 17:17:30 +02:00
Anita Zhang 7bc9ea513a meson: expand ternary in functions to if statements
Per https://github.com/mesonbuild/meson/issues/5003, ternary doesn't
always work as function args with older versions of meson.
Expand out ternary statements to stay compatible with older versions (< 0.49).
2019-10-26 11:15:56 +02:00
Anita Zhang ecefbcc2a8
Merge pull request #13846 from keszybz/sleep-config-fixups
Sleep config fixups
2019-10-25 15:33:46 -07:00
Zbigniew Jędrzejewski-Szmek 21d0dd5a89 meson: allow WatchdogSec= in services to be configured
As discussed on systemd-devel [1], in Fedora we get lots of abrt reports
about the watchdog firing [2], but 100% of them seem to be caused by resource
starvation in the machine, and never actual deadlocks in the services being
monitored. Killing the services not only does not improve anything, but it
makes the resource starvation worse, because the service needs cycles to restart,
and coredump processing is also fairly expensive. This adds a configuration option
to allow the value to be changed. If the setting is not set, there is no change.

My plan is to set it to some ridiculusly high value, maybe 1h, to catch cases
where a service is actually hanging.

[1] https://lists.freedesktop.org/archives/systemd-devel/2019-October/043618.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1300212
2019-10-25 17:20:24 +02:00
Zbigniew Jędrzejewski-Szmek b72571e04d shared/sleep-config: two more error handling fixes, use structured initialization
CID#1406472.
2019-10-25 17:10:47 +02:00
Zbigniew Jędrzejewski-Szmek e97c369153 shared/sleep-config: fix error handling for open
CID#1406472.
2019-10-25 17:03:02 +02:00
Zbigniew Jędrzejewski-Szmek 4a6f996c01 resolved: emit change for CurrentDNSServer 2019-10-25 16:41:25 +02:00
Zbigniew Jędrzejewski-Szmek 86c0411ee5 resolved: emit change for LLMNRHostname 2019-10-25 16:41:25 +02:00
Zbigniew Jędrzejewski-Szmek 5f3340ca5b resolved: send out notifications about DNS property
Notifications are only sent for the top object, and not for individual
links. This should be enough for the most obvious cases where somebody
just cares about the effective set of servers.

Fixes #13721.
2019-10-25 16:40:54 +02:00
Zbigniew Jędrzejewski-Szmek 8e97dc676f resolved: make two functions static 2019-10-25 16:37:22 +02:00
Zbigniew Jędrzejewski-Szmek b2c1554625 resolved: one less {} 2019-10-25 16:37:22 +02:00
Zbigniew Jędrzejewski-Szmek 0a6c074568 resolved: avoid allocation
While at it, constify the argument.
2019-10-25 16:37:22 +02:00
Franck Bui 21b40f1662 fileio: introduce read_full_virtual_file() for reading virtual files in sysfs, procfs
Virtual filesystems such as sysfs or procfs use kernfs, and kernfs can work
with two sorts of virtual files.

One sort uses "seq_file", and the results of the first read are buffered for
the second read. The other sort uses "raw" reads which always go direct to the
device.

In the later case, the content of the virtual file must be retrieved with a
single read otherwise subsequent read might get the new value instead of
finding EOF immediately. That's the reason why the usage of fread(3) is
prohibited in this case as it always performs a second call to read(2) looking
for EOF which is subject to the race described previously.

Fixes: #13585.
2019-10-25 15:24:49 +02:00
Zbigniew Jędrzejewski-Szmek f5d28be33f
Merge pull request #13682 from zachsmith/systemd-sleep-prefer-resume-over-priority
systemd-sleep: prefer resume device or file
2019-10-25 14:48:12 +02:00
Zbigniew Jędrzejewski-Szmek 1bcefad919 Merge pull request #13623 from yuwata/network-wifi-iftype 2019-10-25 14:19:06 +02:00
Yu Watanabe 15e089644c network: add default configurations for wireless interfaces 2019-10-25 16:43:24 +09:00
Yu Watanabe 78404d22cc network: support matching based on wifi interfece type 2019-10-25 16:43:18 +09:00
Zbigniew Jędrzejewski-Szmek df7c4eb62a various tools: be more explicit when a glob is passed when not supported
See https://bugzilla.redhat.com/show_bug.cgi?id=1763488: when we say that
'foo@*.service' is not a valid unit name, this is not clear enough. Let's
include the name of the operation that does not support globbing in the
error message:

$ build/systemctl enable 'foo@*.service'
Glob pattern passed to enable, but globs are not supported for this.
Invalid unit name "foo@*.service" escaped as "foo@\x2a.service".
...
2019-10-25 13:41:49 +09:00
Dan Streetman 1c089741d3 resolved: set stream type during DnsStream creation
The DnsStreamType was added to track different types of DNS TCP streams,
instead of refcounting all of them together.  However, the stream type was
not actually set into the stream->type field, so while the reference count
was correctly incremented per-stream-type, the reference count was always
decremented in the cleanup function for stream type 0, leading to
underflow for the type 0 stream (unsigned) refcount, and preventing new
type 0 streams from being created.

Since type 0 is DNS_STREAM_LOOKUP, which is used to communicate with
upstream nameservers, once the refcount underflows the stub resolver
no longer is able to successfully fall back to TCP upstream lookups
for any truncated UDP packets.

This was found because lookups of A records with a large number of
addresses, too much to fit into a single 512 byte DNS UDP reply,
were causing getaddrinfo() to fall back to TCP and trigger this bug,
which then caused the TCP fallback for later large record lookups
to fail with 'connection timed out; no servers could be reached'.

The stream type was introduced in commit:
652ba568c6
2019-10-25 13:36:29 +09:00
Yu Watanabe f2106b1789
Merge pull request #13836 from systemd/assert-cleanups-and-constification
Assert cleanups and constification
2019-10-25 13:36:00 +09:00
Chen Qi 4a434023d2 machine-id-setup: avoid unexpected aborting
Code should not be reached 'Unhandled option' at src/machine-id-setup/machine-id-setup-main.c:97, function parse_argv(). Aborting.
Aborted

This behaviour is not good and will confuse user.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2019-10-25 13:35:37 +09:00
Zach Smith ea470720e4 systemd-sleep: improve /proc/swaps open fail message 2019-10-24 07:38:31 -07:00
Zach Smith 7bdf56a28a systemd-sleep: always prefer resume device or file
This change checks each swap partition or file reported in /proc/swaps
to see if it matches the values configured with resume= and
resume_offset= kernel parameters. If a match is found, the matching swap
entry is used as the hibernation location regardless of swap priority.
2019-10-24 07:38:24 -07:00
Zbigniew Jędrzejewski-Szmek a5648b8094 basic/fs-util: change CHASE_OPEN flag into a separate output parameter
chase_symlinks() would return negative on error, and either a non-negative status
or a non-negative fd when CHASE_OPEN was given. This made the interface quite
complicated, because dependning on the flags used, we would get two different
"types" of return object. Coverity was always confused by this, and flagged
every use of chase_symlinks() without CHASE_OPEN as a resource leak (because it
would this that an fd is returned). This patch uses a saparate output parameter,
so there is no confusion.

(I think it is OK to have functions which return either an error or an fd. It's
only returning *either* an fd or a non-fd that is confusing.)
2019-10-24 22:44:24 +09:00
Zbigniew Jędrzejewski-Szmek 58ce85f6a1 test-socket-util: avoid writing past the defined buffer
.sun_path has 108 bytes, and we'd write a string of 108 bytes + NUL.
I added this test, but I don't know what it was supposed to test. Let's
just remove.

Fixes #13713. CID#1405854.
2019-10-24 22:43:59 +09:00
Zbigniew Jędrzejewski-Szmek f7af63fd86 sd-dhcp-client: do not call assert in public functions 2019-10-24 12:04:48 +02:00
Zbigniew Jędrzejewski-Szmek 9b08c804ef sd-dhcp-client: remove unnecessary cleanup function
https://github.com/systemd/systemd/pull/13663#discussion_r335327099
2019-10-24 12:00:07 +02:00
Zbigniew Jędrzejewski-Szmek de157fe2a7 sd-netlink: constify object pointers passed to getters
sd-netlink is not public yet, so we can change the interface.

I did not touch interfaces of functions like sd_netlink_wait() and
sd_rtnl_message_new_link() which do not modify the object that is passed in,
because in the future we might want to change the code to e.g. take a
reference to the parent object or otherwise require a non-const reference.
2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 730b76bd2c sd-device: allow sd_device_get_devtype to be called with NULL arg and do not assert
We shouldn't call assert() on user-specified arguments in public functions.
While at it, let's return 1 if the type exists, and 0 otherwise.
2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 0e7f5ad9d3 Move PLYMOUTH_SOCKET define to def.h and nuke plymouth-util.h
Let's not have a file with a single define.
2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 8a2c82ac88 Remove unused plymouth_running() function 2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 1048436869
Merge pull request #13452 from yuwata/network-reload
network: add networkctl reload and reconfigure
2019-10-24 11:07:24 +02:00
Yu Watanabe 235ecb6d75 test: drop duplicated 's'
This fixes the following log message
```
Container TEST-07-ISSUE-1981 terminated by signal KILL.
E: test timed out after 30s s
```
2019-10-24 08:39:31 +02:00
Yu Watanabe dcd9f07ccf network: add tests for "networkctl reconfigure" 2019-10-24 14:23:17 +09:00
Yu Watanabe 8dc85c5ef1 networkctl: introduce reconfigure method 2019-10-24 14:23:12 +09:00
Yu Watanabe e4857ee2f2 networkctl: use format_ifname_full() 2019-10-24 14:20:48 +09:00