Lennart Poettering [Mon, 26 Nov 2018 20:05:37 +0000 (21:05 +0100)]
core: drop references to 'StandardOutputFileToCreate'
This property never existed, let's drop any reference to it.
Zbigniew Jędrzejewski-Szmek [Tue, 27 Nov 2018 09:04:20 +0000 (10:04 +0100)]
Merge pull request #10949 from yuwata/man-improve-unset
man: slightly update man pages of network related units
Yu Watanabe [Tue, 27 Nov 2018 06:07:58 +0000 (15:07 +0900)]
man: update explanation for boolean options
Yu Watanabe [Tue, 27 Nov 2018 05:40:25 +0000 (14:40 +0900)]
man: improve the explanation of "Defaults to unset"
Lennart Poettering [Mon, 26 Nov 2018 20:16:27 +0000 (21:16 +0100)]
test: add test for setting service manager environment variables
This is a follow-up for #10594. I somehow forgot to commit this when I
worked on that.
Yu Watanabe [Tue, 27 Nov 2018 05:24:43 +0000 (14:24 +0900)]
Merge pull request #10947 from poettering/sd-radv-fixes
sd-radv fixes
Lennart Poettering [Mon, 26 Nov 2018 16:48:22 +0000 (17:48 +0100)]
journald: don't try to rotate user journals in /var/log/journal/ if we are still in log-to-runtime-journal mode
Fixes: #10879
Susant Sahani [Mon, 26 Nov 2018 11:50:09 +0000 (17:20 +0530)]
networkd: Add support for ERSPAN tunnel
Please see: https://patchwork.ozlabs.org/patch/800327/
```
[NetDev]
Name=erspan-test
Kind=erspan
[Tunnel]
Independent=true
ERSPANIndex=123
Local = 172.16.1.200
Remote = 172.16.1.100
Key=101
SerializeTunneledPackets=true
```
Claudius Ellsel [Mon, 26 Nov 2018 20:10:42 +0000 (21:10 +0100)]
First restructuration of Logitech mice in 70-mouse.hwdb
Untested, just carefully copy and pasted under the created sections. First approach to #10941
Lennart Poettering [Mon, 26 Nov 2018 21:13:36 +0000 (22:13 +0100)]
sd-radv: use struct initializers
Lennart Poettering [Mon, 26 Nov 2018 21:13:15 +0000 (22:13 +0100)]
sd-radv: per our CODING_STYLE don't use 'bool' in public headers
Lennart Poettering [Mon, 26 Nov 2018 21:12:53 +0000 (22:12 +0100)]
sd-radv: no need to initialize r to zero
Lennart Poettering [Mon, 26 Nov 2018 21:12:38 +0000 (22:12 +0100)]
sd-radv: make sure we can deal with in_addr_to_string() failing
Lennart Poettering [Mon, 26 Nov 2018 21:12:07 +0000 (22:12 +0100)]
sd-radv: when receiving a too short packet, make sure we dequeue it
Lennart Poettering [Mon, 26 Nov 2018 21:11:12 +0000 (22:11 +0100)]
sd-radv: propagate OOM, it's reason to fail
Lennart Poettering [Mon, 26 Nov 2018 21:09:57 +0000 (22:09 +0100)]
sd-radv: follow our usualy rule that destructors can take NULL
Lennart Poettering [Mon, 26 Nov 2018 20:54:52 +0000 (21:54 +0100)]
sd-radv: simplify IPv6 address is-null check
Lennart Poettering [Mon, 26 Nov 2018 20:54:31 +0000 (21:54 +0100)]
sd-radv: drop const from non-ptr argument
Lennart Poettering [Mon, 26 Nov 2018 20:53:26 +0000 (21:53 +0100)]
sd-radv: use ether_addr_is_null() where appropriate
Lennart Poettering [Mon, 26 Nov 2018 16:38:52 +0000 (17:38 +0100)]
units: make fsck/grows/makefs/makeswap units conflict against shutdown.target
They are the only units we shipped/generated where this was missing really. Let's fix these.
Follow-up for: #10933
Lennart Poettering [Mon, 26 Nov 2018 18:10:26 +0000 (19:10 +0100)]
tree-wide: use SWAP_TWO a bit more
Yu Watanabe [Mon, 26 Nov 2018 06:46:55 +0000 (15:46 +0900)]
test-network: add tests for #5430 and GatewayOnLink=
Lennart Poettering [Mon, 26 Nov 2018 17:46:47 +0000 (18:46 +0100)]
Merge pull request #10928 from yuwata/fix-9940
network: also load foo.netdev.d/*.conf
Lennart Poettering [Mon, 26 Nov 2018 17:08:41 +0000 (18:08 +0100)]
Merge pull request #10919 from yuwata/sd-device-monitor-fixes
sd-device-monitor: several fixes
Harald Hoyer [Mon, 26 Nov 2018 10:41:29 +0000 (11:41 +0100)]
generator.c: systemd-fsck-root.service conflict with shutdown.target
Otherwise a "reboot" or "poweroff" in the initramfs will have to wait
until systemd-fsck-root.service has completed, which might never happen
if the root device never shows up.
Yu Watanabe [Mon, 26 Nov 2018 13:05:48 +0000 (22:05 +0900)]
test-network: add one more test for netdev dropin .conf files
For netdev, config files are loaded twice, and the first time,
only Match and NetDev setions are read. So, the test given by
the previous commit covers only the second loading.
This adds another test that also covers the first loading.
Yu Watanabe [Mon, 26 Nov 2018 13:40:51 +0000 (22:40 +0900)]
Merge pull request #10901 from poettering/startswith-list
add new STARTSWITH_SET() macro
Lennart Poettering [Mon, 26 Nov 2018 13:23:28 +0000 (14:23 +0100)]
Merge pull request #10927 from yuwata/udev-ctrl-cleanup
udev: update log messages and fix coding style issues
Lennart Poettering [Mon, 26 Nov 2018 13:20:36 +0000 (14:20 +0100)]
Merge pull request #10925 from yuwata/sd-boot-fixes
sd-boot: fixes trailing whitespace trimming and updates document
Lennart Poettering [Mon, 26 Nov 2018 13:19:03 +0000 (14:19 +0100)]
Merge pull request #10910 from yuwata/list-cleanups
basic/list: tiny fixes
Lennart Poettering [Mon, 26 Nov 2018 13:18:23 +0000 (14:18 +0100)]
Merge pull request #10909 from yuwata/import-cleanups
Import: cleanups
Lennart Poettering [Mon, 26 Nov 2018 13:13:01 +0000 (14:13 +0100)]
Merge pull request #10894 from poettering/root-cgroup-fix
A multitude of cgroup fixes
Lennart Poettering [Fri, 23 Nov 2018 15:53:39 +0000 (16:53 +0100)]
terminal-util: use PATH_STARTSWITH_SET() instead of plain startswith() where appropriate
After all, we deal with paths here.
Lennart Poettering [Fri, 23 Nov 2018 15:52:43 +0000 (16:52 +0100)]
journal-upload: use static initialization
Lennart Poettering [Fri, 23 Nov 2018 15:52:26 +0000 (16:52 +0100)]
journal-remote: shorten code a bit by using strcspn()
Lennart Poettering [Fri, 23 Nov 2018 15:51:53 +0000 (16:51 +0100)]
tree-wide: port more code over to PATH_STARTSWITH_SET()
Lennart Poettering [Fri, 23 Nov 2018 15:50:39 +0000 (16:50 +0100)]
path-util: beef up PATH_STARTSWITH_SET() macro a bit
Let's remove duplicate evaluation, and let's return the result of the
succesful path_startswith() call, i.e. the suffix to the matching
prefix.
Lennart Poettering [Fri, 23 Nov 2018 15:31:04 +0000 (16:31 +0100)]
tree-wide: port over more cases to STR_IN_SET()
Lennart Poettering [Fri, 23 Nov 2018 15:30:23 +0000 (16:30 +0100)]
tree-wide: port various places over to STARTSWITH_SET()
Lennart Poettering [Fri, 23 Nov 2018 15:27:15 +0000 (16:27 +0100)]
strv: add new macro STARTSWITH_SET()
This is to startswith() what PATH_STARTSWITH_SET() is to
path_startswith().
Or in other words, checks if the specified string has any of the listed
prefixes, and if so, returns the remainder of the string.
Lennart Poettering [Mon, 26 Nov 2018 12:41:07 +0000 (13:41 +0100)]
update TODO
Evgeny Vereshchagin [Mon, 26 Nov 2018 09:14:30 +0000 (12:14 +0300)]
tests: add a fuzzer for the udev rules parser (#10929)
Yu Watanabe [Mon, 26 Nov 2018 06:01:01 +0000 (15:01 +0900)]
test-network: add tests for dropin .conf files
Yu Watanabe [Mon, 26 Nov 2018 05:25:50 +0000 (14:25 +0900)]
network: also load foo.netdev.d/*.conf
Fixes #9940.
Yu Watanabe [Mon, 26 Nov 2018 02:57:48 +0000 (11:57 +0900)]
udevd: do not call udev_ctrl_enable_receiving() if the socket is passed from pid1
Before
c4b69e990f962128cc6975e36e91e9ad838fa2c4, if the socket fd is
passed from pid1, `udev_ctrl_enable_receiving()` was not called.
Let's preserve the original logic.
Yu Watanabe [Mon, 26 Nov 2018 02:53:21 +0000 (11:53 +0900)]
udev: drop duplicate whitespaces
Yu Watanabe [Mon, 26 Nov 2018 02:52:40 +0000 (11:52 +0900)]
udev-ctrl: update log messages
Yu Watanabe [Mon, 26 Nov 2018 02:37:29 +0000 (11:37 +0900)]
udev-rules: include device sysname in log messages
Yu Watanabe [Fri, 23 Nov 2018 19:46:27 +0000 (04:46 +0900)]
udev-ctrl: fix coding style isuues
Yu Watanabe [Mon, 26 Nov 2018 00:33:32 +0000 (09:33 +0900)]
Merge pull request #10926 from AsciiWolf/copyright
Drop my copyright
AsciiWolf [Sun, 25 Nov 2018 23:30:28 +0000 (00:30 +0100)]
mkosi: drop my copyright
AsciiWolf [Sun, 25 Nov 2018 23:26:03 +0000 (00:26 +0100)]
po: drop my copyright (cs.po)
Yu Watanabe [Sun, 25 Nov 2018 21:58:28 +0000 (06:58 +0900)]
man: systemd-boot does not read loader.conf.d/*.conf
Fixes #10923.
Yu Watanabe [Sun, 25 Nov 2018 21:43:33 +0000 (06:43 +0900)]
sd-boot: fix trailing whitespace trimming
Fixes #10922.
Marian Cepok [Sat, 24 Nov 2018 12:24:39 +0000 (13:24 +0100)]
hwdb: Add ACCEL_MOUNT_MATRIX for Trekstor T13B tablet
Yu Watanabe [Sun, 25 Nov 2018 06:04:26 +0000 (15:04 +0900)]
udevd: do not set buffer size if the socket is passed from pid1
Before
c4b69e990f962128cc6975e36e91e9ad838fa2c4, if the socket fd is
passed from pid1, `udev_monitor_set_receive_buffer_size()` (now it is
a wrapper of `sd_device_monitor_set_receive_buffer_size()`) was not
called. Let's preserve the original logic.
Yu Watanabe [Sun, 25 Nov 2018 05:52:24 +0000 (14:52 +0900)]
sd-device: do not call device_monitor_enable_receiving() for passed fd from pid1
Before
c4b69e990f962128cc6975e36e91e9ad838fa2c4, if the socket fd is
passed from pid1, `udev_monitor_enable_receiving()` (now it is a wrapper
of `device_monitor_enable_receiving`) was not called.
Let's preserve the original logic.
Fixes #10754.
Yu Watanabe [Sun, 25 Nov 2018 05:44:46 +0000 (14:44 +0900)]
sd-device: check whether filter is updated or not in sd_device_monitor_filter_update()
Yu Watanabe [Sun, 25 Nov 2018 05:06:56 +0000 (14:06 +0900)]
sd-device: update log message
Yu Watanabe [Sun, 25 Nov 2018 05:06:27 +0000 (14:06 +0900)]
sd-device: fix return value on error path
Lennart Poettering [Sat, 24 Nov 2018 14:59:37 +0000 (15:59 +0100)]
units: order systemd-rfkill.socket after /var/lib/systemd/rfkill (#10904)
Otherwise we might install the socket unit early, but the service
backing it late, and then end up in strange loops when we enter rescue
mode, because we saw an event on /dev/rfkill but really can't dispatch
it nor flush it.
Fixes: #9171
Evgeny Vereshchagin [Fri, 23 Nov 2018 17:26:02 +0000 (18:26 +0100)]
tests: skip test-execute on TravisCI under ASan
Unfortunately,
f5f9a580dd4a3cf487b didn't help much and now
the next subtest gets stuck from time to time. Let's skip
test-execute altogether so as not to bother anybody with
spurious failures.
https://github.com/systemd/systemd/issues/10696 is still open.
Everybody is welcome to share ideas :-)
nikolas [Fri, 23 Nov 2018 19:28:39 +0000 (14:28 -0500)]
Fix a few docs typos (#10907)
Found with [codespell](https://github.com/codespell-project/codespell)
Yu Watanabe [Fri, 23 Nov 2018 19:26:10 +0000 (04:26 +0900)]
basic/list: fix minor coding style issue
Yu Watanabe [Fri, 23 Nov 2018 19:25:00 +0000 (04:25 +0900)]
basic/list: add missing header
Some macros use assert() which is (re)defined in macro.h
Yu Watanabe [Fri, 23 Nov 2018 18:52:35 +0000 (03:52 +0900)]
import: use structured initializers
Yu Watanabe [Fri, 23 Nov 2018 18:14:32 +0000 (03:14 +0900)]
import: use _cleanup_ attribute for CURL object
nikolas [Fri, 23 Nov 2018 18:01:50 +0000 (13:01 -0500)]
Fix typo in hacking guide: "no possible" -> "not possible" (#10905)
Michal Koutný [Fri, 23 Nov 2018 17:40:32 +0000 (18:40 +0100)]
analyze: Fix build without seccomp (#10899)
Evgeny Vereshchagin [Thu, 22 Nov 2018 23:27:19 +0000 (00:27 +0100)]
tests: add a fuzzer for server_process_native_file
Thomas Haller [Fri, 23 Nov 2018 12:42:13 +0000 (13:42 +0100)]
dhcp6-client: handle IAID with value zero
config_parse_iaid(), dhcp_identifier_set_iaid() and sd_dhcp6_client_set_iaid() all
allow for the IAID to be zero. Also, RFC 3315 makes no mention that zero
would be invalid.
However, client_ensure_iaid() would take an IAID of zero as a sign that
the values was unset. Fix that by keeping track whether IAID is
initialized.
Lennart Poettering [Fri, 23 Nov 2018 15:00:16 +0000 (16:00 +0100)]
Merge pull request #10887 from poettering/run-love
systemd-run: modernizations, some new switches and let's set $INVOCATION_ID
Yu Watanabe [Fri, 23 Nov 2018 14:48:44 +0000 (23:48 +0900)]
Merge pull request #10893 from keszybz/udev-cleanup-followup
Udev cleanup follow-ups
Lennart Poettering [Fri, 23 Nov 2018 00:15:19 +0000 (01:15 +0100)]
test: extend testcase to ensure controller membership doesn't regress
Lennart Poettering [Fri, 23 Nov 2018 00:13:47 +0000 (01:13 +0100)]
cgroup: when we unload a unit, also update all its parent's members mask
This way we can corectly ensure that when a unit that requires some
controller goes away, we propagate the removal of it all the way up, so
that the controller is turned off in all the parents too.
Lennart Poettering [Fri, 23 Nov 2018 00:07:34 +0000 (01:07 +0100)]
cgroup: drastically simplify caching of cgroups members mask
Previously we tried to be smart: when a new unit appeared and it only
added controllers to the cgroup mask we'd update the cached members mask
in all parents by ORing in the controller flags in their cached values.
Unfortunately this was quite broken, as we missed some conditions when
this cache had to be reset (for example, when a unit got unloaded),
moreover the optimization doesn't work when a controller is removed
anyway (as in that case there's no other way for the parent to iterate
though all children if any other, remaining child unit still needs it).
Hence, let's simplify the logic substantially: instead of updating the
cache on the right events (which we didn't get right), let's simply
invalidate the cache, and generate it lazily when we encounter it later.
This should actually result in better behaviour as we don't have to
calculate the new members mask for a whole subtree whever we have the
suspicion something changed, but can delay it to the point where we
actually need the members mask.
This allows us to simplify things quite a bit, which is good, since
validating this cache for correctness is hard enough.
Fixes: #9512
Lennart Poettering [Fri, 23 Nov 2018 00:07:14 +0000 (01:07 +0100)]
cgroup: extend comment on what unit_release_cgroup() is for
Lennart Poettering [Fri, 23 Nov 2018 00:03:18 +0000 (01:03 +0100)]
cgroup: extend reasons when we realize the enable mask
After creating a cgroup we need to initialize its
"cgroup.subtree_control" file with the controllers its children want to
use. Currently we do so whenever the mkdir() on the cgroup succeeded,
i.e. when we know the cgroup is "fresh". Let's update the condition
slightly that we also do so when internally we assume a cgroup doesn't
exist yet, even if it already does (maybe left-over from a previous
run).
This shouldn't change anything IRL but make things a bit more robust.
Lennart Poettering [Fri, 23 Nov 2018 00:02:17 +0000 (01:02 +0100)]
cgroup: tighten call that detects whether we need to realize a unit's cgroup a bit, and comment why
Lennart Poettering [Thu, 22 Nov 2018 23:49:31 +0000 (00:49 +0100)]
cgroup: document what the various masks variables are used for
Lennart Poettering [Thu, 22 Nov 2018 23:48:31 +0000 (00:48 +0100)]
cgroup: extend cg_mask_supported() comment a bit
Lennart Poettering [Thu, 22 Nov 2018 21:11:07 +0000 (22:11 +0100)]
cgroup: simplify check whether it makes sense to realize a cgroup
Lennart Poettering [Thu, 22 Nov 2018 21:02:53 +0000 (22:02 +0100)]
cgroup: in unit_invalidate_cgroup() actually modify invalidation mask
Previously this would manipulate the realization mask for invalidating
the realization. This is a bit ugly though as the realization mask's
primary purpose to is to reflect in which hierarchies a cgroup currently
exists, and it's probably a good idea to keep that in sync with
realities.
We nowadays have the an explicit fields for invalidating cgroup
controller information, the "cgroup_invalidated_mask", let's use this
one instead.
The effect is pretty much the same, as the main consumer of these masks
(unit_has_mask_realize()) checks both anyway.
Lennart Poettering [Thu, 22 Nov 2018 20:45:33 +0000 (21:45 +0100)]
cgroup: be more careful with which controllers we can enable/disable on a cgroup
This changes cg_enable_everywhere() to return which controllers are
enabled for the specified cgroup. This information is then used to
correctly track the enablement mask currently in effect for a unit.
Moreover, when we try to turn off a controller, and this works, then
this is indicates that the parent unit might succesfully turn it off
now, too as our unit might have kept it busy.
So far, when realizing cgroups, i.e. when syncing up the kernel
representation of relevant cgroups with our own idea we would strictly
work from the root to the leaves. This is generally a good approach, as
when controllers are enabled this has to happen in root-to-leaves order.
However, when controllers are disabled this has to happen in the
opposite order: in leaves-to-root order (this is because controllers can
only be enabled in a child if it is already enabled in the parent, and
if it shall be disabled in the parent then it has to be disabled in the
child first, otherwise it is considered busy when it is attempted to
remove it in the parent).
To make things complicated when invalidating a unit's cgroup membershup
systemd can actually turn off some controllers previously turned on at
the very same time as it turns on other controllers previously turned
off. In such a case we have to work up leaves-to-root *and*
root-to-leaves right after each other. With this patch this is
implemented: we still generally operate root-to-leaves, but as soon as
we noticed we successfully turned off a controller previously turned on
for a cgroup we'll re-enqueue the cgroup realization for all parents of
a unit, thus implementing leaves-to-root where necessary.
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:24:26 +0000 (09:24 +0100)]
pid1,sd-device: use PATH_STARTSWITH_SET more
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:23:19 +0000 (09:23 +0100)]
basic/path-util: add missing header
PATH_STARTSWITH_SET uses STRV_FOREACH...
Lennart Poettering [Thu, 22 Nov 2018 19:40:00 +0000 (20:40 +0100)]
run: set $INVOCATION_ID for scope units
Services invoked by PID1 have $INVOCATION_ID initialized, hence let's do
that for scope units (where the payload process is invoked by us on the
client side) too, to minimize needless differences.
Fixes: #8082
Lennart Poettering [Thu, 22 Nov 2018 18:34:15 +0000 (19:34 +0100)]
run: port to static destructors
Lennart Poettering [Thu, 22 Nov 2018 18:30:03 +0000 (19:30 +0100)]
run: port to DEFINE_MAIN_FUNCTION()
Lennart Poettering [Thu, 22 Nov 2018 18:24:48 +0000 (19:24 +0100)]
run: add new --shell switch for spawning a shell as service
I keep running "systemd-run -t /bin/bash" to quickly get a shell running
in service context. I suspect I am not the only one, hence let's add a
shortcut for it. While we are at it, let's make it smarter, and
automatically inherit the $SHELL of the invoking user as well as the
working directory, and let's imply --pty. --shell (or -S) is hence
equivalent to "-t -d $SHELL".
Lennart Poettering [Thu, 22 Nov 2018 11:07:25 +0000 (12:07 +0100)]
run: add a switch for specifiying the working directory of a service
I find myself testing service management quite often with "systemd-run
-t /bin/bash". For that it is handy if the invoked shell would use the
working directory I am currently in. Hence introduce a shorthand for
that:
$ systemd-run -dt /bin/bash
This will automatically insert a WorkingDirectory= property into the
transient service, pointing to the working directory of the caller.
Lennart Poettering [Thu, 22 Nov 2018 11:02:13 +0000 (12:02 +0100)]
cgroup: tweak log message, so that it doesn't claim we always enable controllers when we actually disable them
Lennart Poettering [Thu, 22 Nov 2018 11:01:32 +0000 (12:01 +0100)]
cgroup: propagate errors when we cannot open cgroup.subtree_control
Lennart Poettering [Wed, 21 Nov 2018 17:27:15 +0000 (18:27 +0100)]
cgroup: add explanatory comment
Lennart Poettering [Wed, 21 Nov 2018 17:25:37 +0000 (18:25 +0100)]
cgroup: units that aren't loaded properly should not result in cgroup controllers being pulled in
This shouldn't make much difference in real life, but is a bit cleaner.
Lennart Poettering [Wed, 21 Nov 2018 16:48:41 +0000 (17:48 +0100)]
cgroup: dump delegation mask too
Lennart Poettering [Wed, 21 Nov 2018 16:44:14 +0000 (17:44 +0100)]
cgroup: make unit_get_needs_bpf_firewall() static too
Lennart Poettering [Wed, 21 Nov 2018 16:42:40 +0000 (17:42 +0100)]
cgroup: make some functions static
Lennart Poettering [Tue, 20 Nov 2018 22:05:12 +0000 (23:05 +0100)]
cgroup: fine tune when to apply cgroup attributes to the root cgroup
Let's tweak when precisely to apply cgroup attributes on the root
cgroup.
With this we now follow the following rules:
1. On cgroupsv2 we never apply any regular cgroups to the host root,
since the attributes generally do not exist there.
2. On cgroupsv1 we do not apply any "weight" or "shares" style
attributes to the host root cgroup, since they don't make much sense
on the top level where there's only one group, hence no need to
compare weights against each other. The other attributes are applied
to the host root cgroup however.
3. In any case we don't apply attributes to the root of container
environments (and --user roots), under the assumption that this is
managed by the manager further up. (Note that on cgroupsv2 this is
even enforced by the kernel)
4. BPF pseudo-attributes are applied in all cases (since we can have as
many of them as we want)
Lennart Poettering [Tue, 20 Nov 2018 21:50:13 +0000 (22:50 +0100)]
cgroup: append \n to static strings we write to cgroup attributes
This is a bit cleaner since we when we format numeric limits we append
it. And this way write_string_file() doesn't have to append it.