]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoefivars: modernize efi_get_variable() a bit
Lennart Poettering [Fri, 19 Jul 2019 16:29:53 +0000 (18:29 +0200)] 
efivars: modernize efi_get_variable() a bit

Primarily, make sure the return parameters are all individually
optional.

4 years agoefi: add log_oom() helper
Lennart Poettering [Thu, 18 Jul 2019 18:59:16 +0000 (20:59 +0200)] 
efi: add log_oom() helper

4 years agoefi: modernize file_read() a bit
Lennart Poettering [Thu, 18 Jul 2019 18:59:05 +0000 (20:59 +0200)] 
efi: modernize file_read() a bit

4 years agoxattr-util: document that we NUL suffix
Lennart Poettering [Mon, 22 Jul 2019 11:49:17 +0000 (13:49 +0200)] 
xattr-util: document that we NUL suffix

4 years agofs-util: add fsync_full() helper
Lennart Poettering [Mon, 22 Jul 2019 11:48:12 +0000 (13:48 +0200)] 
fs-util: add fsync_full() helper

We usually combine an fsync() with fsync_directory_of_file() hence let's
add a helper that does both in one.

4 years agoMerge pull request #13144 from poettering/nspawn-modprobe
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jul 2019 09:34:37 +0000 (11:34 +0200)] 
Merge pull request #13144 from poettering/nspawn-modprobe

nspawn modprobe fixes

4 years agonetwork: drop redundant Link::kind check
Yu Watanabe [Thu, 25 Jul 2019 01:11:45 +0000 (10:11 +0900)] 
network: drop redundant Link::kind check

All CAN devices' iftype are ARPHRD_CAN. So, checking Link::kind is
redundant.

Follow-up for c6ac3729c9ece63185a3c4e7bc1970b98d2feb01.

4 years agounits: add initrd-network-generator.service
Yu Watanabe [Thu, 25 Jul 2019 04:01:59 +0000 (13:01 +0900)] 
units: add initrd-network-generator.service

4 years agoMerge pull request #13179 from yuwata/network-drop-new-settings-from-dhcp-section
Yu Watanabe [Thu, 25 Jul 2019 06:44:25 +0000 (15:44 +0900)] 
Merge pull request #13179 from yuwata/network-drop-new-settings-from-dhcp-section

network: drop recently added settings from deprecated [DHCP] section

4 years agonetwork: drop recently added settings from deprecated [DHCP] section 13179/head
Yu Watanabe [Thu, 25 Jul 2019 03:39:33 +0000 (12:39 +0900)] 
network: drop recently added settings from deprecated [DHCP] section

4 years agotest-network: use [DHCPv4] and [DHCPv6] sections instead of deprecated [DHCP] section
Yu Watanabe [Thu, 25 Jul 2019 03:38:57 +0000 (12:38 +0900)] 
test-network: use [DHCPv4] and [DHCPv6] sections instead of deprecated [DHCP] section

4 years agoMerge pull request #13169 from ssahani/bridge-igmp-group-version
Yu Watanabe [Thu, 25 Jul 2019 03:12:40 +0000 (12:12 +0900)] 
Merge pull request #13169 from ssahani/bridge-igmp-group-version

Bridge igmp group version

4 years agotest-network: add test for Bridge.IGMPVersion= 13169/head
Yu Watanabe [Thu, 25 Jul 2019 01:01:46 +0000 (10:01 +0900)] 
test-network: add test for Bridge.IGMPVersion=

4 years agonetworkd: bridge add support to set IGMP version
Susant Sahani [Wed, 24 Jul 2019 12:58:57 +0000 (18:28 +0530)] 
networkd: bridge add support to set IGMP version

4 years agoAdd IFLA_BR_MCAST_IGMP_VERSION
Shreyas Behera [Wed, 24 Jul 2019 12:54:51 +0000 (18:24 +0530)] 
Add IFLA_BR_MCAST_IGMP_VERSION

