Commit graph

26284 commits

Author SHA1 Message Date
Yu Watanabe b297e0a7b0 network: show route scope, table, and type in debugging logs 2019-07-12 09:39:43 +09:00
Yu Watanabe 39f26098c9 network: update log message
Follow-up for 7f474ed78d and
44e891bbf6.
2019-07-12 09:39:43 +09:00
Yu Watanabe 94d6e29963 network: make Route.Type= support local, broadcast, anycast, multicast, nat, and xresolve
Closes #12975.
2019-07-12 09:39:43 +09:00
Yu Watanabe 7a22312d68 network: use string table to parse route type 2019-07-12 09:39:43 +09:00
Yu Watanabe 6fa0524133
Merge pull request #12971 from yuwata/network-reassign-static-routes
network: reassign static routes and process reply address messages
2019-07-12 09:36:16 +09:00
Lennart Poettering 66855de739 tree-wide: make use of errno_or_else() everywhere 2019-07-11 23:20:31 +02:00
Lennart Poettering fed813778f errno-util: add new errno_or_else() helper 2019-07-11 23:20:31 +02:00
Frantisek Sumsal 4747b645c6
Merge pull request #13025 from poettering/tmpfiles-fixo
unbreak the build
2019-07-11 19:55:55 +00:00
Lennart Poettering be9d8212a5
Merge pull request #13017 from yuwata/network-neighbor-lladdr-13015
network: rename Neighbor.MACAddress= and also support IPv4 address
2019-07-11 19:23:29 +02:00
Lennart Poettering a345cf448d tmpfiles: use path_join() where it makes sense 2019-07-11 18:42:26 +02:00
Lennart Poettering d34cd5711d tmpfiles: fix build
After I merged #12750 we don't build anymore, since the merged PR (which
passed CI) uses prefix_root() which doesn't exist anymore. Let's fix
that.
2019-07-11 18:41:14 +02:00
Lennart Poettering 6c75f78e94
Merge pull request #12750 from keszybz/tmpfiles-c-copy
Make tmpfiles C use --root
2019-07-11 18:13:19 +02:00
Yu Watanabe 7a555216df udevadm: ensure 'udevadm info -w' show updated result
This seems not necessary, but just for safety.
2019-07-11 17:39:36 +02:00
Lennart Poettering 2e8e1a1ab6
Merge pull request #12461 from Werkov/fix-job-ordering
Refactor job ordering implementation (and fix cycle detection)
2019-07-11 16:43:58 +02:00
Yu Watanabe 6545067aa9 network: re-assign static routes when dynamic address is updated
Follow-up for b5799eeb07.

Closes #7354.
2019-07-11 22:37:00 +09:00
Yu Watanabe 73854ba1a0 network: process address reply message 2019-07-11 22:37:00 +09:00
Yu Watanabe 7ed5420ab2 network: rework route_scope_from_address() 2019-07-11 22:37:00 +09:00
Yu Watanabe 9a897e22d4 util: introduce in4_addr_equal() 2019-07-11 22:37:00 +09:00
Yu Watanabe 661113a2a2 network: route_configure() do nothing when it returns 0 2019-07-11 22:37:00 +09:00
Yu Watanabe f5bab0d9c0 network: fdb: use ether_addr_from_string() 2019-07-11 22:22:29 +09:00
Yu Watanabe 8f8404d4c8 network: fdb: do not allocate separated memory for lladdr 2019-07-11 22:22:29 +09:00
Yu Watanabe 044d4b4067 network: drop invalid [Neighbor] section earlier 2019-07-11 22:22:29 +09:00
Yu Watanabe b956364db0 network: rename Neighbor.MACAddress= to Neighbor.LinkLayerAddress=
And make it support IPv4 address.

Closes #13015.
2019-07-11 22:22:29 +09:00
Yu Watanabe 49808e0e2d network: NDA_LLADDR attribute can also take struct in_addr 2019-07-11 22:22:29 +09:00
Yu Watanabe 5dc3dbe855 sd-netlink: make sd_netlink_message_read() returns size of read data 2019-07-11 22:22:29 +09:00
Lennart Poettering 10859c4902
Merge pull request #12176 from poettering/clean-dir2
add "systemctl clean" operation for clearing out StateDirectory=, CacheDirectory=, … of a service unit
2019-07-11 15:12:02 +02:00
Lennart Poettering 2eb1c19881 json: always allocate at least sizeof(JsonVariant) bytes
ubsan apparently doesn't like us being too smart here. Given the
difference is just a few bytes, let's avoid the noise.

Fixes: #13020
2019-07-11 15:10:33 +02:00
Lennart Poettering a7056cde56 systemctl: port "systemctl start --wait" logic to new bus-wait-for-units.c API 2019-07-11 12:18:51 +02:00
Lennart Poettering d81bc51fe3 systemctl: add new "clean" operation to systemctl
This exposes the CleanUnit() bus calls in systemctl, i.e. makes all the
infrastructure we previously added useful to people.
2019-07-11 12:18:51 +02:00
Lennart Poettering 3572d3df8f shared: add generic logic for waiting for a unit to enter some state
This is a generic implementation of a client-side logic of waiting until
a unit enters or leaves some state.

This is a more generic implementation of the WaitContext logic currently
in systemctl.c, and is supposed to replace it (a later commit does
this). It's similar to bus-wait-for-jobs.c and we probably should fold
that one into it later on.

This code is more powerful and cleaner than the WaitContext logic
however. In addition to waiting for a unit to exit this also allows us
to wait for a unit to leave the "maintainance" state.

