Commit Graph

37130 Commits

Author SHA1 Message Date
Lennart Poettering db3cea2219 update TODO 2018-12-01 12:53:26 +01:00
Lennart Poettering 109b0cbf24 systemctl: rework --wait logic
Let's not honour PropertiesChanged signals unless the Jobs properties is
empy. After all we shouldn't consider a service finished unless its
state is inactive/failed *and* no job is queued for it anymore.
2018-12-01 12:53:26 +01:00
Lennart Poettering 3c4832ada4 core: enqueue unit earlier when state changes
Previously, we'd enqueue a unit to the dbus queue whenever the state
changed, after we processed the state change fully. This commit to the
beginning of the state change. This has the benefit that when the state
change causes a job to complete the unit is already in the dbus queue,
and thus we get the guarantee that any unit change can be sent out to
clients before the job change.
2018-12-01 12:53:26 +01:00
Lennart Poettering e6d05912cb core: when we install a job, announce this via the bus
Whenever we enqueue a job, we should announce this on the bus, hence add
both the job and the unit to the dbus queues. (Why both? The former
should be obvious, the latter because we send out Job properties).

In most cases adding these to the queue is not necessary, as
other properties tend to change at the same time and result in a change
being sent out. However, let's clean this up and make it explicit.
2018-12-01 12:53:26 +01:00
Lennart Poettering 641e0d7a1b core: clarify that the CollectMode bus property is constant
it's configured from unit files only, and hence is constant.
2018-12-01 12:53:26 +01:00
Lennart Poettering af92c603bb core: send out unit change events when a new invocation ID is acquired
It's free, as this generally coincides with unit_start(), but let's make
this clean and explicit.
2018-12-01 12:53:26 +01:00
Lennart Poettering e18f8852f3 core: invalidate invidual Assert/Condition properties when sending out change messages
Let's inform the clients about assert/condition property changes as they
happen, it's basically for free because assert/condition property
changes generally coincide with other unit state changes (after all
these checks are done on unit_start())
2018-12-01 12:53:26 +01:00
Lennart Poettering 13142276c1 core: before returning new job path to clients, force out JobNew signals
When a client requests a new job, let's make sure we for out the JobNew
signals for it, before we return successfully from the method call.
After all we shouldn't return a path that is not announced yet, as
announcement of jobs should be considered part of the job setup.
2018-12-01 12:53:26 +01:00
Lennart Poettering 17407bc28d core: before sending out a job new/change/removal message, send out unit change message for job's unit
We always want the state of the unit to be reflected first to the
client before we claim the job has changed state, after all the job is
the request to change unit state, and thus job changes are kinda the
confirmation that the state changed as requested.
2018-12-01 12:53:26 +01:00
Lennart Poettering 6fcbec6f9b core: whenever we change state of a unit, force out PropertiesChanged bus signal
This allows clients to follow our internal state changes safely.

Previously, quick state changes (for example, when we restart a unit due
to Restart= after it quickly transitioned through DEAD/FAILED states)
would be coalesced into one bus signal event, with this change there's
the guarantee that all state changes after the unit was announced ones
are reflected on th bus.

Note we only do this kind of guaranteed flushing only for unit state
changes, not for other unit property changes, where clients still have
to expect coalescing. This is because the unit state is a very
important, high-level concept.

Fixes: #10185
2018-12-01 12:53:26 +01:00
Lennart Poettering 37d0b962ef core: when we manage to resolve a user, only enqueue dbus event, don't send out message right-away
Let's only enqueue the dbus signal generation, let's not do it
right-away, after all we want coalescing to take effect here.
2018-12-01 12:53:26 +01:00
Aleksei Timofeyev 09e5c07fbd resolved: add missed io-util.h header to resolved-dnstls-openssl.c
Regression after commit 5cfa2c3dc0
2018-12-01 12:49:01 +01:00
Evgeny Vereshchagin f5e75e08b0 travis: use latest instead of rawhide 2018-12-01 06:45:45 +03:00
Lennart Poettering 2c8f15aeca
Merge pull request #11006 from poettering/conf-file-fix
minor fixes for conf-files.c
2018-12-01 00:47:22 +01:00
Lennart Poettering ac20048fc0
Merge pull request #11002 from keszybz/path_join-merging
Path join merging
2018-12-01 00:44:58 +01:00
Lennart Poettering f8ee4eaa48
Merge pull request #11004 from keszybz/remove-fixme-comment
socket-util: drop obsolete FIXME comment and add test
2018-12-01 00:01:11 +01:00
Zbigniew Jędrzejewski-Szmek 652ef29887 path-util: allow NULLs in arguments to path_join()
This removes the need to remember to put strempty() in places, thus reducing
the likelihood of a stupid mistake.
2018-11-30 22:21:17 +01:00
Lennart Poettering 59ea6e57a5 networkd: refuse IPv6 RADV prefixes that lack Prefix= setting
Fixes: #9589
2018-11-30 22:19:28 +01:00
Zbigniew Jędrzejewski-Szmek 15dca3711d basic/socket-util: use c-escaping to print unprintable socket paths
We are pretty careful to reject abstract sockets that are too long to fit in
the address structure as a NUL-terminated string. And since we parse sockets as
strings, it is not possible to embed a NUL in the the address either.  But we
might receive an external socket (abstract or not), and we want to be able to
print its address in all cases. We would call socket_address_verify() and
refuse to print various sockets that the kernel considers legit.

