platform/upstream/systemd.git
5 years agotest-network: make wait_online() check setup state
Yu Watanabe [Mon, 15 Jul 2019 05:18:06 +0000 (14:18 +0900)]
test-network: make wait_online() check setup state

Previously, event if link's setup state is in failed, tests may pass,
as systemd-networkd-wait-online success if the state is in failed state.
This makes tests be checked more strictly.

5 years agonetwork: make link enter failed state when a configuration fails
Yu Watanabe [Sun, 14 Jul 2019 15:35:49 +0000 (00:35 +0900)]
network: make link enter failed state when a configuration fails

Some path of configuring address, route or etc., go to failed state, but
some do not. E.g., failure in address configuration which is provided by
DHCPv4 goes to failed state, but static address does not.

This is just for consistency. This should not change anything if
everything is fine.

This also voidify manager_rtnl_process_address().

5 years agosystemctl: do not suggest passing --all if the user passed --state=
Alan Jenkins [Tue, 4 Dec 2018 17:31:51 +0000 (17:31 +0000)]
systemctl: do not suggest passing --all if the user passed --state=

"systemctl --failed" suggested I pass "--all" to see units in the inactive
state as well.  I thought this was not very useful.  If you explicitly
asked for units in a specific state, then you already know you have
narrowed it down.  And if you ran "systemctl --state=inactive", it is even
more strange to see this message.

@keszybz suggests we probably don't want to suggest "list-unit-files"
either :-).  Let's only suggest that if the user passed "--state=inactive".

Finally, this means the output for "systemctl --failed" could be just
"0 loaded units listed".  In this case, we don't need any highlight on that
text, to distinguish it from the hint.  This matches "list-unit-files".
This also means we happen to avoid using red highlight, when there are zero
failed units, as if that itself was a failure.  @kesbyz pointed out that
old behaviour was a bit weird.

5 years agoMerge pull request #13054 from yuwata/network-dhcp-use-domains-8174
Yu Watanabe [Sun, 14 Jul 2019 18:29:19 +0000 (03:29 +0900)]
Merge pull request #13054 from yuwata/network-dhcp-use-domains-8174

network:dhcp4: request domain search list if UseDomains=yes

5 years agonetwork: show known route protocol name nicely in debugging logs
Yu Watanabe [Sun, 14 Jul 2019 00:51:54 +0000 (09:51 +0900)]
network: show known route protocol name nicely in debugging logs

5 years agotest-network: add tests for DHCPv4.UseDomains=
Yu Watanabe [Sun, 14 Jul 2019 01:46:16 +0000 (10:46 +0900)]
test-network: add tests for DHCPv4.UseDomains=

5 years agoUpdate NEWS
Boucman [Sun, 14 Jul 2019 14:41:19 +0000 (16:41 +0200)]
Update NEWS

5 years agoNEWS: add some notes for v243
Lennart Poettering [Sun, 14 Jul 2019 11:18:37 +0000 (13:18 +0200)]
NEWS: add some notes for v243

Let's get this ball rolling.

5 years agonetwork: honor IPv6AcceptRA.UseDomains= setting
Yu Watanabe [Sun, 14 Jul 2019 01:30:24 +0000 (10:30 +0900)]
network: honor IPv6AcceptRA.UseDomains= setting

5 years agonetwork:dhcp4: request domain search list if UseDomains=yes
Yu Watanabe [Sun, 14 Jul 2019 01:29:40 +0000 (10:29 +0900)]
network:dhcp4: request domain search list if UseDomains=yes

Closes #8174.

5 years agoMerge pull request #13042 from poettering/locale-utf8-fix
Lennart Poettering [Sun, 14 Jul 2019 11:31:40 +0000 (13:31 +0200)]
Merge pull request #13042 from poettering/locale-utf8-fix

Locale utf8 fix

5 years agoman: offline-updates: make dependence on system-update.target explicit
Michael Zhivich [Fri, 12 Jul 2019 16:22:30 +0000 (12:22 -0400)]
man: offline-updates: make dependence on system-update.target explicit