4 years agoMerge pull request #13166 from yuwata/network-slcan-support
Yu Watanabe [Thu, 25 Jul 2019 00:49:56 +0000 (09:49 +0900)] 
Merge pull request #13166 from yuwata/network-slcan-support

network: slcan support

4 years agoMerge pull request #13173 from kinvolk/iaguis/fix-norbind
Yu Watanabe [Thu, 25 Jul 2019 00:47:59 +0000 (09:47 +0900)] 
Merge pull request #13173 from kinvolk/iaguis/fix-norbind

Revert "nspawn: remove unnecessary mount option parsing logic"

4 years agotests: pass --werror to meson on Semaphore
Evgeny Vereshchagin [Wed, 24 Jul 2019 15:36:19 +0000 (15:36 +0000)] 
tests: pass --werror to meson on Semaphore

4 years agocore: try to reopen /dev/kmsg again right after mounting /dev
Lennart Poettering [Fri, 19 Jul 2019 16:29:11 +0000 (18:29 +0200)] 
core: try to reopen /dev/kmsg again right after mounting /dev

I was debugging stuff during early boot, and was confused that I never
found the logs for it in kmsg. The reason for that was that /proc is
generally not mounted the first time we do log_open() and hence
log_set_target(LOG_TARGET_KMSG) we do when running as PID 1 had not
effect. A lot later during start-up we call log_open() again where this
is fixed (after the point where we close all remaining fds still open),
but in the meantime no logs every got written to kmsg. This patch fixes
that.

