]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoMerge pull request #14017 from poettering/analyze-calendar-tweaks
Lennart Poettering [Wed, 13 Nov 2019 19:20:10 +0000 (20:20 +0100)] 
Merge pull request #14017 from poettering/analyze-calendar-tweaks

Add --base-time= for systemd-analyze calendar

4 years agoMerge pull request #14010 from poettering/localtime-symlink
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

4 years agoMerge pull request #13994 from keszybz/bpf-refactor
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

4 years agoMerge pull request #13868 from keszybz/run-exit-code
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

4 years agoanalyze: drop spurious newline 14017/head
Lennart Poettering [Wed, 13 Nov 2019 11:56:08 +0000 (12:56 +0100)] 
analyze: drop spurious newline

4 years agoupdate TODO
Lennart Poettering [Wed, 13 Nov 2019 11:55:59 +0000 (12:55 +0100)] 
update TODO

4 years agoman: document --base-time= for systemd-analyze
Lennart Poettering [Wed, 13 Nov 2019 11:55:52 +0000 (12:55 +0100)] 
man: document --base-time= for systemd-analyze

4 years agoanalyze: add --base-time= to specify base time for 'calendar' verb
Lennart Poettering [Wed, 13 Nov 2019 11:55:39 +0000 (12:55 +0100)] 
analyze: add --base-time= to specify base time for 'calendar' verb

4 years agotree-wide: fix how we set $TZ
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.

4 years agonspawn: do not emit any warning when $UNIFIED_CGROUP_HIERARCHY is used
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).

4 years agoupdate TODO 14010/head
Lennart Poettering [Wed, 13 Nov 2019 09:42:58 +0000 (09:42 +0000)] 
update TODO

4 years agotimedated: it might be that tzinfo files are just not installed
Lennart Poettering [Wed, 13 Nov 2019 09:39:09 +0000 (10:39 +0100)] 
timedated: it might be that tzinfo files are just not installed

4 years agotimedated: handle UTC specially, when generating /etc/localtime
Lennart Poettering [Wed, 13 Nov 2019 09:32:44 +0000 (10:32 +0100)] 
timedated: handle UTC specially, when generating /etc/localtime

4 years agotime-util: treat /etc/localtime missing as UTC
Lennart Poettering [Wed, 13 Nov 2019 09:32:26 +0000 (10:32 +0100)] 
time-util: treat /etc/localtime missing as UTC

4 years agoMerge pull request #13961 from mwilck/udev-no-exit-timeout
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

4 years agoMerge pull request #14001 from keszybz/test-unit-name-more
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

4 years agoMerge pull request #13984 from yuwata/udev-fix-13976
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

4 years agoMerge pull request #13989 from keszybz/meson-warning
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

4 years agoudevd: fix crash when workers time out after exit is signal caught 13961/head
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().

4 years agomeson: order list of dependencies of libshared alphabetically
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.

4 years agoupdate TODO
Lennart Poettering [Tue, 12 Nov 2019 14:18:37 +0000 (15:18 +0100)] 
update TODO

4 years agologind: fix (again) the race that might happen when logind restores VT
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
4 years agoudevd: wait for workers to finish when exiting
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.

4 years agotest-unit-name: check that unexpanded specifiers not valid unit name make 14001/head
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

4 years agotest-unit-name: add usual headers and add more verbose output
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.

4 years agoMerge pull request #13862 from zachsmith/systemd-tmpfiles-deprecate-for-force
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+

4 years agoudev: do not append newline when write attributes
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.

4 years agomeson: apply our -Wno-* options also in c++ calls 13989/head
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.

4 years agomeson: use warning_level=2 by default
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.

4 years agomeson: avoid bogus meson warning
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.

4 years agoudev: ignore error caused by device disconnection 13984/head
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.

4 years agoudev: fix error code in the log message
Yu Watanabe [Tue, 12 Nov 2019 05:58:19 +0000 (14:58 +0900)] 
udev: fix error code in the log message

4 years agoudev: ignore ENOENT when chmod_and_chown() device node
Yu Watanabe [Tue, 12 Nov 2019 05:57:48 +0000 (14:57 +0900)] 
udev: ignore ENOENT when chmod_and_chown() device node

4 years agoMerge pull request #13997 from khfeng/hwdb-dell-vostro5581-ish
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…

4 years agoMerge pull request #13996 from poettering/utc-fix
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

4 years agotest-bpf-devices: skip test on !unified 13994/head
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.

4 years agohwdb: Mark Intel Sensor Hub's accel sensor on Vostro 5581 as being in the base 13997/head
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.

4 years agotime-util: uniquify timezone list, in case UTC is listed in timezone1970.tab, too 13996/head
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

4 years agotime-util: always accept UTC as valid timezone
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)

4 years agobpf: make sure the kernel do not submit an invalid program if no pattern matched
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.

4 years agobpf: optimize device type access away most of the time
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

4 years agobpf: convert 'c'/'b' to bpf_type at the very end
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.

4 years agotest-bpf-devices: new test for the devices bpf code
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

4 years agobpf: fix off-by-one in class whitelisting
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.

4 years agobpf: fix device type filter
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.

4 years agobpf: add trace logging
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.

