Looks like https://github.com/mesonbuild/meson/issues/957 was
reintroduced in meson-0.57.0 (and looking and https://mesonbuild.com/Release-notes-for-0-57-0.html
I'm not sure whether it was intentional or not) so run_command can no
longer be used to get around
https://github.com/mesonbuild/meson/issues/3589. Let's just force
ctags to always use absolute paths to fix it once and for all.
Daan De Meyer [Fri, 14 Jan 2022 16:49:06 +0000 (16:49 +0000)]
journal: Copy holes when archiving BTRFS journal files
Previously, the holes we punched earlier would get removed when
copying the file. Let's enable the new COPY_HOLES flag to make
sure this doesn't happen.
In my test, this drops a 800MB btrfs journal (without compression)
to 720 MB.
meson: drop unused SYSTEMD_STDIO_BRIDGE_BINARY_PATH
The whole point of systemd-stdio-bridge is to be executed on "foreign" systems
where the path might be different, so we use $PATH to find the binary everywhere.
man: enhance the description of systemd-stdio-bridge
I hope that this fixes the comment
https://github.com/systemd/systemd/pull/22141#issuecomment-1013960371
> As someone who doesn't know what this prog does
The listing in the man page is sorted according to logical
use: all the options setting the address are now together.
ci: get Coverity and CodeQL to analyze the "libxkbcommon" part
By analogy with https://github.com/systemd/systemd/pull/22138, to get
the static analyzers to analyze that part of code that package should
be installed there as well.
Daan De Meyer [Fri, 14 Jan 2022 16:41:28 +0000 (16:41 +0000)]
shared: Copy holes in sparse files in copy_bytes_full()
Previously, all holes in sparse files copied with copy_bytes_full()
would be expanded in the target file. Now, we correctly detect holes
in the input file and we replicate them in the target file.
We'd connect to the bus twice: the first time to check networkd namespace,
and then the second time to do the deed we were asked to do. It's nicer
to open the bus just once, for efficience and also to avoid the open call
in all functions.
An ASSERT_PTR helper is added:
- sd_bus *bus = userdata;
...
- assert(bus);
+ sd_bus *bus = ASSERT_PTR(userdata);
...
It can be used in other place too, but I'm leaving that for a later
refactoring.
Daan De Meyer [Thu, 13 Jan 2022 13:26:25 +0000 (13:26 +0000)]
journal: Don't discard -b arg when followed by -e
Allowing -e to be used to view the last logs of a previous boot seems
like a useful feature so let's not discard -b options anymore when
followed by -e.
{build|unit}-test: show meson-log.txt when meson fails
to make it easier to figure out why it fails.
For example in https://github.com/systemd/systemd/runs/4799774735?check_suite_focus=true
it failed with
```
meson.build:1003:8: ERROR: Command "/usr/bin/clang -print-targets" failed with status 1.
A full log can be found at /home/runner/work/systemd/systemd/build/meson-logs/meson-log.txt
Error: Process completed with exit code 1.
```
and it wasn't clear what exactly happened there.
The commit b89a3758e92894162e3c2dcb594a55acff3274d5 made the validity
check of the received message stricter. E.g. if the client received a
message with broken NTP server option, then the entire message is
dropped.
This relaxes the check. If some non-critical options are broken, then
ignore the options, but the message itself is still accepted.
Daan De Meyer [Wed, 12 Jan 2022 14:44:50 +0000 (14:44 +0000)]
journal: Skip data objects with invalid offsets
We already skip invalid objects, but don't yet skip invalid offsets.
Let's skip these as well to improve robustness when we're dealing with
corrupted journals.
Before:
```
➜ systemd git:(main) build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Failed to get journal fields: Cannot assign requested address
-- No entries --
```
After:
```
➜ systemd git:(main) ✗ build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Dec 09 08:32:38 snowball3 NetworkManager[911]: <info> [1639038758.1464] device (wlp1s0): supplicant interface state: scanning -> authenticating
Dec 09 08:32:38 snowball3 kernel: wlp1s0: send auth to ec:a9:40:79:fb:ad (try 1/3)
Dec 09 08:32:38 snowball3 kernel: wlp1s0: authenticate with ec:a9:40:79:fb:ad
Dec 09 08:32:38 snowball3 wpa_supplicant[1003]: wlp1s0: SME: Trying to authenticate with ec:a9:40:79:fb:ad (SSID='UPC949397B' freq=5500 MHz)
```
If a desktop specific ExecCondition= binary does not exist, this just
means that the desktop environment is not available. As such, it is not
an error condition that should prevent the service from being installed
in the .wants target.
All those pages contain a redirect at the top of the page, so it doesn't
make much sense to tell people to take the detour. Linking directly will
also increase the search rankings of the new pages.
network: add example file that enables DHCP on ethernet links
The file has instructions how to "enable" it by symlinking into the
appropriate place. If we create a different mechanism to do enablement
later on, we can always adjust the instructions.
$ for i in network/*-*; do git blame $i;done | less
shows that those files were written by Tom Gundersen, Lennart Poettering, Yu
Watanabe, me, and Marc-André Lureau.
Lidong Zhong [Tue, 11 Jan 2022 05:19:32 +0000 (13:19 +0800)]
shutdown: release the watchdog finally
During reboot or kexec, watchdog will be setup before systemd is
replaced by systemd-shutdown binary. But while systemd-shutdown is
executed, the watchdog will not really be released. Log shown as
following:
[ 39.371202] watchdog: watchdog0: watchdog did not stop!
[ 39.383659] systemd-shutdown[1]: Syncing filesystems and block
devices.
[ 39.423727] systemd-shutdown[1]: Sending SIGTERM to remaining
processes...
[ 39.440857] systemd-journald[526]: Received SIGTERM from PID 1
(systemd-shutdow).
[ 39.461047] systemd-shutdown[1]: Sending SIGKILL to remaining
processes...
[ 39.466736] systemd-shutdown[1]: Using hardware watchdog 'iTCO_wdt',
version 0, device /dev/watchdog
[ 39.467835] systemd-shutdown[1]: Unmounting file systems.
[ 39.469721] [2171]: Remounting '/' read-only in with options
'attr2,inode64,logbufs=8,logbsize=32k,noquota'.
[ 39.550266] systemd-shutdown[1]: All filesystems unmounted.
[ 39.550274] systemd-shutdown[1]: Deactivating swaps.
[ 39.550443] systemd-shutdown[1]: All swaps deactivated.
[ 39.550449] systemd-shutdown[1]: Detaching loop devices.
[ 39.550697] systemd-shutdown[1]: All loop devices detached.
[ 39.550703] systemd-shutdown[1]: Detaching DM devices.
[ 39.551269] systemd-shutdown[1]: Not all DM devices detached, 1
left.
[ 39.551277] systemd-shutdown[1]: Cannot finalize remaining DM
devices, continuing.
[ 39.580044] systemd-shutdown[1]: Successfully changed into root
pivot.
[ 39.580050] systemd-shutdown[1]: Returning to initrd...
[ 39.587921] watchdog: watchdog0: watchdog did not stop!
[ 39.774130] dracut Warning: Break before pre-shutdown
after applying fix
[ 59.520379] watchdog: watchdog0: watchdog did not stop!
[ 59.542286] systemd-shutdown[1]: Syncing filesystems and block
devices.
[ 59.583313] systemd-shutdown[1]: Sending SIGTERM to remaining
processes...
[ 59.600133] systemd-journald[517]: Received SIGTERM from PID 1
(systemd-shutdow).
[ 59.624435] systemd-shutdown[1]: Sending SIGKILL to remaining
processes...
[ 59.629288] systemd-shutdown[1]: Using hardware watchdog
'iTCO_wdt', version 0, device /dev/watchdog
[ 59.630468] systemd-shutdown[1]: Unmounting file systems.
[ 59.632219] [2172]: Remounting '/' read-only in with options
'attr2,inode64,logbufs=8,logbsize=32k,noquota'.
[ 59.727588] systemd-shutdown[1]: All filesystems unmounted.
[ 59.727596] systemd-shutdown[1]: Deactivating swaps.
[ 59.727719] systemd-shutdown[1]: All swaps deactivated.
[ 59.727725] systemd-shutdown[1]: Detaching loop devices.
[ 59.727974] systemd-shutdown[1]: All loop devices detached.
[ 59.727979] systemd-shutdown[1]: Detaching DM devices.
[ 59.728547] systemd-shutdown[1]: Not all DM devices detached, 1
left.
[ 59.728556] systemd-shutdown[1]: Cannot finalize remaining DM
devices, continuing.
[ 59.758160] systemd-shutdown[1]: Successfully changed into root
pivot.
[ 59.758167] systemd-shutdown[1]: Returning to initrd...
[ 59.950305] dracut Warning: Break before pre-shutdown
network: say that our example files are licensed as CC0
This matches what we have for example programs under man/, and is nice
because it allows people to copy the files as they wish without worrying
about copyright. The files are too trivial to copyright anyway.
Jan Janssen [Tue, 11 Jan 2022 10:27:27 +0000 (11:27 +0100)]
meson: Use echo to list files
No need to invoke ls when we are just interested in file names.
Also, the cd to source root makes the output identical to
"git ls-files" (relative instead of absolute paths).
nss: only read logging config from environment variables
log_parse_environment() uses should_parse_proc_cmdline() to determine whether
it should parse settings from the kernel command line. But the checks that
should_parse_proc_cmdline() apply to the whole process, and we could get a positive
answer also when log_parse_environment() was called from one of the nss modules.
In case of nss-modules, we don't want to look at the kernel command line.
log_parse_environment_variables() that only looks at the environment variables
is split out and used in the nss modules.