This commit only implements the generic logic, and adds no users of it
yet.
2019-07-11 12:18:51 +02:00
Lennart Poettering 345f322185 core: expose per-service cleaning properties on the bus, too 2019-07-11 12:18:51 +02:00
Lennart Poettering 4d3bac5645 core: expose new clean operation on the bus
This adds CanClean() and Clean() as new methods on the Unit object that
initiate the cleaning operation.
2019-07-11 12:18:51 +02:00
Lennart Poettering 6b7b2ed96b core: add type of resource string table 2019-07-11 12:18:51 +02:00
Lennart Poettering 89f6fe7b30 core: hook up timer unit type with clean operation
timer units maintain state on disk (the persistent touch file), hence
let's expose cleaning it up generically with the new cleaning operation
for units.

This is a much simpler implementation as for the service unit type:
instead of forking out a worker process we just remove the touch file
directly. That should be OK since we only need to remove a single
(empty) file, instead of a recursive user-controlled directory tree.

Fixes: #4930
2019-07-11 12:18:51 +02:00
Lennart Poettering 4c2f584230 core: hook up service unit type with the new clean operation
The implementation is pretty straight-foward: when we get a request to
clean some type of resources we fork off a process doing that, and while
it is running we are in the "cleaning" state.
2019-07-11 12:18:51 +02:00
Lennart Poettering 380dc8b0a2 core: add generic "clean" operation to units
This adds basic infrastructure to implement a "clean" operation for unit
types. This "clean" operation is supposed to remove on-disk resources of
units, and is supposed to be used in a later commit to clean our
RuntimeDirectory=, StateDirectory= and so on of service units.

Later commits will open this up to the bus, and hook up service units
with this.

This also adds a new generic ActiveState called UNIT_MAINTENANCE. It's
supposed to cover all kinds of "maintainance" state of units.
Specifically, this is supposed to cover the "cleaning" operations later
added for service units which might take a bit of time. This high-level,
generic, abstract state is called UNIT_MAINTENANCE instead of the
more specific "UNIT_CLEANING", since I think this should be kept open
for different operations possibly later on that could be nicely subsumed
under this (for example, maybe a recursive chown()ing operation could be
covered by this, and similar).
2019-07-11 12:18:51 +02:00
Lennart Poettering c0228b4fa3 rm-rf: introduce new flag REMOVE_MISSING_OK
This new flag suppresses error if the top-level path specified doesn't
exist. This is useful since suppressing this on the caller side isn't
easy, since ENOENT migh be propagate for some reason from further inside
and we can't distuingish that.

While we are at it, also be a bit more careful witht the various
combinations of flags.

(Note that in some cases rm_rf() was already ignoring ENOENT from
unlink() or rmdir(), however that was pretty useless, since we always
open() the top-level path with O_DIRECTORY and if that hit ENOENT we
didn't ignore the failure).
2019-07-11 12:18:51 +02:00
Lennart Poettering 6b39223cd3 sd-bus: when installing a match make sure not to apply it to already queued messages
This tweaks match installation a bit: the match callbacks are now only
called for messages read after the AddMatch() reply was received and
never anything already read before. Thus, installing a match gives you a
time guarantee: only messages received after it will be matched.

This is useful when listening to PropertiesChanged signals as an example
to ensure that only changes after the point the match was installed are
honoured, nothing before.
2019-07-11 12:18:51 +02:00
Lennart Poettering 3cf8dd5359 sd-bus: destroy AddMatch() reply slot in failure case too
If AddMatch() doesn't work, let's destroy the slot for it too as soon as
we received the failure for it.

This way the mere existance of the slot tells us whether the AddMatch()
method call is still pending or is complete.
2019-07-11 12:18:51 +02:00
Lennart Poettering f1617a3b61 sd-bus: maintain a counter for incoming msgs
Let's count incoming messages and attach the current counter when we
first read them to the message objects. This allows us to nicely order
messages later on.
2019-07-11 12:18:51 +02:00
Lennart Poettering 66d3159739
Merge pull request #13018 from yuwata/network-tunnel-follow-up-13016
network: drop assertions about Tunnel.family
2019-07-11 12:10:39 +02:00
Lennart Poettering 7e82b4059b
Merge pull request #13006 from yuwata/network-split-dhcp-12917
networkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options
2019-07-11 10:28:03 +02:00
Yu Watanabe bb08b2a940
Merge pull request #13010 from poettering/fsck-usr-wants
generator: downgrade Requires= → Wants= of fsck from /usr mount unit
2019-07-11 15:13:51 +09:00
Yu Watanabe dfc3365593 network: ip6tnl and vti6 does not support the case both Local= and Remote= are any
This partially revert feb0c8b86f.

This also drop assertions about Tunnel.family.
2019-07-11 15:09:09 +09:00
Yu Watanabe 8c9c703c55 network: add AssignToLoopback= setting to [Tunnel] section
networkd does not manage loopback interface lo. So, previously, we have
no way to assign tunnel devices to lo.
2019-07-11 09:59:06 +09:00
Yu Watanabe 3140e8a55a network: simplify the condition about xfrm 2019-07-11 09:59:06 +09:00
Lennart Poettering 8e27167cc9
Merge pull request #13011 from keszybz/auto-erase
Remove string_erase and friends
2019-07-11 01:05:01 +02:00
Yu Watanabe feb0c8b86f network: support gre tunnel or friends with Local=any Remote=any
Fixes #13014.
2019-07-11 00:03:57 +02:00
Lennart Poettering 261e7d9270
Merge pull request #12755 from keszybz/short-identifiers
Allow using unit names in status messages
2019-07-11 00:00:51 +02:00
Lennart Poettering 08945b59d1
Merge pull request #12926 from keszybz/urlify-logs
Urlify CONFIG_FILE and improve SYSTEMD_LOG_LOCATION
2019-07-11 00:00:34 +02:00