4 years agotest-bpf-firewall: fix message
Zbigniew Jędrzejewski-Szmek [Sat, 9 Nov 2019 10:13:02 +0000 (11:13 +0100)] 
test-bpf-firewall: fix message

4 years agobpf: make bpf_devices_apply_policy() independent of any unit code
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

4 years agotests: modify enter_cgroup_subroot() to return the new path
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

4 years agotests: get rid of test-helper.[ch] completely
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.

4 years agotests: make is_run_on_travis_ci() static
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.

4 years agotests: make manager_skip_test() not a macro and move to tests.h
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.

4 years agocore: split out one more function
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 15:19:43 +0000 (16:19 +0100)] 
core: split out one more function

4 years agohwdb: Add accel orientation quirk for Wortmann Terra Pad 1061
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.

4 years agocore: also split out helper to handle static device nodes
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

4 years agocore: move bpf devices implementation to bpf-devices.[ch] and rename
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.

4 years agocore: rename CGROUP_AUTO/STRICT/CLOSED to CGROUP_DEVICE_POLICY_…
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.

4 years agotests: move memlock helper to shared code
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 13:58:28 +0000 (14:58 +0100)] 
tests: move memlock helper to shared code

4 years agotest-bpf-firewall: do not mlock() a large amount of memory
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.

4 years agotest-bpf: rename to test-bpf-firewall
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.

4 years agobpf: return normally from whitelist_major()
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.

4 years agobpf: do not bother adding device patterns after whitelisting the full class
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.

4 years agobpf: refactor how we create device major:minor whitelists
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.

4 years agocore: constify bpf program arrays
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.

4 years agojournal-file: delete some unnecessary braces
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.

4 years agoMerge pull request #13975 from keszybz/more-seccomp-syscalls
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

4 years agoshared/sleep-config: fix potential SEGV
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.

4 years agosystemd-tmpfiles: cleanup man page program listing 13862/head
Zach Smith [Fri, 1 Nov 2019 05:10:10 +0000 (22:10 -0700)] 
systemd-tmpfiles: cleanup man page program listing

4 years agoAdd @pkey syscall group 13975/head
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.

4 years agoseccomp: add all *time64 syscalls
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.

4 years agoMerge pull request #13554 from keur/systemctl_status_timer
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

4 years agolibblkid: open device in nonblock mode.
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)

4 years agoMerge pull request #13962 from keszybz/man-ordering
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=

4 years agoman: describe ordering in case of Conflicts= 13962/head
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2019 12:42:13 +0000 (13:42 +0100)] 
man: describe ordering in case of Conflicts=

Fixes #13421.

4 years agodoc: Fix missing parenthesis
Alcaro [Thu, 7 Nov 2019 13:19:18 +0000 (14:19 +0100)] 
doc: Fix missing parenthesis

4 years agoinclude missing_fcntl.h where needed
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.

4 years agoMerge pull request #13904 from keur/job_mode_triggering
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

4 years agocore: change top-level drop-in from -.service.d to service.d
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.

4 years agoman: put description of Wants= above Requires=
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.

4 years agoMerge pull request #13960 from keszybz/meson-loop-fix
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

4 years agoman: fix option typo in pam_systemd man page
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.

4 years agomeson: remove strange dep that causes meson to enter infinite loop 13960/head
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.

4 years agoman: save pull-raw example file without underscores
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

4 years agoman: small grammatical/word choice fixes to crypttab man page
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

4 years agoMerge pull request #13936 from keszybz/format-table-uninhibited
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

4 years agoMerge pull request #13944 from yuwata/network-split-struct-prefix
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

4 years agosd-device-enumerator: do not return error when a device is removed
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.

4 years agosystemctl: simplify printing of Triggers/TriggeredBy 13554/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2019 21:01:46 +0000 (22:01 +0100)] 
systemctl: simplify printing of Triggers/TriggeredBy

4 years agosystemctl: Align all status outputs to TriggeredBy
Kevin Kuehler [Mon, 4 Nov 2019 22:52:13 +0000 (14:52 -0800)] 
systemctl: Align all status outputs to TriggeredBy

4 years agosystemctl: Add TriggeredBy and Triggers to status
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.

4 years agorun: propagate return code/status from the child 13868/head
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.

4 years agoman: Document --job-mode=triggering switch 13904/head
Kevin Kuehler [Fri, 1 Nov 2019 08:47:37 +0000 (01:47 -0700)] 
man: Document --job-mode=triggering switch

4 years agocore: Add triggering job mode
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
4 years agoshared/format-table: disable ellipsization when piped 13936/head
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.

4 years agonetwork: split struct Prefix into Prefix and RoutePrefix 13944/head
Yu Watanabe [Tue, 5 Nov 2019 13:31:20 +0000 (22:31 +0900)] 
network: split struct Prefix into Prefix and RoutePrefix

4 years agoMerge pull request #13939 from yuwata/network-fix-memleak-and-13938
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

4 years agojournal: refresh cached credentials of stdout streams
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

4 years agohwdb: add XKB_FIXED_MODEL to the keyboard hwdb
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.

4 years agoMerge pull request #13935 from poettering/bootctl-random-seed-mkdir
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 …

4 years agosd-radv: fix memleak 13939/head
Yu Watanabe [Tue, 5 Nov 2019 04:30:00 +0000 (13:30 +0900)] 
sd-radv: fix memleak