Lennart Poettering [Fri, 16 Nov 2018 17:05:46 +0000 (18:05 +0100)]
conf-parse: drop unused prototype
Lennart Poettering [Fri, 16 Nov 2018 20:04:38 +0000 (21:04 +0100)]
macro: remove double evaluation in FLAGS_SET()
Lennart Poettering [Fri, 16 Nov 2018 21:00:35 +0000 (22:00 +0100)]
rc-local-generator: add comment explaining the background of the generator
This is not obvious, hence it deserves some form of documentation.
However, it's also ultimately an implementation detail, hence let's not
add this to the man page, but as a code comment, that is visible right
at the top of source file.
Fixes: #10675
asavah [Fri, 16 Nov 2018 19:02:00 +0000 (21:02 +0200)]
fix build with -Defi=false
Lennart Poettering [Fri, 16 Nov 2018 16:55:08 +0000 (17:55 +0100)]
Merge pull request #10805 from poettering/migrate-boot-loader-interface
migrate boot loader interface doc from wiki into markdown (split out of #10495)
Lennart Poettering [Fri, 16 Nov 2018 16:54:43 +0000 (17:54 +0100)]
Merge pull request #10751 from yuwata/sd-event-util
Reuse sd_event_source object for timer event
Lennart Poettering [Fri, 16 Nov 2018 16:54:19 +0000 (17:54 +0100)]
Merge pull request #10770 from poettering/unit-done-log
improvements to structure log events from PID1
Lennart Poettering [Fri, 16 Nov 2018 16:53:50 +0000 (17:53 +0100)]
Merge pull request #10777 from poettering/seccomp-filter-others
list syscalls supported by the local kernel but not in any syscall groups explicitly in "systemd-analyze syscall-filter"
Lennart Poettering [Fri, 16 Nov 2018 16:53:26 +0000 (17:53 +0100)]
Merge pull request #10785 from poettering/cgroup-join-removal
remove JoinControllers= setting
Lennart Poettering [Fri, 16 Nov 2018 16:53:01 +0000 (17:53 +0100)]
Merge pull request #10802 from poettering/hide-only-on
man: let's deprecate PermissionsStartOnly=
Lennart Poettering [Fri, 16 Nov 2018 16:52:37 +0000 (17:52 +0100)]
Merge pull request #10804 from poettering/sd-boot-updates
various sd-boot/EFI fixes (split out from #10495)
Lennart Poettering [Fri, 16 Nov 2018 16:52:11 +0000 (17:52 +0100)]
Merge pull request #10806 from poettering/logind-many-fixes
various smaller fixes and improvements to logind (split out of #10495)
Lennart Poettering [Tue, 23 Oct 2018 14:29:28 +0000 (16:29 +0200)]
docs: tweak index.md generation and run it again
Lennart Poettering [Tue, 23 Oct 2018 14:28:30 +0000 (16:28 +0200)]
docs: migrate boot loader interface from fdo wiki to git
This imports
https://www.freedesktop.org/wiki/Software/systemd/BootLoaderInterface/
into our sources, and extends it substantially with various variables
now supported.
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 15:20:31 +0000 (16:20 +0100)]
docs/TRANSIENT-SETTINGS: drop PermissionsStartOnly= from
Lennart Poettering [Wed, 14 Nov 2018 18:59:27 +0000 (19:59 +0100)]
analyze: add some minimal ANSI highlighting of syscall-filter output
Lennart Poettering [Wed, 14 Nov 2018 18:53:49 +0000 (19:53 +0100)]
seccomp: add some missing syscalls to filter sets
Lennart Poettering [Wed, 14 Nov 2018 18:40:45 +0000 (19:40 +0100)]
analyze: show list of syscalls the kernel supports but not included in any group in the output
This is quite useful for making sure our list is complete.
Lennart Poettering [Fri, 16 Nov 2018 13:42:14 +0000 (14:42 +0100)]
cocci: simplify some if checks
Henry Tung [Tue, 23 Oct 2018 12:09:13 +0000 (14:09 +0200)]
logind: fix determination of CanHibernate() and other calls
As suggest here:
https://github.com/systemd/systemd/issues/10250#issuecomment-
426788301
Fixes: #10250
(This suggested patch has been converted into a proper commit by me,
Lennart, with attribution to the original author, @henryptung)
Lennart Poettering [Mon, 22 Oct 2018 18:00:31 +0000 (20:00 +0200)]
logind: imply right to reboot when user has right to set reboot-to-firmware flag
Let's reduce the number of actions the user has to acquire.
Lennart Poettering [Mon, 22 Oct 2018 17:59:45 +0000 (19:59 +0200)]
efivars: let's add some validation of boot menu entry name syntax
Lennart Poettering [Mon, 22 Oct 2018 17:58:26 +0000 (19:58 +0200)]
efivars: add new helper efi_set_variable_string()
Let's make it easier to parse an UTF-16 string properly.
Lennart Poettering [Mon, 22 Oct 2018 16:06:18 +0000 (18:06 +0200)]
logind: log correct error msg
Lennart Poettering [Mon, 22 Oct 2018 16:06:06 +0000 (18:06 +0200)]
logind: sort includes
Lennart Poettering [Mon, 22 Oct 2018 14:52:57 +0000 (16:52 +0200)]
bootctl: display loader features in a pretty way.
Lennart Poettering [Mon, 22 Oct 2018 14:51:29 +0000 (16:51 +0200)]
util: force time multiplications to happen in longs
Lennart Poettering [Mon, 22 Oct 2018 14:37:10 +0000 (16:37 +0200)]
locale-util: add special glyph support for check marks/cross marks
Lennart Poettering [Tue, 23 Oct 2018 11:44:23 +0000 (13:44 +0200)]
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.
Lennart Poettering [Tue, 23 Oct 2018 11:43:10 +0000 (13:43 +0200)]
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.
Lennart Poettering [Tue, 23 Oct 2018 11:42:58 +0000 (13:42 +0200)]
sd-boot: use structured initialization
Lennart Poettering [Mon, 22 Oct 2018 19:51:47 +0000 (21:51 +0200)]
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.
Lennart Poettering [Mon, 22 Oct 2018 14:51:46 +0000 (16:51 +0200)]
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.
Lennart Poettering [Mon, 22 Oct 2018 14:45:32 +0000 (16:45 +0200)]
efi: make sure parse_boolean() does something useful on a NULL parameter
Lennart Poettering [Mon, 22 Oct 2018 14:43:53 +0000 (16:43 +0200)]
efi: add 'const' to various util.h API parameters
Lennart Poettering [Mon, 22 Oct 2018 11:40:51 +0000 (13:40 +0200)]
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.
Lennart Poettering [Mon, 22 Oct 2018 11:35:06 +0000 (13:35 +0200)]
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.
Lennart Poettering [Mon, 22 Oct 2018 11:32:59 +0000 (13:32 +0200)]
efi: add simple macros for MAX values of EFI's UINTN/INTN types
Lennart Poettering [Mon, 22 Oct 2018 11:31:41 +0000 (13:31 +0200)]
sd-boot: timeout_sec is unsigned hence show it with %u
Lennart Poettering [Mon, 22 Oct 2018 11:02:50 +0000 (13:02 +0200)]
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.
Lennart Poettering [Mon, 22 Oct 2018 11:02:07 +0000 (13:02 +0200)]
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.
Lennart Poettering [Mon, 22 Oct 2018 10:47:44 +0000 (12:47 +0200)]
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.)
Lennart Poettering [Mon, 22 Oct 2018 10:41:34 +0000 (12:41 +0200)]
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.
Lennart Poettering [Fri, 16 Nov 2018 14:28:26 +0000 (15:28 +0100)]
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.
Lennart Poettering [Wed, 14 Nov 2018 10:08:16 +0000 (11:08 +0100)]
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.
Lennart Poettering [Wed, 14 Nov 2018 10:38:51 +0000 (11:38 +0100)]
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.
Lennart Poettering [Wed, 14 Nov 2018 10:01:28 +0000 (11:01 +0100)]
job: add two explanatory comments
Lennart Poettering [Wed, 14 Nov 2018 10:01:14 +0000 (11:01 +0100)]
job: let's remove one comparison and reduce indentation level by one
Lennart Poettering [Tue, 13 Nov 2018 22:28:09 +0000 (23:28 +0100)]
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
Lennart Poettering [Tue, 13 Nov 2018 21:10:38 +0000 (22:10 +0100)]
core: make log messages about unit processes exiting recognizable
Lennart Poettering [Tue, 13 Nov 2018 20:25:22 +0000 (21:25 +0100)]
core: make log messages about units entering a 'failed' state recognizable
Let's make this recognizable, and carry result information in a
structure fashion.
Lennart Poettering [Tue, 13 Nov 2018 19:40:38 +0000 (20:40 +0100)]
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.
Lennart Poettering [Tue, 13 Nov 2018 19:36:51 +0000 (20:36 +0100)]
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).
Lennart Poettering [Tue, 13 Nov 2018 19:16:45 +0000 (20:16 +0100)]
job: also include job ID in log messages when we begin with a job
Lennart Poettering [Tue, 13 Nov 2018 18:57:43 +0000 (19:57 +0100)]
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.
Lennart Poettering [Tue, 13 Nov 2018 18:40:02 +0000 (19:40 +0100)]
job: add log message when we can't enable the job run event source
Lennart Poettering [Tue, 13 Nov 2018 18:39:04 +0000 (19:39 +0100)]
job: add comment for EAGAIN job run case
Lennart Poettering [Tue, 13 Nov 2018 18:34:30 +0000 (19:34 +0100)]
job: minor coding style tweaks
Lennart Poettering [Tue, 13 Nov 2018 18:28:54 +0000 (19:28 +0100)]
job: include JOB_ID field in log message about jobs
Evgeny Vereshchagin [Fri, 16 Nov 2018 14:09:24 +0000 (17:09 +0300)]
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.
Yu Watanabe [Tue, 13 Nov 2018 05:40:02 +0000 (14:40 +0900)]
sd-ndisc: do not unref() event sources when update or disable them
Yu Watanabe [Tue, 13 Nov 2018 05:33:41 +0000 (14:33 +0900)]
sd-ndisc: use structured initializer at one more place
Yu Watanabe [Tue, 13 Nov 2018 05:32:12 +0000 (14:32 +0900)]
sd-radv: do not unref() event sources when update or disable them
Yu Watanabe [Tue, 13 Nov 2018 05:28:16 +0000 (14:28 +0900)]
sd-radv: use structured initializer at one more place
Yu Watanabe [Tue, 13 Nov 2018 05:26:33 +0000 (14:26 +0900)]
lldp: do not unref() event sources when update or disable them
Yu Watanabe [Tue, 13 Nov 2018 05:26:00 +0000 (14:26 +0900)]
lldp: use structured initializer at one more place
Yu Watanabe [Tue, 13 Nov 2018 05:18:41 +0000 (14:18 +0900)]
ipv4acd: do not unref() event sources when update or disable them
Yu Watanabe [Tue, 13 Nov 2018 05:17:20 +0000 (14:17 +0900)]
ipv4acd: use structured initializer at one more place
Yu Watanabe [Tue, 13 Nov 2018 05:05:07 +0000 (14:05 +0900)]
dhcp6-client: do not unref() event sources when update or disable them
Yu Watanabe [Tue, 13 Nov 2018 05:04:37 +0000 (14:04 +0900)]
dhcp6-client: use structured initializer at one more place
Benjamin Berg [Thu, 15 Nov 2018 22:09:43 +0000 (07:09 +0900)]
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.
Yu Watanabe [Tue, 13 Nov 2018 04:50:08 +0000 (13:50 +0900)]
dhcp-client: do not unref() event sources when update or disable them
Yu Watanabe [Tue, 13 Nov 2018 04:49:12 +0000 (13:49 +0900)]
dhcp-client: use structured initializer at one more place
Yu Watanabe [Tue, 13 Nov 2018 04:37:17 +0000 (13:37 +0900)]
udevd: use event_source_disable()
Yu Watanabe [Tue, 13 Nov 2018 04:16:41 +0000 (13:16 +0900)]
udevd: use event_reset_time() to update kill_workers_event
Yu Watanabe [Thu, 15 Nov 2018 22:02:35 +0000 (07:02 +0900)]
sd-event: also introduce event_source_is_enabled()
Yu Watanabe [Tue, 13 Nov 2018 04:34:44 +0000 (13:34 +0900)]
sd-event: introduce event_source_disable()
Yu Watanabe [Fri, 16 Nov 2018 08:32:20 +0000 (17:32 +0900)]
sd-event: introduce event_reset_time()
Yu Watanabe [Fri, 16 Nov 2018 08:30:42 +0000 (17:30 +0900)]
sd-event: split definition of event_source to event-source.h
Lennart Poettering [Thu, 15 Nov 2018 20:20:42 +0000 (21:20 +0100)]
update TODO
Lennart Poettering [Thu, 15 Nov 2018 20:16:57 +0000 (21:16 +0100)]
cgroup-util: when attaching/creating cgroups in multiple hierarchies, take jointly mounted controlelrs into account
If we create a cgroup in one controller it might already have been
created in another too, if we have jointly mounted controllers. Take
that into consideration.
Lennart Poettering [Thu, 15 Nov 2018 20:15:19 +0000 (21:15 +0100)]
cgroup: when determining which controllers we need, always extend the mask according to cpu/cpuacct joint mounting
Note that for cgroup_context_get_mask() this doesn't actually change
much, but it does prepare the ground for #10507 later on.
Lennart Poettering [Thu, 15 Nov 2018 20:14:54 +0000 (21:14 +0100)]
cgroup: add new helper that knows which controllers are mounted together
Lennart Poettering [Thu, 15 Nov 2018 20:07:43 +0000 (21:07 +0100)]
core: remove JoinControllers= configuration setting
This removes the ability to configure which cgroup controllers to mount
together. Instead, we'll now hardcode that "cpu" and "cpuacct" are
mounted together as well as "net_cls" and "net_prio".
The concept of mounting controllers together has no future as it does
not exist to cgroupsv2. Moreover, the current logic is systematically
broken, as revealed by the discussions in #10507. Also, we surveyed Red
Hat customers and couldn't find a single user of the concept (which
isn't particularly surprising, as it is broken...)
This reduced the (already way too complex) cgroup handling for us, since
we now know whenever we make a change to a cgroup for one controller to
which other controllers it applies.
Lennart Poettering [Thu, 15 Nov 2018 19:09:03 +0000 (20:09 +0100)]
core: fix capitalization of CPUShares= settings
Lennart Poettering [Thu, 15 Nov 2018 19:08:17 +0000 (20:08 +0100)]
cgtop: use FOREACH_STRING() for fun and profit
Lennart Poettering [Thu, 15 Nov 2018 19:07:45 +0000 (20:07 +0100)]
cgtop: use automatic clean-up
Lennart Poettering [Fri, 16 Nov 2018 12:00:40 +0000 (13:00 +0100)]
sd-bus: make strict asan shut up
asan doesn't like it if we use strndup() (i.e. a string function) on a
non-NULL terminated buffer (i.e. something that isn't really a string).
Let's hence use memdup_suffix0() instead of strndup(), which is more
appropriate for binary data that is to become a string.
Fixes: #10385
Lennart Poettering [Fri, 16 Nov 2018 13:30:29 +0000 (14:30 +0100)]
man: let's deprecate PermissionsStartOnly=
The concept is redundant and predates the special chars that do the same
in ExecStar=. Let's settle on advertising just the latter, and hide
PermissionsStartOnly= from the docs (even if we continue supporting it).
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:30:53 +0000 (14:30 +0100)]
Merge pull request #10795 from poettering/generator-fixes
trivial fixes to some generators
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:29:20 +0000 (14:29 +0100)]
Merge pull request #10796 from poettering/systemd-exit-service-fixes
units: corrections for systemd-exit.service
Lennart Poettering [Fri, 16 Nov 2018 11:46:30 +0000 (12:46 +0100)]
Merge pull request #10791 from keszybz/sd-event-get-enabled
Some minor tweaks for sd_event_source_get_enabled
Evgeny Vereshchagin [Fri, 16 Nov 2018 08:23:53 +0000 (09:23 +0100)]
test: initialize syslog_fd in fuzz-journald-kmsg too
This is a follow-up to
8857fb9beb9dcb that prevents the fuzzer from crashing with
```
==220==ERROR: AddressSanitizer: ABRT on unknown address 0x0000000000dc (pc 0x7ff4953c8428 bp 0x7ffcf66ec290 sp 0x7ffcf66ec128 T0)
SCARINESS: 10 (signal)
#0 0x7ff4953c8427 in gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35427)
#1 0x7ff4953ca029 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x37029)
#2 0x7ff49666503a in log_assert_failed_realm /work/build/../../src/systemd/src/basic/log.c:805:9
#3 0x7ff496614ecf in safe_close /work/build/../../src/systemd/src/basic/fd-util.c:66:17
#4 0x548806 in server_done /work/build/../../src/systemd/src/journal/journald-server.c:2064:9
#5 0x5349fa in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-journald-kmsg.c:26:9
#6 0x592755 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:571:15
#7 0x590627 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:480:3
#8 0x594432 in fuzzer::Fuzzer::MutateAndTestOne() /src/libfuzzer/FuzzerLoop.cpp:708:19
#9 0x5973c6 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:839:5
#10 0x574541 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:764:6
#11 0x5675fc in main /src/libfuzzer/FuzzerMain.cpp:20:10
#12 0x7ff4953b382f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#13 0x420f58 in _start (/out/fuzz-journald-kmsg+0x420f58)
```
Lennart Poettering [Fri, 16 Nov 2018 10:39:27 +0000 (11:39 +0100)]
units: fix Description= of systemd-exit.service
This file was probably copied from the --user version, let's use some
more appropriate wording for the --system version.
Lennart Poettering [Fri, 16 Nov 2018 10:35:59 +0000 (11:35 +0100)]
units: use correct command to exit
Otherwise we'll end a cyclic loop.
Lennart Poettering [Fri, 16 Nov 2018 10:34:47 +0000 (11:34 +0100)]
units: add the same ordering deps for systemd-exit.service as for systemd-poweroff.service and friends
This stuff runs in containers, and should really behave the same
everywhere.
Lennart Poettering [Fri, 16 Nov 2018 10:43:49 +0000 (11:43 +0100)]
core: show error code even when debug logging
Lennart Poettering [Thu, 15 Nov 2018 21:29:23 +0000 (22:29 +0100)]
hibernate-resume-generator: fix minor memory leak on error path
Lennart Poettering [Thu, 15 Nov 2018 21:28:58 +0000 (22:28 +0100)]
debug-generator: fix minor memory leak
Yu Watanabe [Fri, 16 Nov 2018 07:02:32 +0000 (16:02 +0900)]
udev-util: read resolve_names from udev.conf
Fixes CID#1396866.