Commit Graph

41112 Commits

Author SHA1 Message Date
Lennart Poettering 9c230b8f86 update TODO 2019-07-24 08:57:23 +09:00
Lennart Poettering d90f2add54 bootctl: show correct error code 2019-07-24 08:56:54 +09:00
Lennart Poettering b5fe7001ee efi: drop unused define 2019-07-24 08:56:32 +09:00
Lennart Poettering 67633c078c efi: remove trailing whitespace in string 2019-07-24 08:56:10 +09:00
Yu Watanabe 81f33199e7 fuzzit: ignore library version 2019-07-23 23:32:33 +03:00
Lennart Poettering a37f062757 hwdb: run 'meson hwdb-update' 2019-07-24 05:16:05 +09:00
Bastien Nocera 64db4c3cbd libudev: Update list of possible actions
Add "move" action as per src/libsystemd/sd-device/device-private.c
2019-07-24 05:14:52 +09:00
Lennart Poettering 623f20fb41 core: add spdx header to all-units.h
The specific header file is probably not copyrightable anyway, since
it's so trivial, but let's still add the SPDX header line so that a
systematic check for the line does't spit out this header needlessly.
2019-07-24 05:06:21 +09:00
Lennart Poettering 28fea36732
Merge pull request #12977 from yuwata/network-route-type-local-12975
network: do not touch kernel-created multicast route
2019-07-23 18:21:00 +02:00
Christian Kellner 7c53215635 hwdb: add HHKB Pro JP keyboard lack of LEDs
The HHKB Pro JP has no leds whatsoever,  record that. The sysfs
file "capabilities/led" says "1f".
2019-07-23 18:17:14 +02:00
Lennart Poettering 51f1928954
Merge pull request #13148 from poettering/v243-news-more
more v243 news preparation
2019-07-23 18:16:57 +02:00
Lennart Poettering 1899985645 meson: bump version for package and .so 2019-07-23 15:56:41 +02:00
Lennart Poettering 4260384911 sd-daemon: don't mention strerror_safe() in examples in public headers
It's an internal function we define, noone else should bother.
2019-07-23 15:56:41 +02:00
Lennart Poettering 29db4c3a08 NEWS: more additions in preparation von v243 2019-07-23 15:56:41 +02:00
Lennart Poettering 0eebcd4c68
Merge pull request #13136 from keszybz/readd-ntp-units.d
ntp-units.d support
2019-07-23 15:49:37 +02:00
Yu Watanabe e3cbaeab86 test-network: add tests for issue #6088 2019-07-23 22:08:58 +09:00
Yu Watanabe bd7d6cec33 network: do not touch kernel-created multicast route
Fixes #6088.
2019-07-23 22:08:49 +09:00
Lennart Poettering ad3f86e6a4
Merge pull request #13109 from poettering/revert-kbd-mode
Revert of #12378 ("VT kbd reset check")
2019-07-23 14:58:37 +02:00
Thomas Weißschuh 877aa0bdcc hwdb: add entry for Zowie FK2 mouse (#13139) 2019-07-23 17:02:43 +10:00
Lennart Poettering cc79d85e92
Merge pull request #13133 from keszybz/pstore-return-value
pstore: refuse to run if arguments are specified
2019-07-22 18:29:52 +02:00
Zbigniew Jędrzejewski-Szmek 971a7a1526 timesyncd: add Conflicts for ntpd and chronyd
Users might end up with more than one of those service enabled, through
admin mistake, or broken installation scriptlets, or whatever. On my machine,
I had both chronyd and timesyncd happilly running at the same time. If
more than one is enabled, it's better to have just one running. Adding
Conflicts will make the issue more visible in logs too.
2019-07-22 15:58:08 +02:00
Zbigniew Jędrzejewski-Szmek e5ea741c62 timesyncd: add ntp-units.d/ entry for timesync
Priority is 80. At least in Fedora, chrony uses 50, and ntpd 60.
timesyncd has lower priority, because if people install those other packages,
it's most likely on purpose. timesyncd is always installed and provides
less functionality.
2019-07-22 15:21:23 +02:00
Zbigniew Jędrzejewski-Szmek afaae43bb1 timedated: add back support for ntp-units.d/
We removed support for foreign services (and ntp-units.d/) in b72ddf0f4.
Support for foreign services was added back in 5d280742, but through an
environment variable.

The problem with the env var approach is that it only works as a mechanism
to select one item, and doesn't work nicely as a mechinism to create a list
of items through drop-ins (because the env var can be easily overridden, but not
extended). Having a list of "ntp providers" is important to be able to reliably disable
all of them when that is requested.

Another problem is that nobody ever bothered to care about our new "standard".
ntp-units.d/ is a nice simple format that works and is already supported by
chrony and ntpd and timedatex. If we were to introduce and ask people to follow
a new standard, there should be some good reason for this. The idea with env
vars has lower functionality, requires systemd-specific syntax. We should just
re-adopt the format that we originally introduced and that seems to work for
everyone, and more on to more interesting problems.
2019-07-22 15:21:20 +02:00
Zbigniew Jędrzejewski-Szmek cdfa3f0c76 meson: catch programs which ignore arguments
Don't try to use <<<. It seems to not work properly with old bash
versions or something.
2019-07-22 14:08:37 +02:00
Zbigniew Jędrzejewski-Szmek 670fb0b483
Merge pull request #13131 from yuwata/pstore-follow-ups
pstore: several minor follow-ups
2019-07-22 10:53:53 +02:00
Zbigniew Jędrzejewski-Szmek 22d6bea882 pstore: refuse to run if arguments are specified
(This is why the --help chech passed.)
2019-07-22 10:43:19 +02:00
Zbigniew Jędrzejewski-Szmek 5f4a882395 pid1: make sure we look at /proc/1/cmdline when parsing config
In recent systemd-nspawn we wouldn't parse init args like systemd.log-level=debug.
This is because we wouldn't even look at /proc/1/cmdline.

$ systemd-nspawn -n cat /proc/1/stat
1 (cat) R 0 1 1 34816 ....
                ^^^^^
34816 is 136:0 a.k.a. /dev/pts/0.
2019-07-22 09:06:22 +02:00
Yu Watanabe 6d4f213b1f pstore: run only when /sys/fs/pstore is not empty 2019-07-22 14:31:21 +09:00
Yu Watanabe baa2ea8681 pstore: use log_setup_service() 2019-07-22 14:31:21 +09:00
Yu Watanabe 6bf18debdd pstore: do not add FILE= journal entry if content_size == 0 2019-07-22 14:31:21 +09:00
Yu Watanabe 03c5f6cc02 pstore: remove temporary file on failure 2019-07-22 14:31:17 +09:00
Yu Watanabe f677270ebb pstore: drop commented out line 2019-07-22 14:10:31 +09:00
Yu Watanabe 337874a45f pstopre: fix return value of list_files()
Previously, the return value of the last read_full_file() is returned.
This makes the error in read_full_file() is always ignored.
2019-07-22 14:10:31 +09:00
Yu Watanabe 2e4effd129 pstore: drop unnecessary initializations 2019-07-22 14:10:31 +09:00
Yu Watanabe 3f708e7f69 meson: drop redundant line
Found by @mattiasb.
2019-07-22 14:10:02 +09:00
Zbigniew Jędrzejewski-Szmek 03909b1e23 man: describe $LESS options more fully
https://bugzilla.redhat.com/show_bug.cgi?id=1655316
2019-07-22 06:58:07 +02:00
Zbigniew Jędrzejewski-Szmek a505166845
Merge pull request #13096 from keszybz/unit-loading
Preparatory work for the unit loading rework
2019-07-19 21:47:10 +02:00
Eric DeVolder 9b4abc69b2 pstore: Tool to archive contents of pstore
This patch introduces the systemd pstore service which will archive the
contents of the Linux persistent storage filesystem, pstore, to other storage,
thus preserving the existing information contained in the pstore, and clearing
pstore storage for future error events.

Linux provides a persistent storage file system, pstore[1], that can store
error records when the kernel dies (or reboots or powers-off). These records in
turn can be referenced to debug kernel problems (currently the kernel stuffs
the tail of the dmesg, which also contains a stack backtrace, into pstore).

The pstore file system supports a variety of backends that map onto persistent
storage, such as the ACPI ERST[2, Section 18.5 Error Serialization] and UEFI
variables[3 Appendix N Common Platform Error Record]. The pstore backends
typically offer a relatively small amount of persistent storage, e.g. 64KiB,
which can quickly fill up and thus prevent subsequent kernel crashes from
recording errors. Thus there is a need to monitor and extract the pstore
contents so that future kernel problems can also record information in the
pstore.

The pstore service is independent of the kdump service. In cloud environments
specifically, host and guest filesystems are on remote filesystems (eg. iSCSI
or NFS), thus kdump relies [implicitly and/or explicitly] upon proper operation
of networking software *and* hardware *and* infrastructure.  Thus it may not be
possible to capture a kernel coredump to a file since writes over the network
may not be possible.

The pstore backend, on the other hand, is completely local and provides a path
to store error records which will survive a reboot and aid in post-mortem
debugging.

Usage Notes:
This tool moves files from /sys/fs/pstore into /var/lib/systemd/pstore.

To enable kernel recording of error records into pstore, one must either pass
crash_kexec_post_notifiers[4] to the kernel command line or enable via 'echo Y
 > /sys/module/kernel/parameters/crash_kexec_post_notifiers'. This option
invokes the recording of errors into pstore *before* an attempt to kexec/kdump
on a kernel crash.

Optionally, to record reboots and shutdowns in the pstore, one can either pass
the printk.always_kmsg_dump[4] to the kernel command line or enable via 'echo Y >
/sys/module/printk/parameters/always_kmsg_dump'. This option enables code on the
shutdown path to record information via pstore.

This pstore service is a oneshot service. When run, the service invokes
systemd-pstore which is a tool that performs the following:
 - reads the pstore.conf configuration file
 - collects the lists of files in the pstore (eg. /sys/fs/pstore)
 - for certain file types (eg. dmesg) a handler is invoked
 - for all other files, the file is moved from pstore

 - In the case of dmesg handler, final processing occurs as such:
   - files processed in reverse lexigraphical order to faciliate
     reconstruction of original dmesg
   - the filename is examined to determine which dmesg it is a part
   - the file is appended to the reconstructed dmesg

For example, the following pstore contents:

 root@vm356:~# ls -al /sys/fs/pstore
 total 0
 drwxr-x--- 2 root root    0 May  9 09:50 .
 drwxr-xr-x 7 root root    0 May  9 09:50 ..
 -r--r--r-- 1 root root 1610 May  9 09:49 dmesg-efi-155741337601001
 -r--r--r-- 1 root root 1778 May  9 09:49 dmesg-efi-155741337602001
 -r--r--r-- 1 root root 1726 May  9 09:49 dmesg-efi-155741337603001
 -r--r--r-- 1 root root 1746 May  9 09:49 dmesg-efi-155741337604001
 -r--r--r-- 1 root root 1686 May  9 09:49 dmesg-efi-155741337605001
 -r--r--r-- 1 root root 1690 May  9 09:49 dmesg-efi-155741337606001
 -r--r--r-- 1 root root 1775 May  9 09:49 dmesg-efi-155741337607001
 -r--r--r-- 1 root root 1811 May  9 09:49 dmesg-efi-155741337608001
 -r--r--r-- 1 root root 1817 May  9 09:49 dmesg-efi-155741337609001
 -r--r--r-- 1 root root 1795 May  9 09:49 dmesg-efi-155741337710001
 -r--r--r-- 1 root root 1770 May  9 09:49 dmesg-efi-155741337711001
 -r--r--r-- 1 root root 1796 May  9 09:49 dmesg-efi-155741337712001
 -r--r--r-- 1 root root 1787 May  9 09:49 dmesg-efi-155741337713001
 -r--r--r-- 1 root root 1808 May  9 09:49 dmesg-efi-155741337714001
 -r--r--r-- 1 root root 1754 May  9 09:49 dmesg-efi-155741337715001

results in the following:

 root@vm356:~# ls -al /var/lib/systemd/pstore/155741337/
 total 92
 drwxr-xr-x 2 root root  4096 May  9 09:50 .
 drwxr-xr-x 4 root root    40 May  9 09:50 ..
 -rw-r--r-- 1 root root  1610 May  9 09:50 dmesg-efi-155741337601001
 -rw-r--r-- 1 root root  1778 May  9 09:50 dmesg-efi-155741337602001
 -rw-r--r-- 1 root root  1726 May  9 09:50 dmesg-efi-155741337603001
 -rw-r--r-- 1 root root  1746 May  9 09:50 dmesg-efi-155741337604001
 -rw-r--r-- 1 root root  1686 May  9 09:50 dmesg-efi-155741337605001
 -rw-r--r-- 1 root root  1690 May  9 09:50 dmesg-efi-155741337606001
 -rw-r--r-- 1 root root  1775 May  9 09:50 dmesg-efi-155741337607001
 -rw-r--r-- 1 root root  1811 May  9 09:50 dmesg-efi-155741337608001
 -rw-r--r-- 1 root root  1817 May  9 09:50 dmesg-efi-155741337609001
 -rw-r--r-- 1 root root  1795 May  9 09:50 dmesg-efi-155741337710001
 -rw-r--r-- 1 root root  1770 May  9 09:50 dmesg-efi-155741337711001
 -rw-r--r-- 1 root root  1796 May  9 09:50 dmesg-efi-155741337712001
 -rw-r--r-- 1 root root  1787 May  9 09:50 dmesg-efi-155741337713001
 -rw-r--r-- 1 root root  1808 May  9 09:50 dmesg-efi-155741337714001
 -rw-r--r-- 1 root root  1754 May  9 09:50 dmesg-efi-155741337715001
 -rw-r--r-- 1 root root 26754 May  9 09:50 dmesg.txt

where dmesg.txt is reconstructed from the group of related
dmesg-efi-155741337* files.

Configuration file:
The pstore.conf configuration file has four settings, described below.
 - Storage : one of "none", "external", or "journal". With "none", this
   tool leaves the contents of pstore untouched. With "external", the
   contents of the pstore are moved into the /var/lib/systemd/pstore,
   as well as logged into the journal.  With "journal", the contents of
   the pstore are recorded only in the systemd journal. The default is
   "external".
 - Unlink : is a boolean. When "true", the default, then files in the
   pstore are removed once processed. When "false", processing of the
   pstore occurs normally, but the pstore files remain.

References:
[1] "Persistent storage for a kernel's dying breath",
    March 23, 2011.
    https://lwn.net/Articles/434821/

[2] "Advanced Configuration and Power Interface Specification",
    version 6.2, May 2017.
    https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf

[3] "Unified Extensible Firmware Interface Specification",
    version 2.8, March 2019.
    https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf

[4] "The kernel’s command-line parameters",
    https://static.lwn.net/kerneldoc/admin-guide/kernel-parameters.html
2019-07-19 21:46:07 +02:00
Zbigniew Jędrzejewski-Szmek f20319402a test-fs-util: call test functions in order of declaration 2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek 5cfa33e0bc Create src/shared/unit-file.[ch] for unit-file related ops
So far we put such functinos in install.[ch], but that is tied too closely
to enable/disable. Let's start moving things to a place with a better name.
2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek 47a0011186 shared/dropin: rename function for clarity
The caller looks for directories and is called "..._find_dirs()". Here, there
is no "finding" going on, so I found the old name confusing.
2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek f1b4b94cae shared/dropin: use TAKE_PTR in one more place 2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek b47aa73a9a basic/path-util: move two path_simplify* functions to be adjacent
No functional change.
2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek 96cf3ec966 pid1: get rid of unit_supported() helper
Another case where "open code" is easier to read than the helper.
2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek 3c4e303136 basic/set: constify operations which don't modify Set
No functional change, but it's nicer to the reader.
2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek f4c43a8115 pid1: do not say "(null)" if no disabled controllers
It looks like we made a mistake. The list is just empty, that's all.
2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek 8d5e593146 pid1: simplify timestamp buffer declaration 2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek d556db0372 Rename test-unit-file to test-load-fragment
This file was testing a mix of functions from src/core/load-fragment.c and some
from src/shared/install.c. Let's name it more appropriately. I want to add
tests for the new unit-file.c too.
2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek cf95bc1dc2 test-unit-file: move some tests to new test-env-file.c 2019-07-19 16:51:14 +02:00
Zbigniew Jędrzejewski-Szmek d578f909ce test-hashmap: move tests which should also apply to ordered hashmaps and add comment
Effectively this does two more tests also for ordered hashmaps.
This setup is a bit confusing, let's add a comment.
2019-07-19 16:51:14 +02:00