4 years agoAdd Logitech touchpads, sort vendors alphabetically (#13167)
RussianNeuroMancer [Wed, 24 Jul 2019 17:49:44 +0000 (01:49 +0800)] 
Add Logitech touchpads, sort vendors alphabetically (#13167)

hwdb: Add Logitech touchpads, such as Logitech Wireless Touchpad, Logitech T650 and others

Sort vendors alphabetically.

4 years agoupdate NEWS with more recently commited stuff
Lennart Poettering [Wed, 24 Jul 2019 15:05:09 +0000 (17:05 +0200)] 
update NEWS with more recently commited stuff

4 years agoRevert "timesyncd: add Conflicts for ntpd and chronyd"
Lennart Poettering [Wed, 24 Jul 2019 15:08:05 +0000 (17:08 +0200)] 
Revert "timesyncd: add Conflicts for ntpd and chronyd"

This reverts commit 971a7a1526a6c1d5cb439a8a41dc65ccd4e3a66f.

These unit names are typically different on distributions, let's not
hardcode those. Stuff like this should probably live in the distro
RPM/.deb, but not upstream, where we should be distro agnostic and
agnostic to other higher level packages like this.

4 years agotest: add some test for norbind 13173/head
Iago López Galeiras [Wed, 24 Jul 2019 14:55:17 +0000 (16:55 +0200)] 
test: add some test for norbind

This regressed so let's add a test to make sure it doesn't happen again.

4 years agoRevert "nspawn: remove unnecessary mount option parsing logic"
Iago López Galeiras [Wed, 24 Jul 2019 14:41:29 +0000 (16:41 +0200)] 
Revert "nspawn: remove unnecessary mount option parsing logic"

This reverts commit 72d967df3e27186dd014bed2c6e7400cc32d84c5.

Revert this because it broke the `norbind` option of the bind flags
because it does bind-mounts unconditionally recursive.

Let's bring the old logic back.

Fixes: #13170
4 years agoMerge pull request #13168 from ssahani/fix-dhcp-route-no-parsing
Lennart Poettering [Wed, 24 Jul 2019 14:42:18 +0000 (16:42 +0200)] 
Merge pull request #13168 from ssahani/fix-dhcp-route-no-parsing

network: fix DHCP route rumber parsing.

4 years agosysctl: Enable ping(8) inside rootless Podman containers
Debarshi Ray [Mon, 22 Jul 2019 19:30:25 +0000 (21:30 +0200)] 
sysctl: Enable ping(8) inside rootless Podman containers

This makes ping(8) work without CAP_NET_ADMIN and CAP_NET_RAW because
those aren't effective inside rootless Podman containers.

It's quite useful when using OSTree based operating systems like Fedora
Silverblue, where development environments are often set up using
rootless Podman containers with helpers like Toolbox [1]. Not having
a basic network utility like ping(8) work inside the development
environment can be inconvenient.

See:
https://lwn.net/Articles/422330/
http://man7.org/linux/man-pages/man7/icmp.7.html
https://github.com/containers/libpod/issues/1550

The upper limit of the range of group identifiers is set to 2147483647,
which is 2^31-1. Values greater than that get rejected by the kernel
because of this definition in linux/include/net/ping.h:
  #define GID_T_MAX (((gid_t)~0U) >> 1)

That's not so bad because values between 2^31 and 2^32-1 are reserved
on systemd-based systems anyway [2].

[1] https://github.com/debarshiray/toolbox
[2] https://systemd.io/UIDS-GIDS.html#summary

4 years agonetwork: support slcan 13166/head
Yu Watanabe [Wed, 24 Jul 2019 09:23:45 +0000 (18:23 +0900)] 
network: support slcan

The device driver does not have IFLA_INFO_KIND attribute. So, we need to
check iftype.

Closes #13150.

4 years agonetwork: fix DHCP route rumber parsing. 13168/head
Susant Sahani [Wed, 24 Jul 2019 11:26:31 +0000 (16:56 +0530)] 
network: fix DHCP route rumber parsing.

4 years agoMerge pull request #13145 from poettering/nss-gateway-fix
Zbigniew Jędrzejewski-Szmek [Wed, 24 Jul 2019 10:00:30 +0000 (12:00 +0200)] 
Merge pull request #13145 from poettering/nss-gateway-fix

filter _gateway NSS resolving to only use main routing table

4 years agoman: highlight the different concepts behind h/H and t/T
Lennart Poettering [Wed, 24 Jul 2019 07:59:38 +0000 (09:59 +0200)] 
man: highlight the different concepts behind h/H and t/T

Fixes: #13151
4 years agotree-wide: drop netinet/ether.h from socket-util.h and sd-netlink.h
Yu Watanabe [Wed, 24 Jul 2019 09:22:43 +0000 (18:22 +0900)] 
tree-wide: drop netinet/ether.h from socket-util.h and sd-netlink.h

4 years agoMerge pull request #13118 from bluca/shutdown_watchdog_kexec
Lennart Poettering [Wed, 24 Jul 2019 09:11:03 +0000 (11:11 +0200)] 
Merge pull request #13118 from bluca/shutdown_watchdog_kexec

core: add KExecWatchdogSec and rename ShutdownWatchdogSec to RebootWatchdogSec

4 years agoMerge pull request #13143 from poettering/logind-inhibit-restart
Yu Watanabe [Wed, 24 Jul 2019 07:50:39 +0000 (16:50 +0900)] 
Merge pull request #13143 from poettering/logind-inhibit-restart

logind restart inhibition fixes

4 years agomeson: reorder alphabetically 13145/head
Lennart Poettering [Tue, 23 Jul 2019 12:29:18 +0000 (14:29 +0200)] 
meson: reorder alphabetically

4 years agolocal-addresses: filter out any routing tables but the main one
Lennart Poettering [Tue, 23 Jul 2019 12:28:41 +0000 (14:28 +0200)] 
local-addresses: filter out any routing tables but the main one

Fixes: #13132
4 years agonetlink: move local-addresses.[ch] to src/shared
Lennart Poettering [Tue, 23 Jul 2019 12:22:06 +0000 (14:22 +0200)] 
netlink: move local-addresses.[ch] to src/shared

This code is not part of the public API of sd-netlink, nor used by it
internally and hence should not be in the sd-netlink directory.

Also, move the test case for it to src/test/.

4 years ago[systemctl] Don't print ExecXYZEx= when doing 'systemctl status'
Anita Zhang [Tue, 23 Jul 2019 20:26:51 +0000 (13:26 -0700)] 
[systemctl] Don't print ExecXYZEx= when doing 'systemctl status'

The info printed in this function is the same as the non-Ex version of the
property so there's no point double printing.

Other places that print ExecXYZEx= properties are left alone since the
displayed information is different.

4 years agofactory: add default /etc/issue file
Lennart Poettering [Tue, 23 Jul 2019 18:22:23 +0000 (20:22 +0200)] 
factory: add default /etc/issue file

Booting up an image with --volatile=yes otherwise looks so naked, so
let's include this file in the default factory too. It's common and
simple and should be safe to ship.

4 years agoupdate TODO
Lennart Poettering [Tue, 23 Jul 2019 18:21:07 +0000 (20:21 +0200)] 
update TODO

4 years agobootctl: show correct error code
Lennart Poettering [Fri, 19 Jul 2019 15:52:26 +0000 (17:52 +0200)] 
bootctl: show correct error code

4 years agoefi: drop unused define
Lennart Poettering [Thu, 18 Jul 2019 18:58:34 +0000 (20:58 +0200)] 
efi: drop unused define

4 years agoefi: remove trailing whitespace in string
Lennart Poettering [Thu, 18 Jul 2019 18:56:41 +0000 (20:56 +0200)] 
efi: remove trailing whitespace in string

4 years agofuzzit: ignore library version
Yu Watanabe [Tue, 23 Jul 2019 19:50:52 +0000 (04:50 +0900)] 
fuzzit: ignore library version

4 years agohwdb: run 'meson hwdb-update'
Lennart Poettering [Tue, 23 Jul 2019 12:55:42 +0000 (14:55 +0200)] 
hwdb: run 'meson hwdb-update'

4 years agolibudev: Update list of possible actions
Bastien Nocera [Tue, 5 Sep 2017 15:14:58 +0000 (17:14 +0200)] 
libudev: Update list of possible actions

Add "move" action as per src/libsystemd/sd-device/device-private.c

4 years agocore: add spdx header to all-units.h
Lennart Poettering [Tue, 23 Jul 2019 06:38:21 +0000 (08:38 +0200)] 
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.

4 years agocore: rename ShutdownWatchdogSec to RebootWatchdogSec 13118/head
Luca Boccassi [Mon, 22 Jul 2019 10:39:25 +0000 (11:39 +0100)] 
core: rename ShutdownWatchdogSec to RebootWatchdogSec

This option is only used on reboot, not on other types of shutdown
modes, so it is misleading.
Keep the old name working for backward compatibility, but remove it
from the documentation.

4 years agocore: add KExecWatchdogSec option
Luca Boccassi [Fri, 19 Jul 2019 10:54:15 +0000 (11:54 +0100)] 
core: add KExecWatchdogSec option

Rather than always enabling the shutdown WD on kexec, which might be
dangerous in case the kernel driver and/or the hardware implementation
does not reset the wd on kexec, add a new timer, disabled by default,
to let users optionally enable the shutdown WD on kexec separately
from the runtime and reboot ones. Advise in the documentation to
also use the runtime WD in conjunction with it.

Fixes: a637d0f9ecbe ("core: set shutdown watchdog on kexec too")
4 years agoMerge pull request #12977 from yuwata/network-route-type-local-12975
Lennart Poettering [Tue, 23 Jul 2019 16:21:00 +0000 (18:21 +0200)] 
Merge pull request #12977 from yuwata/network-route-type-local-12975

network: do not touch kernel-created multicast route

4 years agohwdb: add HHKB Pro JP keyboard lack of LEDs
Christian Kellner [Tue, 23 Jul 2019 13:41:20 +0000 (15:41 +0200)] 
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".

4 years agoMerge pull request #13148 from poettering/v243-news-more
Lennart Poettering [Tue, 23 Jul 2019 16:16:57 +0000 (18:16 +0200)] 
Merge pull request #13148 from poettering/v243-news-more

more v243 news preparation

4 years agologind: don't unlink session fifo when exiting logind 13143/head
Lennart Poettering [Tue, 23 Jul 2019 10:41:05 +0000 (12:41 +0200)] 
logind: don't unlink session fifo when exiting logind

Let's only close our fds, but not unlink it. That's done when the
session is stopped.

This should make sure the fd will survive daemon restarts.

4 years agologind: make id const, since it points into another buffer
Lennart Poettering [Tue, 23 Jul 2019 10:40:52 +0000 (12:40 +0200)] 
logind: make id const, since it points into another buffer

4 years agologind: at start-up automatically clean up orphaned inhibitors
Lennart Poettering [Tue, 23 Jul 2019 08:33:39 +0000 (10:33 +0200)] 
logind: at start-up automatically clean up orphaned inhibitors

4 years agologind: un-export and voidify a few functions
Lennart Poettering [Tue, 23 Jul 2019 08:32:41 +0000 (10:32 +0200)] 
logind: un-export and voidify a few functions

Let's minimize scope of functions and make sure that functions that
semantically should never fail can't return errors.

4 years agologind: rework allocation/freeing of inhibitors
Lennart Poettering [Tue, 23 Jul 2019 08:27:19 +0000 (10:27 +0200)] 
logind: rework allocation/freeing of inhibitors

Let's follow our modern style (i.e. return proper errors, use structure
initialization and _cleanup_).

Most importantly: remove state file and FIFO removal from
inhibitor_free() and let's move it to inhibitor_stop().

This makes sure that state files/FIFOs are not removed when the we
terminate logind, i.e. that they can survive logind restarts.

Fixes: #11825
4 years agologind: use free_and_replace() where that makes sense
Lennart Poettering [Tue, 23 Jul 2019 08:25:03 +0000 (10:25 +0200)] 
logind: use free_and_replace() where that makes sense

4 years agologind: add logging to inhibitor_load()
Lennart Poettering [Tue, 23 Jul 2019 08:23:15 +0000 (10:23 +0200)] 
logind: add logging to inhibitor_load()

Also make some parsing errors, fatals and others (that just care fore
'decoration') non-fatal.

The single caller of inhibitor_load() didn't log about any errors, hence
let's do this in our function, similar to how this is done in
session_load() already.

4 years agologind: unify inhibitor signal generation in a single function
Lennart Poettering [Tue, 23 Jul 2019 08:22:24 +0000 (10:22 +0200)] 
logind: unify inhibitor signal generation in a single function

4 years agologind: cast to (void) when we ignore a syscall return value that is potentially...
Lennart Poettering [Tue, 23 Jul 2019 08:19:58 +0000 (10:19 +0200)] 
logind: cast to (void) when we ignore a syscall return value that is potentially dangerous

4 years agologind: drop redundant session_id_valid() check
Lennart Poettering [Tue, 23 Jul 2019 08:18:40 +0000 (10:18 +0200)] 
logind: drop redundant session_id_valid() check

session_new() checks that as first step anyway, no need to do this
beforehand.

4 years agologind: use log_warning_errno() return value where we can
Lennart Poettering [Tue, 23 Jul 2019 08:17:46 +0000 (10:17 +0200)] 
logind: use log_warning_errno() return value where we can

Also, change a couple of log error levels to LOG_WARNING, where we
encounter an error but then end up ignoring it.

4 years agologind: don't claim we'd preallocate VTs when we shortcut it
Lennart Poettering [Tue, 23 Jul 2019 08:13:45 +0000 (10:13 +0200)] 
logind: don't claim we'd preallocate VTs when we shortcut it

4 years agologind: use gcc empty structure initialization
Lennart Poettering [Tue, 23 Jul 2019 08:13:28 +0000 (10:13 +0200)] 
logind: use gcc empty structure initialization

4 years agologind: check return value of inhibitor_start()
Lennart Poettering [Tue, 23 Jul 2019 08:12:43 +0000 (10:12 +0200)] 
logind: check return value of inhibitor_start()

4 years agologind: add missing OOM check in client tool
Lennart Poettering [Tue, 23 Jul 2019 08:12:25 +0000 (10:12 +0200)] 
logind: add missing OOM check in client tool

4 years agomeson: bump version for package and .so 13148/head
Lennart Poettering [Tue, 23 Jul 2019 13:36:01 +0000 (15:36 +0200)] 
meson: bump version for package and .so

4 years agosd-daemon: don't mention strerror_safe() in examples in public headers
Lennart Poettering [Tue, 23 Jul 2019 13:35:32 +0000 (15:35 +0200)] 
sd-daemon: don't mention strerror_safe() in examples in public headers

It's an internal function we define, noone else should bother.

4 years agoNEWS: more additions in preparation von v243
Lennart Poettering [Tue, 23 Jul 2019 13:33:33 +0000 (15:33 +0200)] 
NEWS: more additions in preparation von v243

4 years agoMerge pull request #13136 from keszybz/readd-ntp-units.d
Lennart Poettering [Tue, 23 Jul 2019 13:49:37 +0000 (15:49 +0200)] 
Merge pull request #13136 from keszybz/readd-ntp-units.d

ntp-units.d support

4 years agotest-network: add tests for issue #6088 12977/head
Yu Watanabe [Mon, 8 Jul 2019 17:38:14 +0000 (02:38 +0900)] 
test-network: add tests for issue #6088

4 years agonetwork: do not touch kernel-created multicast route
Yu Watanabe [Tue, 9 Jul 2019 15:30:27 +0000 (00:30 +0900)] 
network: do not touch kernel-created multicast route

Fixes #6088.

4 years agoMerge pull request #13109 from poettering/revert-kbd-mode
Lennart Poettering [Tue, 23 Jul 2019 12:58:37 +0000 (14:58 +0200)] 
Merge pull request #13109 from poettering/revert-kbd-mode

Revert of #12378 ("VT kbd reset check")

4 years agoman: document the modprobe hack for DeviceAllow= 13144/head
Lennart Poettering [Tue, 23 Jul 2019 11:28:44 +0000 (13:28 +0200)] 
man: document the modprobe hack for DeviceAllow=

4 years agounits: make sure logind can properly reference drm char class
Lennart Poettering [Tue, 23 Jul 2019 11:14:53 +0000 (13:14 +0200)] 
units: make sure logind can properly reference drm char class

Similar to the previous fix.

4 years agonspawn: explicitly load units beforehand so that DeviceAllow= syntax works
Lennart Poettering [Tue, 23 Jul 2019 11:11:09 +0000 (13:11 +0200)] 
nspawn: explicitly load units beforehand so that DeviceAllow= syntax works

Yuck, but I don't see any prettier solution.

Fixes: #13130
4 years agohwdb: add entry for Zowie FK2 mouse (#13139)
Thomas Weißschuh [Tue, 23 Jul 2019 07:02:43 +0000 (09:02 +0200)] 
hwdb: add entry for Zowie FK2 mouse (#13139)

4 years agoMerge pull request #13133 from keszybz/pstore-return-value
Lennart Poettering [Mon, 22 Jul 2019 16:29:52 +0000 (18:29 +0200)] 
Merge pull request #13133 from keszybz/pstore-return-value

pstore: refuse to run if arguments are specified

4 years agotimesyncd: add Conflicts for ntpd and chronyd 13136/head
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jul 2019 13:58:08 +0000 (15:58 +0200)] 
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.

4 years agotimesyncd: add ntp-units.d/ entry for timesync
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jul 2019 12:47:51 +0000 (14:47 +0200)] 
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.

4 years agotimedated: add back support for ntp-units.d/
Zbigniew Jędrzejewski-Szmek [Sun, 21 Jul 2019 13:06:35 +0000 (15:06 +0200)] 
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.

4 years agomeson: catch programs which ignore arguments 13133/head
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jul 2019 08:59:19 +0000 (10:59 +0200)] 
meson: catch programs which ignore arguments