Let's do the strict verification only in case of socket addresses we parse and
open ourselves, and do less strict verification when printing addresses of
existing sockets, and use c-escaping to print embedded NULs and such.

More tests are added.

This should make LGTM happier because on FIXME comment is removed.
2018-11-30 21:58:47 +01:00
Zbigniew Jędrzejewski-Szmek 3a48499153 shared/socket-util: do not print empty CID
That's just ugly.
2018-11-30 21:40:04 +01:00
Zbigniew Jędrzejewski-Szmek 39e73acb9b test-socket-util: add test for socket_address_print 2018-11-30 21:40:02 +01:00
Zbigniew Jędrzejewski-Szmek 041103a688 test-socket-util: the usual modernization 2018-11-30 21:37:44 +01:00
Lennart Poettering b806f0b0aa
Merge pull request #10701 from poettering/analyze-security
systemd-analyze: add a new "security" verb for analyzing unit sandboxing options
2018-11-30 19:41:59 +01:00
Lennart Poettering 380b82d678 conf-files: remove unused function 2018-11-30 16:56:35 +01:00
Lennart Poettering a7181c671a conf-files: remove misplaced log_oom()
The caller should log in this case (and all callers in fact already do),
hence let's remove the duplicate logging here.
2018-11-30 16:55:57 +01:00
Lennart Poettering 243dd6ae1d conf-files: improve algorithm O(n²) → O(n) 2018-11-30 16:55:33 +01:00
Lennart Poettering d96c081aa5 update TODO 2018-11-30 16:48:09 +01:00
Lennart Poettering ee93c1e664 man: document systemd-analyze security 2018-11-30 16:48:09 +01:00
Lennart Poettering ec16f3b6dd analyze: add new security verb 2018-11-30 16:48:09 +01:00
Lennart Poettering 88db94fa57 format-table: make sure we never call memcmp() with NULL parameters 2018-11-30 16:46:10 +01:00
Lennart Poettering 62d99b3970 format-table: add calls to query the data in a specific cell 2018-11-30 16:46:10 +01:00
Lennart Poettering 30d98de00c format-table: always underline header line 2018-11-30 16:46:10 +01:00
Lennart Poettering 9314ead785 format-table: add an API for getting the cell at a specific row/column 2018-11-30 16:46:10 +01:00
Lennart Poettering 27e730e6d0 format-table: add table_update() to update existing entries 2018-11-30 16:46:10 +01:00
Lennart Poettering a2c73e2d38 format-table: optionally allow reversing the sort order for a column 2018-11-30 16:46:10 +01:00
Lennart Poettering a4661181fa format-table: add option to store/format percent and uint64_t values in cells 2018-11-30 16:46:10 +01:00
Lennart Poettering a22318e554 format-table: before outputting a color, check if colors are available
This is in many cases redundant, as a similar check is done by various
callers already, but in other cases (where we read the color from a
static table for example), it's nice to let the color check be done by
the table code itself, and since it doesn't hurt in the other cases just
do it again.
2018-11-30 16:46:10 +01:00
Lennart Poettering 165ca5663e format-table: optionally make specific cells clickable links 2018-11-30 16:46:10 +01:00
Lennart Poettering 13b0d4d7bd format-table: when duplicating a cell, also copy the color 2018-11-30 16:46:10 +01:00
Lennart Poettering 62d6a1cc9f terminal-util: split out file:// generation from terminal_urlify_path()
This way we can use it at other places, for example when preparing URLs
for format_table_set_url()
2018-11-30 16:46:10 +01:00
Lennart Poettering 8a453c9dfc macro: update DIV_ROUND_UP() so that it can be called nested 2018-11-30 16:46:10 +01:00
Lennart Poettering b06f0cc625 parse-util: allow parse_boolean() to take a NULL argument
It's pretty useful to allow parse_boolean() to take a NULL argument and
return an error in that case, rather than abort. i.e. making this a
runtime rather than programming error allows us to shorten code
elsewhere.
2018-11-30 16:46:09 +01:00
Lennart Poettering 2987225ce6 analyze: use strv_skip() where appropriate 2018-11-30 16:46:09 +01:00
Lennart Poettering 0ed3da7c8c analyze: remove unnecessary negation of bus_error_message() error number parameter 2018-11-30 16:46:09 +01:00
Lennart Poettering 90bea7448d analyze: fix include order 2018-11-30 16:46:09 +01:00
Lennart Poettering ad5ffe3716 seccomp-util: drop process_vm_readv from @debug group
it's already part of @ipc, no need to have it in both. Given that @ipc
is much more popular (as it is part of @system-service for example),
let's not define it a second time.
2018-11-30 16:46:09 +01:00
Lennart Poettering 5f1b0cc6d0 locale-util: add logic to output smiley emojis at various happiness levels 2018-11-30 16:19:29 +01:00
Zbigniew Jędrzejewski-Szmek 62a85ee0a9 tree-wide: rename path_join_many() to path_join()
$ git grep -e path_join_many -l|xargs sed -r -i 's/path_join_many/path_join/g'

The two test functions are merged into one.
2018-11-30 10:59:47 +01:00
Zbigniew Jędrzejewski-Szmek 30016f21b3 tree-wide: replace path_join with path_join_many 2018-11-30 10:40:38 +01:00
Zbigniew Jędrzejewski-Szmek b2ac2b01c8
Merge pull request #10996 from poettering/oci-prep
Preparation for the nspawn-OCI work
2018-11-30 10:09:00 +01:00