1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00
Commit Graph

36661 Commits

Author SHA1 Message Date
Lennart Poettering
c57ed5735f logind: log correct error msg 2018-11-16 15:52:22 +01:00
Lennart Poettering
75100aeb9f logind: sort includes 2018-11-16 15:52:22 +01:00
Lennart Poettering
80641a81b6 bootctl: display loader features in a pretty way. 2018-11-16 15:52:22 +01:00
Lennart Poettering
c027b67f53 util: force time multiplications to happen in longs 2018-11-16 15:52:22 +01:00
Lennart Poettering
52ecf1958d locale-util: add special glyph support for check marks/cross marks 2018-11-16 15:52:22 +01:00
Lennart Poettering
3b42f34910 efi: NUL terminate strings read with efivar_get()
let's be more careful and NUL terminate everything we read from EFI
variables, in case it isn't already.
2018-11-16 15:47:18 +01:00
Lennart Poettering
996daf2fa9 sd-boot: make sure special menu items also work if menu is skipped
While it doesn't really make much sense to set "auto-reboot-to-firmware"
as oneshot boot item, let's still support it properly, by also
dispatching such a menu item if selected.
2018-11-16 15:47:18 +01:00
Lennart Poettering
aec1443aec sd-boot: use structured initialization 2018-11-16 15:47:18 +01:00
Lennart Poettering
b58c7351c0 sd-boot: change name of automatic entry for rebooting into firmware
Let's stick to one nomenclature. In userspace we usually call this
"reboot to firmware setup", hence use the same name in sd-boot too.

This name was previously only relevant internally, but since the
addition of the LoaderEntries EFI var is exposed to userspace, hence
let's get this right with the first release adding this.
2018-11-16 15:47:18 +01:00
Lennart Poettering
5dd5f7cfa8 sd-boot: add new EFI variable exposing feature set of boot loader
We keep adding new features, let's advertise to the host OS what these
are in a new variable LoaderFeatures.

It works a bit like OsIndicationsSupported, but is about Loader
features.
2018-11-16 15:47:18 +01:00
Lennart Poettering
95a18e91db efi: make sure parse_boolean() does something useful on a NULL parameter 2018-11-16 15:47:18 +01:00
Lennart Poettering
427ee7ec82 efi: add 'const' to various util.h API parameters 2018-11-16 15:47:18 +01:00
Lennart Poettering
fe2579dd9c sd-boot: introduce a one-time override for the boot menu timeout
This is useful to allow userspace to request a "boot into boot menu"
feature.
2018-11-16 15:47:18 +01:00
Lennart Poettering
2366d92345 sd-boot: when converting menu timeout for UINTN to INTN saturate
Let's be a bit more careful and handle overly long timeouts in a
slightly more sensible way.
2018-11-16 15:47:18 +01:00
Lennart Poettering
b49dd00f8c efi: add simple macros for MAX values of EFI's UINTN/INTN types 2018-11-16 15:47:18 +01:00
Lennart Poettering
8ac694710f sd-boot: timeout_sec is unsigned hence show it with %u 2018-11-16 15:47:18 +01:00
Lennart Poettering
4e96eb682c logind: also expose bool prop on bus that declares whether we are on external power
The three core variables that affect idleness handling are whether we
are docked, whether we are on AC power and whether the lid is closed,
hence let's also expose the third variable on the bus, to make things
nicely debuggable.
2018-11-16 15:39:31 +01:00
Lennart Poettering
e455380b18 logind: make sure that if we can't figure out whether we are on AC we presume we are
It's safer to assume that we are on AC than to assume we are on battery,
if we can't figure it out.
2018-11-16 15:39:31 +01:00
Lennart Poettering
c30e0d7b6a logind: don't claim that RebootToFirmwareSetup was constant
It's not, after all, that's what SetRebootToFirmware() is about.

(I was wondering for a moment whether to make this EMITS_CHANGES, but
decided against it, given that the flag actually can be changed
externally to logind too, and we couldn't send out notifications for
that.)
2018-11-16 15:39:31 +01:00
Lennart Poettering
9b9c23daf4 logind: expose a boolean on the bus explaining whether logind thinks the lid is closed
This copies how we already expose a "Docked" boolean the reflects
whether we are in a docking station or not.
2018-11-16 15:39:31 +01:00
Lennart Poettering
ff30a86bd4 job: simplify status message extraction
As @keszybz points out these fields are always here, there's no point in
checking if they are NULL or not.
2018-11-16 15:30:36 +01:00
Lennart Poettering
9a80f2f453 job: when a job was skipped due to a failed condition, log about it
Previously we'd neither show console status output nor log output. Let's
fix that, and still log something.
2018-11-16 15:30:36 +01:00
Lennart Poettering
6e64994d69 core: make unit_start() return a distinguishable error code in case conditions didn't hold
Ideally we'd even propagate this all the way to the client, by having a
separate JobType enum value for this. But it's hard to add this without
breaking compat, hence for now let's at least internally propagate this
case differently from the case "already on it".

This is then used to call job_finish_and_invalidate() slightly
differently, with the already= parameter false, as in the failed
condition case no message was likely produced so far.
2018-11-16 15:22:48 +01:00
Lennart Poettering
0e2b4a822e job: add two explanatory comments 2018-11-16 15:22:48 +01:00
Lennart Poettering
a69b3872ac job: let's remove one comparison and reduce indentation level by one 2018-11-16 15:22:48 +01:00
Lennart Poettering
523ee2d414 core: log a recognizable message when a unit succeeds, too
We already are doing it on failure, let's do it on success, too.