Don't try to use <<<. It seems to not work properly with old bash
versions or something.

4 years agoMerge pull request #13131 from yuwata/pstore-follow-ups
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jul 2019 08:53:53 +0000 (10:53 +0200)] 
Merge pull request #13131 from yuwata/pstore-follow-ups

pstore: several minor follow-ups

4 years agopstore: refuse to run if arguments are specified
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jul 2019 08:43:19 +0000 (10:43 +0200)] 
pstore: refuse to run if arguments are specified

(This is why the --help chech passed.)

4 years agopid1: make sure we look at /proc/1/cmdline when parsing config
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2019 15:13:09 +0000 (17:13 +0200)] 
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.

4 years agopstore: run only when /sys/fs/pstore is not empty 13131/head
Yu Watanabe [Mon, 22 Jul 2019 05:09:12 +0000 (14:09 +0900)] 
pstore: run only when /sys/fs/pstore is not empty

4 years agopstore: use log_setup_service()
Yu Watanabe [Mon, 22 Jul 2019 04:14:28 +0000 (13:14 +0900)] 
pstore: use log_setup_service()

4 years agopstore: do not add FILE= journal entry if content_size == 0
Yu Watanabe [Mon, 22 Jul 2019 02:08:06 +0000 (11:08 +0900)] 
pstore: do not add FILE= journal entry if content_size == 0

