]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest: add testcase for broken NTP server option 22106/head
Yu Watanabe [Thu, 13 Jan 2022 11:19:46 +0000 (20:19 +0900)] 
test: add testcase for broken NTP server option

For issue #22099.

2 years agotest: voidify test functions
Yu Watanabe [Thu, 13 Jan 2022 09:55:51 +0000 (18:55 +0900)] 
test: voidify test functions

This also drops unnecessary arguments, and unbreak several lines.

2 years agosd-dhcp6-client: expose client_parse_message()
Yu Watanabe [Thu, 13 Jan 2022 11:19:01 +0000 (20:19 +0900)] 
sd-dhcp6-client: expose client_parse_message()

To introduce tests for the function in later commits.

2 years agosd-dhcp6-client: ignore broken non-critical options
Yu Watanabe [Thu, 13 Jan 2022 11:13:03 +0000 (20:13 +0900)] 
sd-dhcp6-client: ignore broken non-critical options

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.

Fixes #22099.

2 years agoMerge pull request #22100 from bluca/test_part
Yu Watanabe [Thu, 13 Jan 2022 05:00:36 +0000 (14:00 +0900)] 
Merge pull request #22100 from bluca/test_part

Fix TEST-58-REPART on ppc64el

2 years agotest: do not assume x86-64 arch in TEST-58-REPART 22100/head
Luca Boccassi [Wed, 12 Jan 2022 22:38:22 +0000 (22:38 +0000)] 
test: do not assume x86-64 arch in TEST-58-REPART

2 years agotest: add partition IDs for s390x and ppc64el to TEST-50-DISSECT
Luca Boccassi [Wed, 12 Jan 2022 22:38:04 +0000 (22:38 +0000)] 
test: add partition IDs for s390x and ppc64el to TEST-50-DISSECT

