Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2019 19:18:11 +0000 (20:18 +0100)]
core: write cgroup limits as permilles
We allow expressing configuration as a fraction with granularity of 0.001, but
when writing out the unit file, we'd round that up to 0.01.
Longer term, I think it'd be nicer to simply use floats and do away with
arbitrary restrictions on precision.
Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2019 17:15:46 +0000 (18:15 +0100)]
core/dbus-cgroup: use %.*s instead of strndupa()
Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2019 17:08:15 +0000 (18:08 +0100)]
core/dbus-cgroup: drop unnecessary parens
'mask' is a macro parameter, so it cannot have commas. We don't need to
parenthesize.
Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2019 12:50:28 +0000 (13:50 +0100)]
core: make TasksMax a partially dynamic property
TasksMax= and DefaultTasksMax= can be specified as percentages. We don't
actually document of what the percentage is relative to, but the implementation
uses the smallest of /proc/sys/kernel/pid_max, /proc/sys/kernel/threads-max,
and /sys/fs/cgroup/pids.max (when present). When the value is a percentage,
we immediately convert it to an absolute value. If the limit later changes
(which can happen e.g. when systemd-sysctl runs), the absolute value becomes
outdated.
So let's store either the percentage or absolute value, whatever was specified,
and only convert to an absolute value when the value is used. For example, when
starting a unit, the absolute value will be calculated when the cgroup for
the unit is created.
Fixes #13419.
Lennart Poettering [Wed, 13 Nov 2019 15:38:41 +0000 (16:38 +0100)]
Merge pull request #14010 from poettering/localtime-symlink
tweaks to /etc/localtime management
Lennart Poettering [Wed, 13 Nov 2019 15:36:39 +0000 (16:36 +0100)]
Merge pull request #13994 from keszybz/bpf-refactor
Refactor the bpf devices code and fix some bugs
Lennart Poettering [Wed, 13 Nov 2019 15:36:11 +0000 (16:36 +0100)]
Merge pull request #13868 from keszybz/run-exit-code
run: propagate return code/status from the child
Lennart Poettering [Tue, 12 Nov 2019 16:52:35 +0000 (17:52 +0100)]
tree-wide: fix how we set $TZ
According to tzset(3) we need to prefix timezone names with ":". Let's
do so hence, to avoid any ambiguities and follow documented behaviour.
Zbigniew Jędrzejewski-Szmek [Tue, 12 Nov 2019 20:10:48 +0000 (21:10 +0100)]
nspawn: do not emit any warning when $UNIFIED_CGROUP_HIERARCHY is used
Initially I thought this is a good idea, but when reviewing a different PR
(https://github.com/systemd/systemd/pull/13862#discussion_r340604313) I changed
my mind about this. At some point we probably should start warning about the
old option name, and yet later remove it. But it'll make it easier for people
to transition to the new option name if there's a period of support for both
names without any fuss. There's nothing particularly wrong about the old name,
and there is no support cost.
Fixes #13919 (by avoiding the issue completely).
Lennart Poettering [Wed, 13 Nov 2019 09:42:58 +0000 (09:42 +0000)]
update TODO
Lennart Poettering [Wed, 13 Nov 2019 09:39:09 +0000 (10:39 +0100)]
timedated: it might be that tzinfo files are just not installed
Lennart Poettering [Wed, 13 Nov 2019 09:32:44 +0000 (10:32 +0100)]
timedated: handle UTC specially, when generating /etc/localtime
Lennart Poettering [Wed, 13 Nov 2019 09:32:26 +0000 (10:32 +0100)]
time-util: treat /etc/localtime missing as UTC
Zbigniew Jędrzejewski-Szmek [Wed, 13 Nov 2019 07:56:49 +0000 (08:56 +0100)]
Merge pull request #13961 from mwilck/udev-no-exit-timeout
udevd: wait for workers to finish when exiting
Anita Zhang [Tue, 12 Nov 2019 18:59:55 +0000 (10:59 -0800)]
Merge pull request #14001 from keszybz/test-unit-name-more
Test unit name more
Zbigniew Jędrzejewski-Szmek [Tue, 12 Nov 2019 18:05:24 +0000 (19:05 +0100)]
Merge pull request #13984 from yuwata/udev-fix-13976
udev: fix issue #13976
Zbigniew Jędrzejewski-Szmek [Tue, 12 Nov 2019 18:03:50 +0000 (19:03 +0100)]
Merge pull request #13989 from keszybz/meson-warning
Adjust compiler option management to avoid warnings from meson
Martin Wilck [Tue, 12 Nov 2019 15:43:42 +0000 (16:43 +0100)]
udevd: fix crash when workers time out after exit is signal caught
If udevd receives an exit signal, it releases its reference on the udev
monitor in manager_exit(). If at this time a worker is hanging, and if
the event timeout for this worker expires before udevd exits, udevd
crashes in on_sigchld()->udev_monitor_send_device(), because the monitor
has already been freed.
Fix this by releasing the main process's monitor ref later, in
manager_free().
Lennart Poettering [Tue, 12 Nov 2019 14:30:01 +0000 (15:30 +0100)]
meson: order list of dependencies of libshared alphabetically
Let's make merging patches against this more stable.
Lennart Poettering [Tue, 12 Nov 2019 14:18:37 +0000 (15:18 +0100)]
update TODO
Franck Bui [Fri, 18 Oct 2019 10:44:51 +0000 (12:44 +0200)]
logind: fix (again) the race that might happen when logind restores VT
This patch is a new attempt to fix the race originally described in issue #9754.
The initial fix (commit
ad96887a1205bad9656d280c5681f482e6d04838) consisted in
spawning a sub process that became the controlling process of the VT and hence
kicked the old controlling process off to make sure that the VT wouldn't have
entered in HUP state while logind restored the VT.
But it introduced a regression (see issue #11269) and thus was reverted. But
unlike it was described in the revert commit message, commit
adb8688b3ff445d9c48ed0d72208c7844c2acc01 alone doen't fix the initial race.
This patch fixes the race in a simpler way by trying to restore the VT a second
time after making sure to re-open it if the first attempt fails.
Indeed if the old controlling process dies before or during the first attempt,
logind will fail to restore the VT. At this point the VT is in HUP state but
we're sure that it won't enter in a HUP state a second time. Therefore we will
retry by re-opening the VT to clear the HUP state and by restoring the VT a
second time, which should be safe this time.
Fixes: #9754
Fixes: #13241
Martin Wilck [Wed, 6 Nov 2019 11:24:41 +0000 (12:24 +0100)]
udevd: wait for workers to finish when exiting
On some systems with lots of devices, device probing for certain drivers can
take a very long time. If systemd-udevd detects a timeout and kills the worker
running modprobe using SIGKILL, some devices will not be probed, or end up in
unusable state. The --event-timeout option can be used to modify the maximum
time spent in an uevent handler. But if systemd-udevd exits, it uses a
different timeout, hard-coded to 30s, and exits when this timeout expires,
causing all workers to be KILLed by systemd afterwards. In practice, this may
lead to workers being killed after significantly less time than specified with
the event-timeout. This is particularly significant during initrd processing:
systemd-udevd will be stopped by systemd when initrd-switch-root.target is
about to be isolated, which usually happens quickly after finding and mounting
the root FS.
If systemd-udevd is started by PID 1 (i.e. basically always), systemd will
kill both udevd and the workers after expiry of TimeoutStopSec. This is
actually better than the built-in udevd timeout, because it's more transparent
and configurable for users. This way users can avoid the mentioned boot problem
by simply increasing StopTimeoutSec= in systemd-udevd.service.
If udevd is not started by systemd (standalone), this is still an
improvement. udevd will kill hanging workers when the event timeout is
reached, which is configurable via the udev.event_timeout= kernel
command line parameter. Before this patch, udevd would simply exit with
workers still running, which would then become zombie processes.
With the timeout removed, the sd_event_now() assertion in manager_exit() can be
dropped.
Zbigniew Jędrzejewski-Szmek [Tue, 12 Nov 2019 10:49:40 +0000 (11:49 +0100)]
test-unit-name: check that unexpanded specifiers not valid unit name make
Zbigniew Jędrzejewski-Szmek [Tue, 12 Nov 2019 10:47:20 +0000 (11:47 +0100)]
test-unit-name: add usual headers and add more verbose output
This makes it easier to see what unit_name_is_valid() returns at a glance.
The output is not whitespace clean, but I think it's good enough for a test.
Zbigniew Jędrzejewski-Szmek [Tue, 12 Nov 2019 09:28:59 +0000 (10:28 +0100)]
Merge pull request #13862 from zachsmith/systemd-tmpfiles-deprecate-for-force
systemd-tmpfiles: deprecate F for f+
Yu Watanabe [Sun, 10 Nov 2019 05:42:55 +0000 (14:42 +0900)]
udev: do not append newline when write attributes
Before
25de7aa7b90c23d33ea50ada1e50c5834a414237, the content is written
by `fprintf()` without new line. So WRITE_STRING_FILE_AVOID_NEWLINE flag
is necessary.
Fixes #13985.
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 11:16:41 +0000 (12:16 +0100)]
meson: apply our -Wno-* options also in c++ calls
We compile some c++ code for tests. We would simply use the default options for
those. When the previous commit raised the default warning level, we started
getting warnings from c++ code. Let's add the most important options to the c++
command, so that we get a compilation without any warnings again.
I don't think it makes sense to add *all* the options that we add for c to the
c++ flags, because testing them takes quite a while, and the c++ compilations
are for small amounts of code, mostly to check that the headers have compatible
syntax.
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 10:39:15 +0000 (11:39 +0100)]
meson: use warning_level=2 by default
Let's bump up the warning level, and not add by -Wextra by hand. This is the
approach recommended by meson. The idea is that all projects should be as
similar as possible to make it easier for users to switch between projects.
Zbigniew Jędrzejewski-Szmek [Thu, 7 Nov 2019 10:32:26 +0000 (11:32 +0100)]
meson: avoid bogus meson warning
With meson-0.52.0-1.module_f31+6771+
f5d842eb.noarch I get:
src/test/meson.build:19: WARNING: Overriding previous value of environment variable 'PATH' with a new one
When we're using *prepend*, the whole point is to modify an existing variable,
so meson shouldn't warn. But let's set avoid the warning and shorten things by
setting the final value immediately.
Yu Watanabe [Tue, 12 Nov 2019 05:58:25 +0000 (14:58 +0900)]
udev: ignore error caused by device disconnection
During an add or change event, the device may be disconnected.
Fixes #13976.
Yu Watanabe [Tue, 12 Nov 2019 05:58:19 +0000 (14:58 +0900)]
udev: fix error code in the log message
Yu Watanabe [Tue, 12 Nov 2019 05:57:48 +0000 (14:57 +0900)]
udev: ignore ENOENT when chmod_and_chown() device node
Anita Zhang [Tue, 12 Nov 2019 01:56:56 +0000 (17:56 -0800)]
Merge pull request #13997 from khfeng/hwdb-dell-vostro5581-ish
hwdb: Mark Intel Sensor Hub's accel sensor on Vostro 5581 as being in…
Anita Zhang [Tue, 12 Nov 2019 01:47:43 +0000 (17:47 -0800)]
Merge pull request #13996 from poettering/utc-fix
accept UTC timezone explicitly, even if timezone data is missing
Zbigniew Jędrzejewski-Szmek [Mon, 11 Nov 2019 20:04:25 +0000 (21:04 +0100)]
test-bpf-devices: skip test on !unified
The code in cgroup.c has support for all hierarchies, but the test,
as written, will only work on unified. Since the test is really about
bpf code, and not the legacy devices controller, let's just skip
the test.
Kai-Heng Feng [Mon, 11 Nov 2019 16:30:46 +0000 (00:30 +0800)]
hwdb: Mark Intel Sensor Hub's accel sensor on Vostro 5581 as being in the base
This laptop uses the accelerometer as a freefall sensor, so mark it as
in base to prevent screen rotation.
Lennart Poettering [Mon, 11 Nov 2019 15:56:31 +0000 (16:56 +0100)]
time-util: uniquify timezone list, in case UTC is listed in timezone1970.tab, too
Lennart Poettering [Mon, 11 Nov 2019 15:53:52 +0000 (16:53 +0100)]
time-util: always accept UTC as valid timezone
We already handle it specially in get_timezones(), hence we should OK it
here too, even if the timezone file doesn't actually exist.
Prompted by:
https://serverfault.com/questions/991172/invalid-time-zone-utc
(Yes, Ubuntu should install the UTC timezone data unconditionally: it
should not be an option, even if all other timezone data is excluded,
but since it's our business to validate user input but not out business
to validate distros, let's just accept "UTC" unconditionally, it's magic
after all)
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 22:08:21 +0000 (23:08 +0100)]
bpf: make sure the kernel do not submit an invalid program if no pattern matched
It turns out that the kernel verifier would reject a program we would build
if there was a whitelist, but no entries in the whitelist matched.
The program would approximately like this:
0: (61) r2 = *(u32 *)(r1 +0)
1: (54) w2 &= 65535
2: (61) r3 = *(u32 *)(r1 +0)
3: (74) w3 >>= 16
4: (61) r4 = *(u32 *)(r1 +4)
5: (61) r5 = *(u32 *)(r1 +8)
48: (b7) r0 = 0
49: (05) goto pc+1
50: (b7) r0 = 1
51: (95) exit
and insn 50 is unreachable, which is illegal. We would then either keep a
previous version of the program or allow everything. Make sure we build a
valid program that simply rejects everything.
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 12:19:51 +0000 (13:19 +0100)]
bpf: optimize device type access away most of the time
Most of the time, we specify the allowed access mode as "rwm", so the check
always trivially passes. In that case, skip the check.
The repeating part changes from:
5: (55) if r2 != 0x2 goto pc+6
6: (bc) w1 = w3
7: (54) w1 &= 7
8: (5d) if r1 != r3 goto pc+3
9: (55) if r4 != 0x1 goto pc+2
10: (55) if r5 != 0x3 goto pc+1
11: (05) goto pc+8
to
6: (55) if r2 != 0x2 goto pc+3
7: (55) if r4 != 0x1 goto pc+2
8: (55) if r5 != 0x3 goto pc+1
9: (05) goto pc+40
Zbigniew Jędrzejewski-Szmek [Sat, 9 Nov 2019 11:32:44 +0000 (12:32 +0100)]
bpf: convert 'c'/'b' to bpf_type at the very end
This makes the code a bit longer, but easier to read I think, because
the cgroup v1 and v2 code paths are more similar. And whent he type is
a char, any backtrace is easier to interpret.
Zbigniew Jędrzejewski-Szmek [Sat, 9 Nov 2019 10:50:25 +0000 (11:50 +0100)]
test-bpf-devices: new test for the devices bpf code
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 12:32:36 +0000 (13:32 +0100)]
bpf: fix off-by-one in class whitelisting
We would jump one insn too many, landing in the middle of the subsequent block.
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 12:13:31 +0000 (13:13 +0100)]
bpf: fix device type filter
On big endian arches, we were taking the wrong half-word, so the check
was giving bogus results.
https://bugzilla.redhat.com/show_bug.cgi?id=1769148.
Zbigniew Jędrzejewski-Szmek [Sat, 9 Nov 2019 11:34:30 +0000 (12:34 +0100)]
bpf: add trace logging
Very helpful when trying to figure out what exactly is going on.
Zbigniew Jędrzejewski-Szmek [Sat, 9 Nov 2019 10:13:02 +0000 (11:13 +0100)]
test-bpf-firewall: fix message
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 19:33:10 +0000 (20:33 +0100)]
bpf: make bpf_devices_apply_policy() independent of any unit code
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 15:57:25 +0000 (16:57 +0100)]
tests: modify enter_cgroup_subroot() to return the new path
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 15:55:28 +0000 (16:55 +0100)]
tests: get rid of test-helper.[ch] completely
I don't think there's any particular reason to keep those functions in a separate
file.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 15:40:11 +0000 (16:40 +0100)]
tests: make is_run_on_travis_ci() static
This is a pretty specific hack, so let's just define it close to the one
place where it is used.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 15:37:15 +0000 (16:37 +0100)]
tests: make manager_skip_test() not a macro and move to tests.h
There is nothing magic in it.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 15:19:43 +0000 (16:19 +0100)]
core: split out one more function
Hans de Goede [Wed, 6 Nov 2019 09:22:21 +0000 (10:22 +0100)]
hwdb: Add accel orientation quirk for Wortmann Terra Pad 1061
Add a quirk to fix the accelerometer orientation on the Wortmann
Terra Pad 1061 tablet.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 15:09:28 +0000 (16:09 +0100)]
core: also split out helper to handle static device nodes
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 14:51:28 +0000 (15:51 +0100)]
core: move bpf devices implementation to bpf-devices.[ch] and rename
The naming of the functions was a complete mess: the most specific functions
which don't know anything about cgroups had "cgroup_" prefix, while more
general functions which took a node path and a cgroup for reporting had no
prefix. Let's use "bpf_devices_" for the latter group, and "bpf_prog_*" for the
rest.
The main goal of this move is to split the implementation from the calling code
and add unit tests in a later patch.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 14:12:23 +0000 (15:12 +0100)]
core: rename CGROUP_AUTO/STRICT/CLOSED to CGROUP_DEVICE_POLICY_…
The old names were very generic, and when used without context it wasn't at all
clear that they are about the devices policy.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 13:58:28 +0000 (14:58 +0100)]
tests: move memlock helper to shared code
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 11:03:23 +0000 (12:03 +0100)]
test-bpf-firewall: do not mlock() a large amount of memory
64MB is not that much, but let's not be greedy, esp. because we may run
many things in parallel.
Also, rlim_cur should never be higher than rlim_max, so let's simplify our
code.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 10:58:55 +0000 (11:58 +0100)]
test-bpf: rename to test-bpf-firewall
Let's make the name better reflect its scope.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 10:24:17 +0000 (11:24 +0100)]
bpf: return normally from whitelist_major()
All callers do (void) anyway, so we can just use normal return here.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 10:17:08 +0000 (11:17 +0100)]
bpf: do not bother adding device patterns after whitelisting the full class
This seems to have been unintentional.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 10:13:20 +0000 (11:13 +0100)]
bpf: refactor how we create device major:minor whitelists
No functional change intended except for minor adjustments to error messages.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 07:55:54 +0000 (08:55 +0100)]
core: constify bpf program arrays
In cases where the programs were modified after being initially declared,
reorder operations so that the declaration is already in final form.
Vito Caputo [Sun, 10 Nov 2019 07:00:19 +0000 (23:00 -0800)]
journal-file: delete some unnecessary braces
Trivial change, just something I noticed skimming the code.
Yu Watanabe [Sat, 9 Nov 2019 14:27:34 +0000 (23:27 +0900)]
Merge pull request #13975 from keszybz/more-seccomp-syscalls
Add more syscalls to the seccomp lists
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 09:25:31 +0000 (10:25 +0100)]
shared/sleep-config: fix potential SEGV
We were looking at the wrong variable, and would always crash if this
comparison was reached. Fixes #13965.
Also, fix crash (_cleanup_ called on uninitialized variable) if we failed in
error path.
While at it, let's shorten some messages.
Zach Smith [Fri, 1 Nov 2019 05:10:10 +0000 (22:10 -0700)]
systemd-tmpfiles: cleanup man page program listing
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 11:56:56 +0000 (12:56 +0100)]
Add @pkey syscall group
Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1769299.
This change doesn't solve the issue, but makes it easier to whitelist the
syscall group.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 13:00:10 +0000 (14:00 +0100)]
seccomp: add all *time64 syscalls
From https://bugzilla.redhat.com/show_bug.cgi?id=1770154:
> utime is an obsolete system call. The current kernel interface is
> utimensat_time64. New 32-bit architectures do not even provide the utime
> system call.
Also add all other *time64 syscalls listed in
https://fedora.juszkiewicz.com.pl/syscalls.html.
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 13:19:40 +0000 (14:19 +0100)]
Merge pull request #13554 from keur/systemctl_status_timer
systemctl: Add timer activation to status
Michal Suchanek [Mon, 4 Nov 2019 20:23:15 +0000 (21:23 +0100)]
libblkid: open device in nonblock mode.
When autoclose is set (kernel default but many distributions reverse the
setting) opening a CD-rom device causes the tray to close.
The function of blkid is to report the current state of the device and
not to change it. Hence it should use O_NONBLOCK when opening the
device to avoid closing a CD-rom tray.
blkid is used liberally in scripts so it can potentially interfere with
the user operating the CD-rom hardware.
[kzak@redhat.com: add O_NONBLOCK also to:
- wipefs
- blkid_new_probe_from_filename()
- blkid_evaluate_tag()]
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit
39f5af25982d8b0244000e92a9d0e0e6557d0e17)
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 09:18:46 +0000 (10:18 +0100)]
Merge pull request #13962 from keszybz/man-ordering
Describe ordering in case of Conflicts=
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2019 12:42:13 +0000 (13:42 +0100)]
man: describe ordering in case of Conflicts=
Fixes #13421.
Alcaro [Thu, 7 Nov 2019 13:19:18 +0000 (14:19 +0100)]
doc: Fix missing parenthesis
Anita Zhang [Thu, 7 Nov 2019 06:25:43 +0000 (22:25 -0800)]
include missing_fcntl.h where needed
f5947a5e925117c55b390460d592f57504277bf9 dropped missing.h and
replaced with the more specific headers but did not add
missing_fcntl.h in places that use O_TMPFILE. This is needed for
some older versions of glibc.
Zbigniew Jędrzejewski-Szmek [Thu, 7 Nov 2019 07:36:26 +0000 (08:36 +0100)]
Merge pull request #13904 from keur/job_mode_triggering
Job mode triggering
Anita Zhang [Tue, 5 Nov 2019 02:29:55 +0000 (18:29 -0800)]
core: change top-level drop-in from -.service.d to service.d
Discussed in #13743, the -.service semantic conflicts with the
existing root mount and slice names, making this feature not
uniformly extensible to all types. Change the name to be
<type>.d instead.
Updating to this format also extends the top-level dropin to
unit types.
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2019 12:26:29 +0000 (13:26 +0100)]
man: put description of Wants= above Requires=
We want users to use Wants, but we'd describe Requires first and ask users to
look for Wants instead. While at it, let's split the wall of text into sensible
paragraphs: syntax first, followed by semantics and longer description, and
finally hints and comparison to other configuration items last.
Anita Zhang [Wed, 6 Nov 2019 19:44:09 +0000 (11:44 -0800)]
Merge pull request #13960 from keszybz/meson-loop-fix
meson: remove strange dep that causes meson to enter infinite loop
Dominique Martinet [Wed, 6 Nov 2019 06:32:17 +0000 (07:32 +0100)]
man: fix option typo in pam_systemd man page
The session= option does not exist, XDG_SESSION_TYPE overrides the type=
option.
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2019 11:44:39 +0000 (12:44 +0100)]
meson: remove strange dep that causes meson to enter infinite loop
The value is obviously bogus, but didn't seem to cause problems so far.
With meson-0.52.0, it causes a hang. The number of aliases is always rather
small (usually just one or two, possibly up to a dozen in a few cases), so
even if this causes some looping, it is strange that it has such a huge impact.
But let's just remove it.
Fixes #13742.
Tested with meson-0.52.0-1.module_f31+6771+
f5d842eb.noarch,
meson-0.51.1-1.fc29.noarch.
Anita Zhang [Wed, 6 Nov 2019 00:04:27 +0000 (16:04 -0800)]
man: save pull-raw example file without underscores
Destination file needs to be a valid hostname and underscores
are not valid hostname characters.
Closes #13542
Anita Zhang [Wed, 6 Nov 2019 00:20:42 +0000 (16:20 -0800)]
man: small grammatical/word choice fixes to crypttab man page
Closes #13608
Anita Zhang [Tue, 5 Nov 2019 23:03:15 +0000 (15:03 -0800)]
Merge pull request #13936 from keszybz/format-table-uninhibited
Output tables at full width if piped
Anita Zhang [Tue, 5 Nov 2019 23:02:01 +0000 (15:02 -0800)]
Merge pull request #13944 from yuwata/network-split-struct-prefix
network: split struct Prefix into Prefix and RoutePrefix
Yu Watanabe [Tue, 5 Nov 2019 14:02:31 +0000 (23:02 +0900)]
sd-device-enumerator: do not return error when a device is removed
Fixes #13814.
Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2019 21:01:46 +0000 (22:01 +0100)]
systemctl: simplify printing of Triggers/TriggeredBy
Kevin Kuehler [Mon, 4 Nov 2019 22:52:13 +0000 (14:52 -0800)]
systemctl: Align all status outputs to TriggeredBy
Kevin Kuehler [Mon, 4 Nov 2019 22:48:06 +0000 (14:48 -0800)]
systemctl: Add TriggeredBy and Triggers to status
For all units that aren't timers, if it is activated by another unit,
add the triggering unit under the "TriggeredBy:" header. If a unit can
trigger other units, print the units it triggers other the "Triggers:"
header.
Zbigniew Jędrzejewski-Szmek [Tue, 29 Oct 2019 17:07:07 +0000 (18:07 +0100)]
run: propagate return code/status from the child
Fixes #13756. We were returning things that didn't make much sense:
we would always use the exit_code value as the exit code. But it sometimes
contains a exit code from the process, and sometimes the number of a signal
that was used to kill the process. We would also ignore SuccessExitStatus=
and in general whether systemd thinks the service exited successfully
(hence the issue in #13756, where systemd would return success/SIGTERM,
but we'd just look at the SIGTERM part.)
If we are doing --wait, let's always propagate the exit code/status from
the child.
While at it, make the documentation useful.
Kevin Kuehler [Fri, 1 Nov 2019 08:47:37 +0000 (01:47 -0700)]
man: Document --job-mode=triggering switch
Kevin Kuehler [Fri, 1 Nov 2019 07:54:03 +0000 (00:54 -0700)]
core: Add triggering job mode
When used with systemctl stop, follows TRIGGERED_BY dependencies and
adds them to the same transaction.
Fixes: #3043
Zbigniew Jędrzejewski-Szmek [Mon, 4 Nov 2019 13:59:31 +0000 (14:59 +0100)]
shared/format-table: disable ellipsization when piped
Fixes #13461.
Before:
$ systemd-inhibit --no-pager
WHO UID USER PID COMM WHAT WHY MODE
ModemManager 0 root 1093 ModemManager sleep ModemManage… delay
NetworkManager 0 root 1400 NetworkManager sleep NetworkMana… delay
UPower 0 root 5141 upowerd sleep Pause devic… delay
zbyszek 1000 zbyszek 10036 gsd-power handle-lid-switch External mo… block
zbyszek 1000 zbyszek 10035 gsd-media-keys handle-power-key:handle-suspend-key:… GNOME handl… block
zbyszek 1000 zbyszek 10035 gsd-media-keys sleep GNOME handl… delay
zbyszek 1000 zbyszek 10036 gsd-power sleep GNOME needs… delay
7 inhibitors listed.
$ systemd-inhibit --no-pager|grep suspend
$ systemd-inhibit --no-pager|cat
WHO UID USER PID COMM WHAT WHY MODE
ModemManager 0 root 1093 ModemManager sleep Mode… delay
NetworkManager 0 root 1400 NetworkManager sleep Netw… delay
UPower 0 root 5141 upowerd sleep Paus… delay
zbyszek 1000 zbyszek 10036 gsd-power handle-lid-switch Exte… block
zbyszek 1000 zbyszek 10035 gsd-media-keys handle-power-key:h… GNOM… block
zbyszek 1000 zbyszek 10035 gsd-media-keys sleep GNOM… delay
zbyszek 1000 zbyszek 10036 gsd-power sleep GNOM… delay
After:
$ build/systemd-inhibit --no-pager
(same as above)
$ build/systemd-inhibit --no-pager|grep suspend
zbyszek 1000 zbyszek 10035 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
$ build/systemd-inhibit --no-pager|cat
WHO UID USER PID COMM WHAT WHY MODE
ModemManager 0 root 1093 ModemManager sleep ModemManager needs to reset devices delay
NetworkManager 0 root 1400 NetworkManager sleep NetworkManager needs to turn off networks delay
UPower 0 root 5141 upowerd sleep Pause device polling delay
zbyszek 1000 zbyszek 10036 gsd-power handle-lid-switch External monitor attached or configuration changed recently block
zbyszek 1000 zbyszek 10035 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
zbyszek 1000 zbyszek 10035 gsd-media-keys sleep GNOME handling keypresses delay
zbyszek 1000 zbyszek 10036 gsd-power sleep GNOME needs to lock the screen delay
7 inhibitors listed.
Note that this affect all tools that use format-table.c: machinectl, busctl,
loginctl, systemd-analyze, networkctl, portablectl.
Yu Watanabe [Tue, 5 Nov 2019 13:31:20 +0000 (22:31 +0900)]
network: split struct Prefix into Prefix and RoutePrefix
Yu Watanabe [Tue, 5 Nov 2019 11:16:06 +0000 (20:16 +0900)]
Merge pull request #13939 from yuwata/network-fix-memleak-and-13938
network: fix memleak and invalid free function
Lorenz Bauer [Mon, 4 Nov 2019 16:35:46 +0000 (16:35 +0000)]
journal: refresh cached credentials of stdout streams
journald assumes that getsockopt(SO_PEERCRED) correctly identifies the
process on the remote end of the socket. However, this is incorrect
according to man 7 socket:
The returned credentials are those that were in effect at the
time of the call to connect(2) or socketpair(2).
This becomes a problem when a new process inherits the stdout stream
from a parent. First, log messages from the child process will
be attributed to the parent. Second, the struct ucred used by journald
becomes invalid as soon as the parent exits. Further sendmsg calls then
fail with ENOENT. Logs for the child process then vanish from the journal.
Fix this by using recvmsg on the stdout stream, and refreshing the cached
struct ucred if SCM_CREDENTIALS indicate a new process.
Fixes #13708
Sebastian Wick [Thu, 31 Oct 2019 13:27:24 +0000 (14:27 +0100)]
hwdb: add XKB_FIXED_MODEL to the keyboard hwdb
Chromebook keyboards have a top row which generates f1-f10 key codes but
the keys have media symbols printed on them. A simple scan code to key
code mapping to the correct media keys makes the f1-f10 inaccessible. To
properly use the keyboard a custom key code to symbol mapping in xbk is
required (a variant of the chromebook xkb model is already upstream).
Other devices have similar problems.
This commit makes it possible to specify which xkb model should be used
for a specific device by setting XKB_FIXED_MODEL.
Anita Zhang [Tue, 5 Nov 2019 06:57:12 +0000 (22:57 -0800)]
Merge pull request #13935 from poettering/bootctl-random-seed-mkdir
bootctl: create leading dirs when "bootctl random-seed" is called if …
Yu Watanabe [Tue, 5 Nov 2019 04:30:00 +0000 (13:30 +0900)]
sd-radv: fix memleak
Yu Watanabe [Tue, 5 Nov 2019 01:49:07 +0000 (10:49 +0900)]
test: add testcase for issue #13938