Current operation of system-update-cleanup.service (removing /system-update
symlink and rebooting) implies that any update must complete *before*
system-update.target is reached.

Update recommendations to include explicitly setting
Before=system-update.target in services that use offline-updates mode.

Signed-off-by: Michael Zhivich <mzhivich@akamai.com>
5 years agolocale-util: suppress non-UTF-8 locales when enumerating them
Lennart Poettering [Fri, 12 Jul 2019 11:38:43 +0000 (13:38 +0200)]
locale-util: suppress non-UTF-8 locales when enumerating them

Let's hide non-UTF-8 locales by default. It's 2019 after all.

Let's add an undocumented env var to reenable listing them though.

This should substantially shorten the list of choices we offer users,
and only show realistic choices.

note that only firstboot and localectl make use of this information, and
both allow configuration of values outside of these lists, hence all
this change does is hide legacy options, but they are still available if
you know what you do, and that's how it should be.

5 years agolocale-util: normalize UTF-8 locale names
Lennart Poettering [Fri, 12 Jul 2019 11:37:13 +0000 (13:37 +0200)]
locale-util: normalize UTF-8 locale names

Let's generate out lists in the format people expect.

5 years agonetwork: do not change to configuring state needlessly
Yu Watanabe [Sat, 13 Jul 2019 15:02:44 +0000 (00:02 +0900)]
network: do not change to configuring state needlessly

When DHCP or any other dynamic addresses are changed, then
link_request_set_routes() is invoked, and even if no static routes
are configured, the operational state is needlessly changed to
configuring state.
This makes the state is changed only when static routes are configured.

5 years agopo: Fix typo in German translation
Johannes Schmitz [Sat, 13 Jul 2019 12:43:54 +0000 (14:43 +0200)]
po: Fix typo in German translation

5 years agopo: update Polish translation
Piotr Drąg [Sat, 13 Jul 2019 12:43:13 +0000 (14:43 +0200)]
po: update Polish translation

5 years agoMerge pull request #13037 from poettering/shutdown-log-fixes
Yu Watanabe [Sat, 13 Jul 2019 14:00:12 +0000 (23:00 +0900)]
Merge pull request #13037 from poettering/shutdown-log-fixes

Shutdown log fixes

5 years agoMerge pull request #13041 from poettering/firstboot-fixes
Yu Watanabe [Sat, 13 Jul 2019 13:59:43 +0000 (22:59 +0900)]
Merge pull request #13041 from poettering/firstboot-fixes

two systemd-firstboot fixes

5 years agoudev: make Match.OriginalName=* matches all interfaces
Yu Watanabe [Fri, 12 Jul 2019 14:47:27 +0000 (23:47 +0900)]
udev: make Match.OriginalName=* matches all interfaces

Fixes #13035.

5 years agoMerge pull request #13043 from poettering/strip-tab-ansi-no-static-size
Yu Watanabe [Sat, 13 Jul 2019 09:12:39 +0000 (18:12 +0900)]
Merge pull request #13043 from poettering/strip-tab-ansi-no-static-size

util-lib: [static] array argument sizes are apparently not OK for NUL…

5 years agofirstboot: use color in welcome text
Lennart Poettering [Fri, 12 Jul 2019 11:52:01 +0000 (13:52 +0200)]
firstboot: use color in welcome text

5 years agofirstboot: suppress locale menu if there's nothing to choose from
Lennart Poettering [Fri, 12 Jul 2019 11:43:31 +0000 (13:43 +0200)]
firstboot: suppress locale menu if there's nothing to choose from

5 years agomain: use sysctl_writef() where appropriate
Lennart Poettering [Fri, 12 Jul 2019 09:04:12 +0000 (11:04 +0200)]
main: use sysctl_writef() where appropriate

5 years agoshutdown: merge variable declaration lines a bit
Lennart Poettering [Fri, 12 Jul 2019 08:42:31 +0000 (10:42 +0200)]
shutdown: merge variable declaration lines a bit