Fixes: #10265
2018-11-16 15:22:48 +01:00
Lennart Poettering
91bbd9b796 core: make log messages about unit processes exiting recognizable 2018-11-16 15:22:48 +01:00
Lennart Poettering
7c047d7443 core: make log messages about units entering a 'failed' state recognizable
Let's make this recognizable, and carry result information in a
structure fashion.
2018-11-16 15:22:48 +01:00
Lennart Poettering
295f31b0b7 sd-messages: add comment and reorder a bit
The message SD_MESSAGE_UNIT_FAILED is closely related to
SD_MESSAGE_UNIT_STARTED as it is generated when a start job failed
instead of completed successfully, Hence they should be placed together.

Otherwise one might get the impression that the message was about
failing units, which it really is not.
2018-11-16 15:22:48 +01:00
Lennart Poettering
0b999d34b1 catalog: update job begin/done messages
These texts have been slightly misleading previously, as they talked
about units, not jobs, but are actually generated for jobs, not units.
This difference matters as units can change state without a job
requesting that.

Also, the message be02cf6855d2428ba40df7e9d022f03d was particularly
wrong, as it claimed the unit failed, while it actually is the start job
that failed, which is a major difference, as jobs can fail without the
unit actually being placed in a failed state. Let's move this message a
bit up, closed to 39f53479d3a045ac8e11786248231fbf (i.e. the message
seen when a start job finished successfully).
2018-11-16 15:22:48 +01:00
Lennart Poettering
b344b363ce job: also include job ID in log messages when we begin with a job 2018-11-16 15:22:48 +01:00
Lennart Poettering
33a3fdd978 core: move unit_status_emit_starting_stopping_reloading() and related calls to job.c
This call is only used by job.c and very specific to job handling.
Moreover the very similar logic of job_emit_status_message() is already
in job.c.

Hence, let's clean this up, and move both sets of functions to job.c,
and rename them a bit so that they express precisely what they do:

1. unit_status_emit_starting_stopping_reloading() →
   job_emit_begin_status_message()
2. job_emit_status_message() → job_emit_done_status_message()

The first call is after all what we call when we begin with the
execution of a job, and the second call what we call when we are done
wiht it.

Just some moving and renaming, not other changes, and hence no change in
behaviour.
2018-11-16 15:22:48 +01:00
Lennart Poettering
f8c34706f5 job: add log message when we can't enable the job run event source 2018-11-16 15:22:48 +01:00
Lennart Poettering
8ebd9175db job: add comment for EAGAIN job run case 2018-11-16 15:22:48 +01:00
Lennart Poettering
ea2c0e4526 job: minor coding style tweaks 2018-11-16 15:22:48 +01:00
Lennart Poettering
1cd81629e1 job: include JOB_ID field in log message about jobs 2018-11-16 15:22:48 +01:00
Evgeny Vereshchagin
a7891d203c tests: run fuzzers four times in a row (#10794)
This should help to catch issues that are easily detectable by
bad_build_check like the one being fixed in https://github.com/systemd/systemd/pull/10793,
which would totally break the build tomorrow if I hadn't run
`helper.py check_build` manually.
2018-11-16 23:09:24 +09:00
Yu Watanabe
ff4b032106 sd-ndisc: do not unref() event sources when update or disable them 2018-11-16 22:57:42 +09:00
Yu Watanabe
144faa8ea5 sd-ndisc: use structured initializer at one more place 2018-11-16 22:57:42 +09:00
Yu Watanabe
807a8edeb1 sd-radv: do not unref() event sources when update or disable them 2018-11-16 22:57:42 +09:00
Yu Watanabe
78f9d24f7b sd-radv: use structured initializer at one more place 2018-11-16 22:57:42 +09:00
Yu Watanabe
6ec11d46dc lldp: do not unref() event sources when update or disable them 2018-11-16 22:57:42 +09:00
Yu Watanabe
8158b90d59 lldp: use structured initializer at one more place 2018-11-16 22:57:42 +09:00
Yu Watanabe
32ab66c5ee ipv4acd: do not unref() event sources when update or disable them 2018-11-16 22:57:42 +09:00
Yu Watanabe
4ca5acb35f ipv4acd: use structured initializer at one more place 2018-11-16 22:57:42 +09:00
Yu Watanabe
c9393e8c41 dhcp6-client: do not unref() event sources when update or disable them 2018-11-16 22:57:42 +09:00
Yu Watanabe
8b8ecac85b dhcp6-client: use structured initializer at one more place 2018-11-16 22:57:42 +09:00
Benjamin Berg
a5f07d2a16 sd-dhcp6: fix crash by unrefing event sources before re-adding them
In certain cases the timeouts may not have been unref'ed before they
need to be re-added. Add the appropriate unref calls to ensure we don't
register the timeout multiple times.

This fixes possible cases where timeouts are triggered multiple times
and even on destroyed DHCPv6 clients.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/73

Fixes #10749.
2018-11-16 22:57:42 +09:00
Yu Watanabe
a3fa4287f5 dhcp-client: do not unref() event sources when update or disable them 2018-11-16 22:57:42 +09:00
Yu Watanabe
be6bf4a786 dhcp-client: use structured initializer at one more place 2018-11-16 22:57:42 +09:00