Commit Graph

42133 Commits

Author SHA1 Message Date
Lennart Poettering 60c20e242c update TODO 2019-11-13 09:42:58 +00:00
Lennart Poettering 5322db0651 timedated: it might be that tzinfo files are just not installed 2019-11-13 10:39:14 +01:00
Lennart Poettering 9193af0f05 timedated: handle UTC specially, when generating /etc/localtime 2019-11-13 10:39:14 +01:00
Lennart Poettering bc9ecd484f time-util: treat /etc/localtime missing as UTC 2019-11-13 10:39:14 +01:00
Zbigniew Jędrzejewski-Szmek 7b631898ef
Merge pull request #13961 from mwilck/udev-no-exit-timeout
udevd: wait for workers to finish when exiting
2019-11-13 08:56:49 +01:00
Anita Zhang cee33a7ab3
Merge pull request #14001 from keszybz/test-unit-name-more
Test unit name more
2019-11-12 10:59:55 -08:00
Zbigniew Jędrzejewski-Szmek d1be9a4380
Merge pull request #13984 from yuwata/udev-fix-13976
udev: fix issue #13976
2019-11-12 19:05:24 +01:00
Zbigniew Jędrzejewski-Szmek 637bc63a5c
Merge pull request #13989 from keszybz/meson-warning
Adjust compiler option management to avoid warnings from meson
2019-11-12 19:03:50 +01:00
Martin Wilck 7b6596d748 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().
2019-11-12 16:43:42 +01:00
Lennart Poettering 462255c65b meson: order list of dependencies of libshared alphabetically
Let's make merging patches against this more stable.
2019-11-12 15:30:18 +01:00
Lennart Poettering 91fc013fc4 update TODO 2019-11-12 15:18:37 +01:00
Franck Bui 8246905af0 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 ad96887a12) 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
adb8688b3f 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
2019-11-12 14:53:24 +01:00
Martin Wilck bfde9421af 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.
2019-11-12 12:20:20 +01:00
Zbigniew Jędrzejewski-Szmek 642f41a4ec test-unit-name: check that unexpanded specifiers not valid unit name make 2019-11-12 11:52:22 +01:00
Zbigniew Jędrzejewski-Szmek c86ebcf389 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.
2019-11-12 11:52:22 +01:00
Zbigniew Jędrzejewski-Szmek 9e9dd3e329
Merge pull request #13862 from zachsmith/systemd-tmpfiles-deprecate-for-force
systemd-tmpfiles: deprecate F for f+
2019-11-12 10:28:59 +01:00
Yu Watanabe a566ed2c82 udev: do not append newline when write attributes
Before 25de7aa7b9, the content is written
by `fprintf()` without new line. So WRITE_STRING_FILE_AVOID_NEWLINE flag
is necessary.

Fixes #13985.
2019-11-12 09:25:00 +01:00
Zbigniew Jędrzejewski-Szmek e9f4f5667d 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.
2019-11-12 09:23:31 +01:00
Zbigniew Jędrzejewski-Szmek 827ca90986 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.
2019-11-12 09:23:31 +01:00
Zbigniew Jędrzejewski-Szmek cbe8049474 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.
2019-11-12 09:23:31 +01:00
Yu Watanabe b64b83d13e udev: ignore error caused by device disconnection
During an add or change event, the device may be disconnected.

Fixes #13976.
2019-11-12 14:58:53 +09:00
Yu Watanabe ffdc9c891f udev: fix error code in the log message 2019-11-12 14:58:53 +09:00
Yu Watanabe 4b613ec212 udev: ignore ENOENT when chmod_and_chown() device node 2019-11-12 14:58:53 +09:00
Anita Zhang 68f98816cb
Merge pull request #13997 from khfeng/hwdb-dell-vostro5581-ish
hwdb: Mark Intel Sensor Hub's accel sensor on Vostro 5581 as being in…
2019-11-11 17:56:56 -08:00
Anita Zhang 4da0b33511
Merge pull request #13996 from poettering/utc-fix
accept UTC timezone explicitly, even if timezone data is missing
2019-11-11 17:47:43 -08:00
Kai-Heng Feng fe156aeafc 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.
2019-11-12 00:30:46 +08:00
Lennart Poettering 55fd6dca07 time-util: uniquify timezone list, in case UTC is listed in timezone1970.tab, too 2019-11-11 17:06:09 +01:00
Lennart Poettering e8b9e9c470 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)
2019-11-11 17:05:06 +01:00
Hans de Goede 5b1733cdae 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.
2019-11-11 09:43:37 +01:00
Vito Caputo a602d93e44 journal-file: delete some unnecessary braces
Trivial change, just something I noticed skimming the code.
2019-11-10 12:39:44 +01:00
Yu Watanabe e64664cefe
Merge pull request #13975 from keszybz/more-seccomp-syscalls
Add more syscalls to the seccomp lists
2019-11-09 23:27:34 +09:00
Zbigniew Jędrzejewski-Szmek 5021735fad 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.
2019-11-09 09:19:36 +00:00
Zach Smith 4b55952dbe systemd-tmpfiles: cleanup man page program listing 2019-11-08 20:29:36 -08:00
Zbigniew Jędrzejewski-Szmek 9493b16871 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.
2019-11-08 14:41:22 +01:00
Zbigniew Jędrzejewski-Szmek 6ca6771069 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.
2019-11-08 14:40:49 +01:00
Zbigniew Jędrzejewski-Szmek 7fd7dab90f
Merge pull request #13554 from keur/systemctl_status_timer
systemctl: Add timer activation to status
2019-11-08 14:19:40 +01:00
Michal Suchanek 581e2d96fc 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)
2019-11-08 12:11:32 +01:00
Zbigniew Jędrzejewski-Szmek d5c30300da
Merge pull request #13962 from keszybz/man-ordering
Describe ordering in case of Conflicts=
2019-11-08 10:18:46 +01:00
Zbigniew Jędrzejewski-Szmek 38c432b37c man: describe ordering in case of Conflicts=
Fixes #13421.
2019-11-08 10:17:27 +01:00
Alcaro 72a68f9d6d doc: Fix missing parenthesis 2019-11-07 15:35:41 +01:00
Anita Zhang 0499585ffe include missing_fcntl.h where needed
f5947a5e92 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.
2019-11-07 10:17:44 +00:00
Zbigniew Jędrzejewski-Szmek 754499fab2
Merge pull request #13904 from keur/job_mode_triggering
Job mode triggering
2019-11-07 08:36:26 +01:00
Anita Zhang 3e1db806b0 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.
2019-11-07 08:34:53 +01:00
Zbigniew Jędrzejewski-Szmek d19cd71a8a 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.
2019-11-06 22:39:03 +01:00
Anita Zhang 8069017a0f
Merge pull request #13960 from keszybz/meson-loop-fix
meson: remove strange dep that causes meson to enter infinite loop
2019-11-06 11:44:09 -08:00
Dominique Martinet 98647fa0fa man: fix option typo in pam_systemd man page
The session= option does not exist, XDG_SESSION_TYPE overrides the type=
option.
2019-11-06 21:02:55 +09:00
Zbigniew Jędrzejewski-Szmek af336643a0 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.
2019-11-06 12:47:03 +01:00
Anita Zhang b12a67ae14 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
2019-11-06 10:45:03 +09:00
Anita Zhang 7792d9cdd4 man: small grammatical/word choice fixes to crypttab man page
Closes #13608
2019-11-06 10:38:53 +09:00
Anita Zhang f03378805f
Merge pull request #13936 from keszybz/format-table-uninhibited
Output tables at full width if piped
2019-11-05 15:03:15 -08:00