5 years agoshutdown: bump kmsg log level to LOG_WARNING only
Lennart Poettering [Fri, 12 Jul 2019 08:41:28 +0000 (10:41 +0200)]
shutdown: bump kmsg log level to LOG_WARNING only

Fixes: #12337

5 years agoshutdown: rework bump_sysctl_printk_log_level() to use sysctl_writef()
Lennart Poettering [Fri, 12 Jul 2019 08:41:06 +0000 (10:41 +0200)]
shutdown: rework bump_sysctl_printk_log_level() to use sysctl_writef()

5 years agosysctl: add sysctl_writef() helper
Lennart Poettering [Fri, 12 Jul 2019 08:34:04 +0000 (10:34 +0200)]
sysctl: add sysctl_writef() helper

5 years agoshutdown: use "int" for log level type
Lennart Poettering [Fri, 12 Jul 2019 08:25:28 +0000 (10:25 +0200)]
shutdown: use "int" for log level type

Let's remove some unnecessary confusion around signed/unsigned types for
log levels. Let's just stick to signed, because that is what glibc
generally appears to use.

While we are at it, add explicit logging for all error causes.

5 years agokillall: bump log message about unkilled processes to LOG_WARNING
Lennart Poettering [Fri, 12 Jul 2019 08:24:00 +0000 (10:24 +0200)]
killall: bump log message about unkilled processes to LOG_WARNING

By raising this, we can raise the kernel kmsg log level safely, and
still see these messages.

5 years agoalloc-util: drop _alloc_ decorator from memdup_suffix0()
Lennart Poettering [Fri, 12 Jul 2019 15:09:09 +0000 (17:09 +0200)]
alloc-util: drop _alloc_ decorator from memdup_suffix0()

Fixes: https://github.com/systemd/systemd/pull/13034#issuecomment-510801671

5 years agosemaphore: avoid running autopkgtest with --apt-upgrade
Evgeny Vereshchagin [Fri, 12 Jul 2019 00:08:15 +0000 (02:08 +0200)]
semaphore: avoid running autopkgtest with --apt-upgrade

by getting rid of the cache and upgrading images once every
time they are built from scratch.

5 years agotree-wide: some more [static] related fixes
Lennart Poettering [Fri, 12 Jul 2019 14:39:07 +0000 (16:39 +0200)]
tree-wide: some more [static] related fixes

let's add [static] where it was missing so far

Drop [static] on parameters that can be NULL.

Add an assert() around parameters that have [static] and can't be NULL
hence.

Add some "const" where it was forgotten.

5 years agoutil-lib: [static] array argument sizes are apparently not OK for NULL parameters
Lennart Poettering [Fri, 12 Jul 2019 14:17:51 +0000 (16:17 +0200)]
util-lib: [static] array argument sizes are apparently not OK for NULL parameters

Let's drop the 'static' logic when a parameter can be NULL.

I think asan/ubsan are right here, judging by the C99 spec language:

"A declaration of a parameter as ‘‘array of type’’ shall be adjusted to
‘‘qualified pointer to type’’, where the type qualifiers (if any) are
those specified within the [ and ] of the array type derivation. If the
keyword static also appears within the [ and ] of the array type
derivation, then for each call to the function, the value of the
corresponding actual argument shall provide access to the first element
of an array with at least as many elements as specified by the size
expression."

If we specify NULL, then we certainly don't pvode access to any valid
array.

Fixes: #13039

5 years agoMerge pull request #13036 from poettering/more-doc-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 12 Jul 2019 14:28:24 +0000 (16:28 +0200)]
Merge pull request #13036 from poettering/more-doc-fixes

Six documentation fixes

5 years agoman: add example for setting multiple properties at once
Lennart Poettering [Fri, 12 Jul 2019 07:55:05 +0000 (09:55 +0200)]
man: add example for setting multiple properties at once

Fixes: #4908

5 years agoman: CPUShares= is so 2015
Lennart Poettering [Fri, 12 Jul 2019 07:54:40 +0000 (09:54 +0200)]
man: CPUShares= is so 2015

Let's update our example to the brave new cgroupsv2 world, and use
CPUWeight= in our example.