4 years agopstore: remove temporary file on failure
Yu Watanabe [Mon, 22 Jul 2019 02:01:43 +0000 (11:01 +0900)] 
pstore: remove temporary file on failure

4 years agopstore: drop commented out line
Yu Watanabe [Mon, 22 Jul 2019 01:58:13 +0000 (10:58 +0900)] 
pstore: drop commented out line

4 years agopstopre: fix return value of list_files()
Yu Watanabe [Mon, 22 Jul 2019 01:55:10 +0000 (10:55 +0900)] 
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.

4 years agopstore: drop unnecessary initializations
Yu Watanabe [Mon, 22 Jul 2019 01:52:12 +0000 (10:52 +0900)] 
pstore: drop unnecessary initializations

4 years agomeson: drop redundant line
Yu Watanabe [Mon, 22 Jul 2019 01:46:53 +0000 (10:46 +0900)] 
meson: drop redundant line

Found by @mattiasb.

4 years agoman: describe $LESS options more fully
Zbigniew Jędrzejewski-Szmek [Sun, 21 Jul 2019 10:32:17 +0000 (12:32 +0200)] 
man: describe $LESS options more fully

https://bugzilla.redhat.com/show_bug.cgi?id=1655316

4 years agoMerge pull request #13096 from keszybz/unit-loading
Zbigniew Jędrzejewski-Szmek [Fri, 19 Jul 2019 19:47:10 +0000 (21:47 +0200)] 
Merge pull request #13096 from keszybz/unit-loading

Preparatory work for the unit loading rework

4 years agopstore: Tool to archive contents of pstore
Eric DeVolder [Thu, 16 May 2019 13:59:01 +0000 (08:59 -0500)] 
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

4 years agotest-fs-util: call test functions in order of declaration 13096/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2019 11:11:44 +0000 (13:11 +0200)] 
test-fs-util: call test functions in order of declaration

4 years agoCreate src/shared/unit-file.[ch] for unit-file related ops
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jul 2019 13:46:16 +0000 (15:46 +0200)] 
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.

4 years agoshared/dropin: rename function for clarity
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jul 2019 14:04:34 +0000 (16:04 +0200)] 
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.

4 years agoshared/dropin: use TAKE_PTR in one more place
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jul 2019 13:56:21 +0000 (15:56 +0200)] 
shared/dropin: use TAKE_PTR in one more place