2 years agojournal: Skip data objects with invalid offsets
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)
```

2 years agoxdg-autostart-service: Ignore missing desktop-sepcific condition binary
Benjamin Berg [Mon, 10 Jan 2022 11:35:46 +0000 (12:35 +0100)] 
xdg-autostart-service: Ignore missing desktop-sepcific condition binary

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.

Fix this by simply returning zero.

2 years agoMerge pull request #22092 from keszybz/docs-links
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 15:06:39 +0000 (16:06 +0100)] 
Merge pull request #22092 from keszybz/docs-links

Add more doc pages, adjust links, add explanatory headers to examples and relax license to CC-0

2 years agodocs: promise stability for the journal json format too 22092/head
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 10:34:03 +0000 (11:34 +0100)] 
docs: promise stability for the journal json format too

2 years agoman+docs: adjust links to the new page
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 10:32:53 +0000 (11:32 +0100)] 
man+docs: adjust links to the new page

2 years agodocs: import the Journal JSON Format description as subsection
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 10:19:02 +0000 (11:19 +0100)] 
docs: import the Journal JSON Format description as subsection

I don't think we need a separate page for this, so both "export" formats share
a page.  We can just link to the approprate section when necessary.

2 years agodocs: import the Journal Export Format description from the wiki
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 10:12:30 +0000 (11:12 +0100)] 
docs: import the Journal Export Format description from the wiki

This is a straightforward import, only links are adjusted.

2 years agopolicy files: adjust landing page link
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:42:22 +0000 (10:42 +0100)] 
policy files: adjust landing page link

2 years agodocs: use https:// for fd.o links
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:39:00 +0000 (10:39 +0100)] 
docs: use https:// for fd.o links

2 years agoREADME: link to the new page
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:33:57 +0000 (10:33 +0100)] 
README: link to the new page

Lennart's blog is now mostly of historical interest, and the wiki
landing page has been replaced by systemd.io.

2 years agoNEWS: adjust links to moved pages
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:33:10 +0000 (10:33 +0100)] 
NEWS: adjust links to moved pages

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.

2 years agoshutdown: adjust log message
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 17:31:38 +0000 (18:31 +0100)] 
shutdown: adjust log message

Instead of saying "with options 'n/a'", let's just say "with options ''".
We really don't have any options.

2 years agonetwork: add example file that enables DHCP on ethernet links
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 17:04:02 +0000 (18:04 +0100)] 
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.

Closes #3998.

2 years agonetwork: license all config files as CC0
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 16:52:35 +0000 (17:52 +0100)] 
network: license all config files as CC0

Same justification as the previous commit.

$ 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.

2 years agoMerge pull request #22090 from mbiebl/units-oomd-alias
Luca Boccassi [Wed, 12 Jan 2022 15:03:00 +0000 (15:03 +0000)] 
Merge pull request #22090 from mbiebl/units-oomd-alias

units: don't install dbus-org.freedesktop.oom1.service alias

2 years agoMerge pull request #21728 from Werkov/bfq-io-weight
Yu Watanabe [Wed, 12 Jan 2022 13:22:43 +0000 (22:22 +0900)] 
Merge pull request #21728 from Werkov/bfq-io-weight

bfq.io.weight followups and cleanup

2 years agoMerge pull request #22037 from fbuihuu/watchdog-minor-improvements
Yu Watanabe [Wed, 12 Jan 2022 13:09:50 +0000 (22:09 +0900)] 
Merge pull request #22037 from fbuihuu/watchdog-minor-improvements

Watchdog minor improvements

2 years agoshutdown: release the watchdog finally
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

2 years agoMerge pull request #22043 from medhefgo/boot-bitlocker
Luca Boccassi [Wed, 12 Jan 2022 13:05:30 +0000 (13:05 +0000)] 
Merge pull request #22043 from medhefgo/boot-bitlocker

boot: Add BitLocker TPM key sealing workaround

2 years agoMerge pull request #22088 from medhefgo/meson
Yu Watanabe [Wed, 12 Jan 2022 13:01:27 +0000 (22:01 +0900)] 
Merge pull request #22088 from medhefgo/meson

meson: Small improvements

2 years agotest: enable systemd-oomd.service 22090/head
Michael Biebl [Wed, 12 Jan 2022 11:29:34 +0000 (12:29 +0100)] 
test: enable systemd-oomd.service

Enable the service to ensure dbus-org.freedesktop.oom1.service exists
and D-Bus activation works.

See #18469

2 years agonetwork: say that our example files are licensed as CC0
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 16:40:47 +0000 (17:40 +0100)] 
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.

2 years agounits: don't install dbus-org.freedesktop.oom1.service alias
Michael Biebl [Wed, 12 Jan 2022 07:16:45 +0000 (08:16 +0100)] 
units: don't install dbus-org.freedesktop.oom1.service alias

The systemd-oomd.service unit contains

[Install]
WantedBy=multi-user.target
Alias=dbus-org.freedesktop.oom1.service

which means the symlink is supposed to be created dynamically when the
service is enabled.

2 years agofix test-string-util failed when locale is not utf8
yangmingtai [Tue, 11 Jan 2022 12:22:11 +0000 (20:22 +0800)] 
fix test-string-util failed when locale is not utf8

2 years agonetwork: dhcp6: do not request address if UseAddress=no
Yu Watanabe [Tue, 11 Jan 2022 11:56:40 +0000 (20:56 +0900)] 
network: dhcp6: do not request address if UseAddress=no

Fixes #22068.

2 years agoMerge pull request #22086 from keszybz/nss-no-proc-cmdline
Luca Boccassi [Tue, 11 Jan 2022 15:29:24 +0000 (15:29 +0000)] 
Merge pull request #22086 from keszybz/nss-no-proc-cmdline

Avoid looking at /prcc/cmdline from nss modules

2 years agoMerge pull request #22082 from keszybz/no-update-if-nothing-to-update
Luca Boccassi [Tue, 11 Jan 2022 15:28:35 +0000 (15:28 +0000)] 
Merge pull request #22082 from keszybz/no-update-if-nothing-to-update

bootctl: skip update if sd-boot wasn't installed

2 years agomeson: Use echo to list files 22088/head
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).

2 years agomeson: Add check argument to remaining run_command() calls
Jan Janssen [Tue, 11 Jan 2022 09:56:22 +0000 (10:56 +0100)] 
meson: Add check argument to remaining run_command() calls

2 years agomeson: Use files() for fuzzers
Jan Janssen [Tue, 11 Jan 2022 09:47:01 +0000 (10:47 +0100)] 
meson: Use files() for fuzzers

Not having to provide the full path in the source tree is much
nicer and the produced lists can also be used anywhere in the source
tree.

2 years agomeson: Use files() for tests
Jan Janssen [Tue, 11 Jan 2022 09:21:23 +0000 (10:21 +0100)] 
meson: Use files() for tests

Not having to provide the full path in the source tree is much
nicer and the produced lists can also be used anywhere in the source
tree.

2 years agonss: only read logging config from environment variables 22086/head
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 12:36:39 +0000 (13:36 +0100)] 
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.

Fixes #22020.

2 years agonss: drop dummy setup_logging() helpers
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 12:23:27 +0000 (13:23 +0100)] 
nss: drop dummy setup_logging() helpers

log_parse_environment() stopped being a macro in 9fdee66f2d9.
As reported by @bauen1 in https://github.com/systemd/systemd/issues/22020,
the comment was out of date.

2 years agosd-bus/man: document EBUSY error in bus_message_read (#21954)
lincoln auster [Tue, 11 Jan 2022 10:47:31 +0000 (03:47 -0700)] 
sd-bus/man: document EBUSY error in bus_message_read (#21954)

* sd-bus/man: document EBUSY error in bus_message_read

The EBUSY error can be returned from sd_bus_exit_container(), and, if
that happens, it will be propogated upwards towards bus_message_read. In
terms of documentation, this means that bus_message_read's man page
can't just include the error text for sd_bus_message_read_basic, as
reading basic types exclusively doesn't have the potential for this
error.

sd_bus_message_read_basic's error documentation isn't incorrect when
applied to sd_bus_message_read, it's just incomplete.  While EBUSY is
documented in sd_bus_message_open_container.xml,
it's explanation is unique to the sd_bus_message_exit_container function
and makes for poor documentation of the general read API.

2 years agobootctl: do not update sd-boot if it wasn't installed in the first place 22082/head
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 09:56:50 +0000 (10:56 +0100)] 
bootctl: do not update sd-boot if it wasn't installed in the first place

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

2 years agobootctl: split out the check whether sd-boot is installed
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 09:49:37 +0000 (10:49 +0100)] 
bootctl: split out the check whether sd-boot is installed

2 years agoboot: Fix readdir_harder() on VirtualBox
Jan Janssen [Mon, 10 Jan 2022 10:16:26 +0000 (11:16 +0100)] 
boot: Fix readdir_harder() on VirtualBox

Fixes: #22073
2 years agoMerge pull request #22050 from wat-ze-hex/bpf-lsm-check-for-link-error-2022-01-07
Zbigniew Jędrzejewski-Szmek [Mon, 10 Jan 2022 20:38:56 +0000 (21:38 +0100)] 
Merge pull request #22050 from wat-ze-hex/bpf-lsm-check-for-link-error-2022-01-07

bpf: check if lsm link ptr is libbpf error

2 years agoboot: Change boot entry sorting
Jan Janssen [Tue, 4 Jan 2022 12:00:37 +0000 (13:00 +0100)] 
boot: Change boot entry sorting

There are a few undesirable properties to how boot entries are
currently sorted.

First, it sorts by entry file name only, which may not correspond
to the title that is shown (for exmaple because it is prefixed by
machine-id). The file ending will also create unexpected ordering
("arch-lts.conf" would come before "arch.conf").

While the list is sorted alphabetically ascending, it is also
lower version/priority first, which is unintuitive. In particular,
a boot-counted entry that is bad (0 tries left) will be at the very
top.

Additionally, the Windows and Mac loaders should be sorted with
the rest of the loaders.

2 years agocore/cgroup: Factor out BFQ weight setting 21728/head
Michal Koutný [Fri, 10 Dec 2021 17:40:35 +0000 (18:40 +0100)] 
core/cgroup: Factor out BFQ weight setting

No functional change.

2 years agocgroup-util: Move macros to macros and tests to tests
Michal Koutný [Fri, 10 Dec 2021 18:00:45 +0000 (19:00 +0100)] 
cgroup-util: Move macros to macros and tests to tests

Friends to friends to be consistent with the other macros and make tests
separate from main code.

2 years agocore/cgroup: Provide information about applied BFQ scaling
Michal Koutný [Fri, 10 Dec 2021 16:44:19 +0000 (17:44 +0100)] 
core/cgroup: Provide information about applied BFQ scaling

The BFQ weights are not passed verbatim to the kernel, provide that
information in a form of debug message so that users are not
surprised/confused when IOWeight != io.bfq.weight.

2 years agoMerge pull request #22071 from keszybz/xdg-autostart-logs
Luca Boccassi [Mon, 10 Jan 2022 16:55:14 +0000 (16:55 +0000)] 
Merge pull request #22071 from keszybz/xdg-autostart-logs

Improve logs in systemd-xdg-autostart-generator

2 years agoboot: Add BitLocker TPM key sealing workaround 22043/head
Jan Janssen [Fri, 7 Jan 2022 10:15:28 +0000 (11:15 +0100)] 
boot: Add BitLocker TPM key sealing workaround

Fixes: #21891
2 years agoMerge pull request #22070 from keszybz/rm-rf-wip
Luca Boccassi [Mon, 10 Jan 2022 15:35:42 +0000 (15:35 +0000)] 
Merge pull request #22070 from keszybz/rm-rf-wip

Simplify recursive removal code and replace stack recursion with a heap queue

2 years agoboot: Add TPM to status info
Jan Janssen [Fri, 7 Jan 2022 10:09:08 +0000 (11:09 +0100)] 
boot: Add TPM to status info

2 years agodocs: fix typo in key name and adjust grammar a bit 22071/head
Zbigniew Jędrzejewski-Szmek [Mon, 10 Jan 2022 11:07:20 +0000 (12:07 +0100)] 
docs: fix typo in key name and adjust grammar a bit

2 years agoxdg-autostart-generator: rework debug logging
Zbigniew Jędrzejewski-Szmek [Mon, 10 Jan 2022 11:06:38 +0000 (12:06 +0100)] 
xdg-autostart-generator: rework debug logging

The logs used the service name as the primary log key. But the service name
often needs to contain escape symbols, and the logs are rather hard to read
because of this. Thus the logs are changed to use the path to the source
desktop file. I think this is much more useful because the user will want to
look at the source file too and maybe change it if something goes wrong.

A bit more logging to show which directories we are looking at and why we
skip certain units is added too.

$ rm -rf /tmp/out && mkdir /tmp/out && SYSTEMD_LOG_LEVEL=debug SYSTEMD_LOG_TARGET=console build/systemd-xdg-autostart-generator /tmp/{out,out,out}
Scanning autostart directory "/home/zbyszek/.config/autostart"…
Scanning autostart directory "/etc/xdg/autostart"…
/etc/xdg/autostart/tracker-miner-rss-3.desktop: not generating unit, marked as skipped by generator.
/etc/xdg/autostart/gnome-initial-setup-first-login.desktop: ExecCondition executable gnome-systemd-autostart-condition not found, unit will not be started automatically: No such file or directory
/etc/xdg/autostart/geoclue-demo-agent.desktop: symlinking app-geoclue\x2ddemo\x2dagent@autostart.service in xdg-desktop-autostart.target/.wants…
SELinux enabled state cached to: disabled
Directory "/tmp" already exists, but has mode 0777 that is too permissive (0755 was requested), refusing.
/etc/xdg/autostart/polkit-mate-authentication-agent-1.desktop: symlinking app-polkit\x2dmate\x2dauthentication\x2dagent\x2d1@autostart.service in xdg-desktop-autostart.target/.wants…
/etc/xdg/autostart/mate-settings-daemon.desktop: symlinking app-mate\x2dsettings\x2ddaemon@autostart.service in xdg-desktop-autostart.target/.wants…
/etc/xdg/autostart/user-dirs-update-gtk.desktop: symlinking app-user\x2ddirs\x2dupdate\x2dgtk@autostart.service in xdg-desktop-autostart.target/.wants…
/etc/xdg/autostart/org.freedesktop.problems.applet.desktop: symlinking app-org.freedesktop.problems.applet@autostart.service in xdg-desktop-autostart.target/.wants…
/etc/xdg/autostart/org.gnome.SettingsDaemon.Datetime.desktop: not generating unit, startup phases are not supported.
/etc/xdg/autostart/org.gnome.SettingsDaemon.XSettings.desktop: not generating unit, startup phases are not supported.
/etc/xdg/autostart/org.gnome.SettingsDaemon.DiskUtilityNotify.desktop: symlinking app-org.gnome.SettingsDaemon.DiskUtilityNotify@autostart.service in xdg-desktop-autostart.target/.wants…
/etc/xdg/autostart/gnome-initial-setup-copy-worker.desktop: not generating unit, startup phases are not supported.
/etc/xdg/autostart/org.gnome.Evolution-alarm-notify.desktop: symlinking app-org.gnome.Evolution\x2dalarm\x2dnotify@autostart.service in xdg-desktop-autostart.target/.wants…
/etc/xdg/autostart/tracker-miner-fs-3.desktop: not generating unit, marked as skipped by generator.
/etc/xdg/autostart/orca-autostart.desktop: ExecCondition executable gnome-systemd-autostart-condition not found, unit will not be started automatically: No such file or directory
...

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=2038750.

The return value from xdg_autostart_service_generate_unit() is ignored by the
caller, so we can do a shortcut return without functional change. This is nicer
because we're now consistently always returning an error if something failed.

2 years agoMerge pull request #22019 from lnussel/shutdown
Zbigniew Jędrzejewski-Szmek [Mon, 10 Jan 2022 12:10:57 +0000 (13:10 +0100)] 
Merge pull request #22019 from lnussel/shutdown

shutdown command fixes

2 years agoxdg-autostart-generator: make parameter const
Zbigniew Jędrzejewski-Szmek [Mon, 10 Jan 2022 11:02:03 +0000 (12:02 +0100)] 
xdg-autostart-generator: make parameter const

2 years agomeson: no longer skip dependencies when fuzzers are built locally
Evgeny Vereshchagin [Sun, 9 Jan 2022 21:52:14 +0000 (21:52 +0000)] 
meson: no longer skip dependencies when fuzzers are built locally

to make it easier to fuzz code that uses external libraries like libelf/libdw.

The dependencies are skipped on OSS-Fuzz because they aren't available
at runtime if they aren't linked statically. This restriction can safely
be lifted when the fuzzers are built locally with all the dependencies
installed. As far as I know there is at least one fuzz target in the systemd
repository that can benefit from this: https://github.com/systemd/systemd/issues/11018

2 years agosystemctl: consistent output for scheduled shutdowns 22019/head
Ludwig Nussel [Wed, 5 Jan 2022 12:17:50 +0000 (13:17 +0100)] 
systemctl: consistent output for scheduled shutdowns

Use same terms when scheduling and showing sheduled shutdowns.

2 years agobpf: fix bpf_can_link_lsm_program condition 22050/head
Julia Kartseva [Mon, 10 Jan 2022 05:35:35 +0000 (21:35 -0800)] 
bpf: fix bpf_can_link_lsm_program condition

Since bpf_can_link_lsm_program return value is boolean, the expression
`r < 0` is always false.

2 years agobpf: adjust comment about not calling sym_bpf_link__destroy
Zbigniew Jędrzejewski-Szmek [Sun, 9 Jan 2022 18:53:22 +0000 (19:53 +0100)] 
bpf: adjust comment about not calling sym_bpf_link__destroy

2 years agobpf: check if lsm link ptr is libbpf error
Julia Kartseva [Fri, 7 Jan 2022 23:02:57 +0000 (15:02 -0800)] 
bpf: check if lsm link ptr is libbpf error

BPF_RAW_TRACEPOINT_OPEN is expected to work only on x86 and x86_64,
since BPF trampoline is implemented only on these architectures.

Attach probing by bpf_program__attach_lsm already happens in
`bpf_lsm_supported`. The resulting pointer can store libbpf error and
that is the case for unsupported architectures.
Add libbpf error check to `bpf_lsm_supported` so execution does not
reach the point where unit startup fails.

2 years agounits: start systemd-resolved in basic.target
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 16:23:37 +0000 (17:23 +0100)] 
units: start systemd-resolved in basic.target

In the olden days systemd-resolved used dbus and it didn't make sense to start
it before dbus which is started fairly late. But we have mostly ported resolved
over to varlink. The queries from nss-resolve are done using varlink, so name
resolution can work without dbus. resolvectl still uses dbus, so e.g. 'resolvectl
query' will not work, but by starting systemd-resolved earlier we're not making this
any worse.

If systemd-resolved is started after dbus, it registers the name and everything
is fine. If it is started before dbus, it'll watch for the dbus socket and
connect later. So it should be fine to start systemd-resolved earlier. (If dbus
is stopped and restarted, unfortunately systemd-resolved does not reconnect.
This seems to be a small bug: since our daemons know how to watch for
dbus.socket, they could restart the watch if they ever lose the connection. But
this scenario shouldn't happen in normal boot, and restarting dbus is not
supported anyway.)

Moving the start earlier the following advantages:
- name resolution becomes availabe earlier, in particular for synthesized
  hostnames even before the network is up.
- basic.target is part of initrd.target, so systemd-resolved will get started
  in the initrd if installed. This is required for nfs-root when the server is
  specified using a name (https://bugzilla.redhat.com/show_bug.cgi?id=2037311).

2 years agoboot-timestamps: Discard firmware init time when running in a VM
Jan Janssen [Sun, 9 Jan 2022 13:22:15 +0000 (14:22 +0100)] 
boot-timestamps: Discard firmware init time when running in a VM

Fixes: #22060
2 years agobpf: actually skip RestrictFileSystems= when not supported
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 18:24:49 +0000 (19:24 +0100)] 
bpf: actually skip RestrictFileSystems= when not supported

Units would fail to start, incl. systemd-journald.service and systemd-udevd.service.
Since unit->manager->restrict_fs will be set if and only if we can use it,
we can just check for that and remove the other checks.
Follow-up for 299d9417238e0727a48ebaabb5a9de0c908ec5c8.

2 years agotest: explicitly configure oomd stuff via dropins
Frantisek Sumsal [Thu, 6 Jan 2022 20:37:21 +0000 (21:37 +0100)] 
test: explicitly configure oomd stuff via dropins

so we don't get overridden by distro-shipped ones.

Fixes: #22030
2 years agotest: store empty files rather than symlinks for test-fstab-generator
Luca Boccassi [Sun, 9 Jan 2022 14:00:25 +0000 (14:00 +0000)] 
test: store empty files rather than symlinks for test-fstab-generator

Dangling symlinks get pruned when packaging up the installation
directory. Just store empty files instead, and compare the names
rather than the content for .requires/.wants - the filename is
what is important anyway, the content is ignored.

Fixes #22059

2 years agomeson: Use files() for source lists for boot and fundamental
Jan Janssen [Fri, 7 Jan 2022 20:55:50 +0000 (21:55 +0100)] 
meson: Use files() for source lists for boot and fundamental

This fixes build reproducibility as otherwise the full path
of the source files ends up in the output binary.

2 years agoMerge pull request #22028 from medhefgo/boot-cleanup
Luca Boccassi [Sun, 9 Jan 2022 15:44:55 +0000 (15:44 +0000)] 
Merge pull request #22028 from medhefgo/boot-cleanup

boot: Cleanup

2 years agocore: teach LoadCredential= to load from a directory
Albert Brox [Sat, 24 Jul 2021 16:38:22 +0000 (12:38 -0400)] 
core: teach LoadCredential= to load from a directory

2 years agoMerge pull request #22044 from keszybz/minor-man-page-adjustments
Luca Boccassi [Fri, 7 Jan 2022 22:14:30 +0000 (22:14 +0000)] 
Merge pull request #22044 from keszybz/minor-man-page-adjustments

Minor man page adjustments

2 years agoman: adjust chart in bootup(5) 22044/head
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 16:06:54 +0000 (17:06 +0100)] 
man: adjust chart in bootup(5)

The style used for that one branch was inconsistent with other branches.

2 years agoman: refer to os-release(5) for description of files in the same format
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 15:38:18 +0000 (16:38 +0100)] 
man: refer to os-release(5) for description of files in the same format

2 years agoman: add missing example title in systemd.network(5)
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 08:52:19 +0000 (09:52 +0100)] 
man: add missing example title in systemd.network(5)

Also rename the file to match the example being extended.

2 years agoseccomp: move arch_prctl to @default
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 14:23:55 +0000 (15:23 +0100)] 
seccomp: move arch_prctl to @default

It was reported as used by the linker:

> [It is] called in the setup of ld-linux-x86-64.so.2 from _dl_sysdep_start.
> My local call stack (with LTO):
>
> #0 init_cpu_features.constprop.0 (/usr/lib64/ld-linux-x86-64.so.2)
> #1 _dl_sysdep_start (/usr/lib64/ld-linux-x86-64.so.2)
> #2 _dl_start (/usr/lib64/ld-linux-x86-64.so.2)
> #3 _start (/usr/lib64/ld-linux-x86-64.so.2)
>
> Looking through the source, I think it's this (links for glibc 2.34):
> - First dl_platform_init calls _dl_x86_init_cpu_features, a wrapper for init_cpu_features.
> - Then init_cpu_features calls get_cet_status.
> - At last, get_cet_status invokes arch_prctl.

Fixes #22033.

2 years agoman: correct minor mistakes in systemd-creds
Morten Linderud [Fri, 7 Jan 2022 14:50:05 +0000 (15:50 +0100)] 
man: correct minor mistakes in systemd-creds

Signed-off-by: Morten Linderud <morten@linderud.pw>
2 years agoMerge pull request #22013 from yuwata/fstab-generator-skip-nfsroot
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 15:02:19 +0000 (16:02 +0100)] 
Merge pull request #22013 from yuwata/fstab-generator-skip-nfsroot

fstab-generator: skip root directory handling when nfsroot is requested

2 years agokernel-install: prefer /boot over /boot/efi for $BOOT_ROOT
Adam Williamson [Wed, 5 Jan 2022 22:07:14 +0000 (14:07 -0800)] 
kernel-install: prefer /boot over /boot/efi for $BOOT_ROOT

This restores the preference order from before 9e82a74. The code
previous to that change 'preferred' /boot over /boot/efi; that
commit changed it to check /boot/efi before checking /boot.
Changing this precedence could (and did, for me) have unexpected
effects - it seems safer to leave it how it was.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2 years agohomed: stop before stopping dbus
Markus Weippert [Tue, 4 Jan 2022 12:56:11 +0000 (13:56 +0100)] 
homed: stop before stopping dbus

Otherwise, systemd-homed-active.service will fail to deactivate all
homes because homectl can no longer talk to homed if dbus stops first.
As a result, /home cannot be umounted.

Doing this on systemd-homed-active.service instead works as well, but
systemd-homed will exit 1 if dbus is already shut down.

2 years agoMerge pull request #22006 from yuwata/on-ac-power
Zbigniew Jędrzejewski-Szmek [Fri, 7 Jan 2022 13:28:19 +0000 (14:28 +0100)] 
Merge pull request #22006 from yuwata/on-ac-power

udev-util: ignore USB-C ports in power source mode

2 years agopid1: voidify manager_override_watchdog() 22037/head
Yu Watanabe [Thu, 6 Jan 2022 12:21:41 +0000 (21:21 +0900)] 
pid1: voidify manager_override_watchdog()

As it always returns 0.

2 years agowatchdog: rebreak comments
Yu Watanabe [Thu, 6 Jan 2022 12:11:21 +0000 (21:11 +0900)] 
watchdog: rebreak comments

2 years agowatchdog: shorten watchdog_set_device()
Franck Bui [Fri, 7 Jan 2022 08:28:44 +0000 (09:28 +0100)] 
watchdog: shorten watchdog_set_device()

2 years agobpf: do not freeze if bpf lsm fails to set up
Julia Kartseva [Thu, 6 Jan 2022 00:34:56 +0000 (16:34 -0800)] 
bpf: do not freeze if bpf lsm fails to set up

BPF LSM is cgroup unaware and it's set up is happening in core manager.
It occures that the current implementation is too restrictive and causes
pid 1 to freeze.
Instead:
* in bpf_lsm_setup set manager->restrict_fs pointer last,
so it is an indicator that the set up was successful
* check for manager->restrict_fs before applying unit options

2 years agoMerge pull request #22031 from floppym/issue22001-1
Yu Watanabe [Fri, 7 Jan 2022 03:28:47 +0000 (12:28 +0900)] 
Merge pull request #22031 from floppym/issue22001-1

test-watchdog adjustments

2 years agotest-watchdog: set timeout to 2 seconds by default 22031/head
Mike Gilbert [Thu, 6 Jan 2022 19:12:33 +0000 (14:12 -0500)] 
test-watchdog: set timeout to 2 seconds by default

Some hardware/drivers do not handle a 1 second timeout properly.

Fixes: https://github.com/systemd/systemd/issues/22001
2 years agotest-watchdog: use watchdog_runtime_wait() to determine sleep interval
Mike Gilbert [Thu, 6 Jan 2022 19:09:30 +0000 (14:09 -0500)] 
test-watchdog: use watchdog_runtime_wait() to determine sleep interval

As sugggested in
https://github.com/systemd/systemd/issues/22001#issuecomment-1006755438.

2 years agouserdbctl: fix "Password OK" shown even when password is empty or locked (#21308)
Pigmy-penguin [Thu, 6 Jan 2022 16:01:38 +0000 (17:01 +0100)] 
userdbctl: fix "Password OK" shown even when password is empty or locked (#21308)

userdbctl: fix "Password OK" shown even when password is empty or locked

2 years agotest: add test cases for fstab-generator 22013/head
Yu Watanabe [Thu, 6 Jan 2022 11:12:27 +0000 (20:12 +0900)] 
test: add test cases for fstab-generator

2 years agotree-wide: fix typo
Yu Watanabe [Thu, 6 Jan 2022 13:20:11 +0000 (22:20 +0900)] 
tree-wide: fix typo

2 years agoNEWS: sort entries
Yu Watanabe [Thu, 6 Jan 2022 13:18:05 +0000 (22:18 +0900)] 
NEWS: sort entries

2 years agoboot: Simplify line_edit 22028/head
Jan Janssen [Wed, 5 Jan 2022 09:59:36 +0000 (10:59 +0100)] 
boot: Simplify line_edit

2 years agoboot: Switch to insertion sort
Jan Janssen [Wed, 5 Jan 2022 09:33:00 +0000 (10:33 +0100)] 
boot: Switch to insertion sort

We can do a little better than bubble sort without ramping up the
code complexity.

2 years agoboot: Do more config handling in config_load_all_entries
Jan Janssen [Tue, 4 Jan 2022 12:12:21 +0000 (13:12 +0100)] 
boot: Do more config handling in config_load_all_entries

2 years agoboot: Remove no_autoselect
Jan Janssen [Tue, 4 Jan 2022 09:12:39 +0000 (10:12 +0100)] 
boot: Remove no_autoselect

2 years agoboot: Close xbootldr root_dir
Jan Janssen [Tue, 4 Jan 2022 09:06:37 +0000 (10:06 +0100)] 
boot: Close xbootldr root_dir

2 years agoboot: Simplify config_entry_add_osx
Jan Janssen [Tue, 4 Jan 2022 09:02:24 +0000 (10:02 +0100)] 
boot: Simplify config_entry_add_osx

2 years agomeson: install test-network-generator-conversion.sh even if networkd is not enabled
Yu Watanabe [Thu, 6 Jan 2022 10:04:54 +0000 (19:04 +0900)] 
meson: install test-network-generator-conversion.sh even if networkd is not enabled

Follow-up for 987dd89c775815831ae21736fe60aef59cb7a6fa.

2 years agofstab-generator: also skip other network filesystems and live image
Yu Watanabe [Wed, 5 Jan 2022 13:06:03 +0000 (22:06 +0900)] 
fstab-generator: also skip other network filesystems and live image

2 years agofstab-generator: skip root directory handling when nfsroot is requested
Yu Watanabe [Wed, 5 Jan 2022 10:24:46 +0000 (19:24 +0900)] 
fstab-generator: skip root directory handling when nfsroot is requested

Fixes RHBZ#2037233 (https://bugzilla.redhat.com/show_bug.cgi?id=2037233).