5 years agoman: document that WakeSystem= requires privs
Lennart Poettering [Fri, 12 Jul 2019 07:45:21 +0000 (09:45 +0200)]
man: document that WakeSystem= requires privs

Fixes: #11677

5 years agoman: document that "systemd-analyze blame/critical-chain" is not useful to track...
Lennart Poettering [Fri, 12 Jul 2019 07:36:17 +0000 (09:36 +0200)]
man: document that "systemd-analyze blame/critical-chain" is not useful to track down job latency

Fixes: #12272

5 years agoman: be more explicit that Type=oneshot services are not "active" after starting
Lennart Poettering [Fri, 12 Jul 2019 07:25:22 +0000 (09:25 +0200)]
man: be more explicit that Type=oneshot services are not "active" after starting

Fixes: #13000

5 years agoman: document that the supplementary groups list is initialized from User='s database...
Lennart Poettering [Fri, 12 Jul 2019 07:18:59 +0000 (09:18 +0200)]
man: document that the supplementary groups list is initialized from User='s database entry

Fixes: #12936

5 years agoMerge pull request #13034 from poettering/memdup-suffix0-multiply-fixo
Lennart Poettering [Fri, 12 Jul 2019 12:11:31 +0000 (14:11 +0200)]
Merge pull request #13034 from poettering/memdup-suffix0-multiply-fixo

memdup_suffix0_multiply fix

5 years agoutil-lib: fix comment
Lennart Poettering [Fri, 12 Jul 2019 06:49:53 +0000 (08:49 +0200)]
util-lib: fix comment

As suggested by @ralt.

Fixes: #12896

5 years agotest: modernize test-alloc-util.c test a bit
Lennart Poettering [Fri, 12 Jul 2019 07:10:13 +0000 (09:10 +0200)]
test: modernize test-alloc-util.c test a bit

5 years agoalloc-util: drop _alloc_(2, 3) decorator from memdup_suffix0_multiply()
Lennart Poettering [Fri, 12 Jul 2019 07:06:28 +0000 (09:06 +0200)]
alloc-util: drop _alloc_(2, 3) decorator from memdup_suffix0_multiply()

This decorator tells compilers that the memory we return is shorter than
it actually is, thus triggering misleading bad memory access complaints.

Fixes: #13026

5 years agoMerge pull request #13022 from keszybz/coverity-cleanups
Lennart Poettering [Fri, 12 Jul 2019 05:37:44 +0000 (07:37 +0200)]
Merge pull request #13022 from keszybz/coverity-cleanups

Coverity cleanups

5 years agoMerge pull request #13031 from yuwata/network-route-type-local-12975-2
Yu Watanabe [Fri, 12 Jul 2019 05:31:50 +0000 (14:31 +0900)]
Merge pull request #13031 from yuwata/network-route-type-local-12975-2

network: make Route.Type= support local or friends

5 years agotree-wide: get rid of strappend()
Lennart Poettering [Thu, 11 Jul 2019 17:14:16 +0000 (19:14 +0200)]
tree-wide: get rid of strappend()

It's a special case of strjoin(), so no need to keep both. In particular
as typing strjoin() is even shoert than strappend().

5 years agotest-network: add tests for route with type local, multicast, anycast, or broadcast
Yu Watanabe [Sun, 7 Jul 2019 12:57:22 +0000 (21:57 +0900)]
test-network: add tests for route with type local, multicast, anycast, or broadcast

5 years agonetwork: also show route protocol in debugging logs
Yu Watanabe [Tue, 9 Jul 2019 15:18:53 +0000 (00:18 +0900)]
network: also show route protocol in debugging logs

5 years agonetwork: use string table for route protocol
Yu Watanabe [Mon, 8 Jul 2019 11:36:19 +0000 (20:36 +0900)]
network: use string table for route protocol

5 years agonetwork: use string table to parse route table or scope
Yu Watanabe [Mon, 8 Jul 2019 11:19:28 +0000 (20:19 +0900)]
network: use string table to parse route table or scope

5 years agonetwork: show route scope, table, and type in debugging logs
Yu Watanabe [Sun, 7 Jul 2019 12:50:05 +0000 (21:50 +0900)]
network: show route scope, table, and type in debugging logs

5 years agonetwork: update log message
Yu Watanabe [Sun, 7 Jul 2019 11:34:54 +0000 (20:34 +0900)]
network: update log message

Follow-up for 7f474ed78df138677557fb43701efeb6e2588c6f and
44e891bbf6908e494856fcf3011e88a70a12e087.

5 years agonetwork: make Route.Type= support local, broadcast, anycast, multicast, nat, and...
Yu Watanabe [Sun, 7 Jul 2019 00:40:17 +0000 (09:40 +0900)]
network: make Route.Type= support local, broadcast, anycast, multicast, nat, and xresolve

Closes #12975.

5 years agonetwork: use string table to parse route type
Yu Watanabe [Sat, 6 Jul 2019 23:43:33 +0000 (08:43 +0900)]
network: use string table to parse route type

5 years agotest-network: test more bridge properties
Yu Watanabe [Sat, 6 Jul 2019 22:46:08 +0000 (07:46 +0900)]
test-network: test more bridge properties

Imported from networkd-test.py

5 years agoMerge pull request #12971 from yuwata/network-reassign-static-routes
Yu Watanabe [Fri, 12 Jul 2019 00:36:16 +0000 (09:36 +0900)]
Merge pull request #12971 from yuwata/network-reassign-static-routes

network: reassign static routes and process reply address messages

5 years agoMerge pull request #13024 from poettering/errno-or-else
Yu Watanabe [Fri, 12 Jul 2019 00:33:21 +0000 (09:33 +0900)]
Merge pull request #13024 from poettering/errno-or-else

Errno or else

5 years agoshared/ask-password-api: backspace all chars at once
Zbigniew Jędrzejewski-Szmek [Thu, 11 Jul 2019 07:00:49 +0000 (09:00 +0200)]
shared/ask-password-api: backspace all chars at once

We'd call loop_write() separately for each char. Let's be nice to
serial console users, and write the full string in one go.

Coverity was complaining that we're not checking the return value
from loop_write(). Rework the code a bit and add voidify.
CID#1402323.

5 years agotest-process-util: invert reporting to make sure that we're not dividing by 0
Zbigniew Jędrzejewski-Szmek [Thu, 11 Jul 2019 06:47:41 +0000 (08:47 +0200)]
test-process-util: invert reporting to make sure that we're not dividing by 0

CID#1402334.

5 years agoudevd: add helper with error handling to synthesize "change" events
Zbigniew Jędrzejewski-Szmek [Thu, 11 Jul 2019 06:43:45 +0000 (08:43 +0200)]
udevd: add helper with error handling to synthesize "change" events

Coverity was unhappy that we ignore the return value from write_string_file().
We should at least warn. CID#1302373.

5 years agotest: minor modernization
Zbigniew Jędrzejewski-Szmek [Thu, 11 Jul 2019 05:54:04 +0000 (07:54 +0200)]
test: minor modernization

Coverity was complaining that read() does not terminate the data. But
we did that termination earlier, so covirity is wrong (CID#1402306, CID#1402340).
Let's modernize the style a bit nevertheless.

(size_t) cast is needed to avoid the warning about comparison, iff
the value is not a constant.

5 years agotree-wide: make use of errno_or_else() everywhere
Lennart Poettering [Thu, 11 Jul 2019 13:42:14 +0000 (15:42 +0200)]
tree-wide: make use of errno_or_else() everywhere

5 years agoerrno-util: add new errno_or_else() helper
Lennart Poettering [Thu, 4 Jul 2019 15:55:36 +0000 (17:55 +0200)]
errno-util: add new errno_or_else() helper

5 years agoMerge pull request #13025 from poettering/tmpfiles-fixo
Frantisek Sumsal [Thu, 11 Jul 2019 19:55:55 +0000 (19:55 +0000)]
Merge pull request #13025 from poettering/tmpfiles-fixo

unbreak the build

5 years agoMerge pull request #13017 from yuwata/network-neighbor-lladdr-13015
Lennart Poettering [Thu, 11 Jul 2019 17:23:29 +0000 (19:23 +0200)]
Merge pull request #13017 from yuwata/network-neighbor-lladdr-13015

network: rename Neighbor.MACAddress= and also support IPv4 address

5 years agotmpfiles: use path_join() where it makes sense
Lennart Poettering [Thu, 11 Jul 2019 16:42:26 +0000 (18:42 +0200)]
tmpfiles: use path_join() where it makes sense

5 years agotmpfiles: fix build
Lennart Poettering [Thu, 11 Jul 2019 16:41:14 +0000 (18:41 +0200)]
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.

5 years agotests: turn on the "object-size" UBSan check on Fuzzit
Evgeny Vereshchagin [Thu, 11 Jul 2019 13:32:05 +0000 (15:32 +0200)]
tests: turn on the "object-size" UBSan check on Fuzzit

Now that 2eb1c19881678851a7e is merged it should be safe.

5 years agoMerge pull request #12750 from keszybz/tmpfiles-c-copy
Lennart Poettering [Thu, 11 Jul 2019 16:13:19 +0000 (18:13 +0200)]
Merge pull request #12750 from keszybz/tmpfiles-c-copy

Make tmpfiles C use --root

5 years agoudevadm: ensure 'udevadm info -w' show updated result
Yu Watanabe [Thu, 27 Jun 2019 18:18:22 +0000 (03:18 +0900)]
udevadm: ensure 'udevadm info -w' show updated result

This seems not necessary, but just for safety.

5 years agoMerge pull request #12461 from Werkov/fix-job-ordering
Lennart Poettering [Thu, 11 Jul 2019 14:43:58 +0000 (16:43 +0200)]
Merge pull request #12461 from Werkov/fix-job-ordering

Refactor job ordering implementation (and fix cycle detection)

5 years agotest-network: add test for route reassignment
Yu Watanabe [Sat, 6 Jul 2019 00:34:35 +0000 (09:34 +0900)]
test-network: add test for route reassignment

5 years agonetwork: re-assign static routes when dynamic address is updated
Yu Watanabe [Sat, 6 Jul 2019 00:04:10 +0000 (09:04 +0900)]
network: re-assign static routes when dynamic address is updated

Follow-up for b5799eeb0787deacb30d5984f6ac78f88f23b97e.

Closes #7354.

5 years agonetwork: process address reply message
Yu Watanabe [Sat, 6 Jul 2019 00:03:02 +0000 (09:03 +0900)]
network: process address reply message

5 years agonetwork: rework route_scope_from_address()
Yu Watanabe [Sat, 6 Jul 2019 02:17:48 +0000 (11:17 +0900)]
network: rework route_scope_from_address()

5 years agoutil: introduce in4_addr_equal()
Yu Watanabe [Sat, 6 Jul 2019 02:14:43 +0000 (11:14 +0900)]
util: introduce in4_addr_equal()

5 years agonetwork: route_configure() do nothing when it returns 0
Yu Watanabe [Fri, 5 Jul 2019 23:47:24 +0000 (08:47 +0900)]
network: route_configure() do nothing when it returns 0

5 years agotest-network: add testcase that Neighbor.LinkLayerAddress= is IP address
Yu Watanabe [Wed, 10 Jul 2019 18:26:30 +0000 (03:26 +0900)]
test-network: add testcase that Neighbor.LinkLayerAddress= is IP address

5 years agotest-network: use Neighbor.LinkLayerAddress= instead of deprecated Neighbor.MACAddress=
Yu Watanabe [Wed, 10 Jul 2019 17:25:21 +0000 (02:25 +0900)]
test-network: use Neighbor.LinkLayerAddress= instead of deprecated Neighbor.MACAddress=

5 years agonetwork: fdb: use ether_addr_from_string()
Yu Watanabe [Thu, 11 Jul 2019 01:48:41 +0000 (10:48 +0900)]
network: fdb: use ether_addr_from_string()

5 years agonetwork: fdb: do not allocate separated memory for lladdr
Yu Watanabe [Thu, 11 Jul 2019 01:44:36 +0000 (10:44 +0900)]
network: fdb: do not allocate separated memory for lladdr

5 years agonetwork: drop invalid [Neighbor] section earlier
Yu Watanabe [Wed, 10 Jul 2019 18:08:31 +0000 (03:08 +0900)]
network: drop invalid [Neighbor] section earlier

5 years agonetwork: rename Neighbor.MACAddress= to Neighbor.LinkLayerAddress=
Yu Watanabe [Wed, 10 Jul 2019 17:23:41 +0000 (02:23 +0900)]
network: rename Neighbor.MACAddress= to Neighbor.LinkLayerAddress=

And make it support IPv4 address.

Closes #13015.

5 years agonetwork: NDA_LLADDR attribute can also take struct in_addr
Yu Watanabe [Thu, 11 Jul 2019 01:17:30 +0000 (10:17 +0900)]
network: NDA_LLADDR attribute can also take struct in_addr

5 years agosd-netlink: make sd_netlink_message_read() returns size of read data
Yu Watanabe [Thu, 11 Jul 2019 01:12:35 +0000 (10:12 +0900)]
sd-netlink: make sd_netlink_message_read() returns size of read data

5 years agoMerge pull request #12176 from poettering/clean-dir2
Lennart Poettering [Thu, 11 Jul 2019 13:12:02 +0000 (15:12 +0200)]
Merge pull request #12176 from poettering/clean-dir2

add "systemctl clean" operation for clearing out StateDirectory=, CacheDirectory=, … of a service unit

5 years agojson: always allocate at least sizeof(JsonVariant) bytes
Lennart Poettering [Thu, 11 Jul 2019 09:15:06 +0000 (11:15 +0200)]
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

5 years agoupdate TODO
Lennart Poettering [Mon, 1 Apr 2019 17:42:03 +0000 (19:42 +0200)]
update TODO

5 years agoman: document new "systemctl clean…" operation
Lennart Poettering [Mon, 1 Apr 2019 15:28:29 +0000 (17:28 +0200)]
man: document new "systemctl clean…" operation

5 years agotest: add testcase for new CleanUnit logic
Lennart Poettering [Mon, 1 Apr 2019 14:51:55 +0000 (16:51 +0200)]
test: add testcase for new CleanUnit logic

5 years agosystemctl: port "systemctl start --wait" logic to new bus-wait-for-units.c API
Lennart Poettering [Fri, 29 Mar 2019 19:23:33 +0000 (20:23 +0100)]
systemctl: port "systemctl start --wait" logic to new bus-wait-for-units.c API

5 years agosystemctl: add new "clean" operation to systemctl
Lennart Poettering [Mon, 1 Apr 2019 16:57:46 +0000 (18:57 +0200)]
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.

5 years agoshared: add generic logic for waiting for a unit to enter some state
Lennart Poettering [Mon, 1 Apr 2019 16:54:59 +0000 (18:54 +0200)]
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.

5 years agocore: expose per-service cleaning properties on the bus, too
Lennart Poettering [Mon, 1 Apr 2019 16:52:40 +0000 (18:52 +0200)]
core: expose per-service cleaning properties on the bus, too

5 years agocore: expose new clean operation on the bus
Lennart Poettering [Mon, 1 Apr 2019 16:51:49 +0000 (18:51 +0200)]
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.

5 years agocore: add type of resource string table
Lennart Poettering [Tue, 25 Jun 2019 09:31:57 +0000 (11:31 +0200)]
core: add type of resource string table

5 years agocore: hook up timer unit type with clean operation
Lennart Poettering [Mon, 1 Apr 2019 16:49:40 +0000 (18:49 +0200)]
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

5 years agocore: hook up service unit type with the new clean operation
Lennart Poettering [Mon, 1 Apr 2019 16:48:20 +0000 (18:48 +0200)]
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.