1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00
Commit Graph

63625 Commits

Author SHA1 Message Date
Lennart Poettering
6b868766eb
Merge pull request #27044 from bluca/sysext_recursive_dir
Ensure sysexts do not contain an os-release file, do not load sysexts from /usr[/local]/lib/extensions/
2023-04-03 12:38:48 +02:00
Zbigniew Jędrzejewski-Szmek
a78413baae user-sessions: do not remove /etc/nologin
pam_nologin looks for /etc/nologin and /run/nologin.
user-sessions creates (and removes) /run/nologin, but also removes
/etc/nologin. (This behaviour is unchanged since the introduction
of the binary in e92787416c691c3f34f47349e5eae3fa68eae856.)

By not removing pam_nologin we fully drop compatibility with PAM < 1.1.
This has the advantage that now /etc/nologin can be used by administrator to
disable user logins, e.g. for extended maintanance. We already specified
PAM >= 1.1.2 as dependency, so this was already covered.

The makes the code match the man page.

Fixes #26965.
2023-04-03 12:32:56 +02:00
dmkUK
dc2b3f9469
update 60-sensor.hwdb with toshiba tablet (#27103)
* update 60-sensor.hwdb with toshiba tablet

udevadm output after new matrix added

E: MODALIAS=dmi:bvnTOSHIBA:bvr2.00:bd01/09/2015:br2.0:efr19.0:svnTOSHIBA:pnTOSHIBAWT10-A-102:pvrPDW0BE-00800TEN:rvnType2-BoardManufacturer:rnType2-BoardProductName:rvrType2-BoardVersion:cvnChassisManufacturer:ct10:cvrChassisVersion:

P: /devices/platform/80860F41:02/i2c-2/i2c-13/13-000c
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-13/13-000c
E: SUBSYSTEM=i2c
E: MODALIAS=i2c:INVN6500-client

P: /devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00
E: SUBSYSTEM=i2c
E: DRIVER=inv-mpu6050-i2c
E: MODALIAS=acpi:INVN6500:
E: USEC_INITIALIZED=8659532
E: ID_VENDOR_FROM_DATABASE=Inviso, Inc.

P: /devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/iio:device0
N: iio:device0
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/iio:device0
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=246
E: MINOR=0
E: USEC_INITIALIZED=9662385
E: ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

P: /devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/trigger0
L: 0
E: DEVPATH=/devices/platform/80860F41:02/i2c-2/i2c-INVN6500:00/trigger0
E: SUBSYSTEM=iio

The orientation is the same as the WT10-A-103 already listed in 60.sensor.hwdb but not picked up by that rule.
2023-04-03 00:09:11 +01:00
Mike Yuan
4f44d2c4f7 core: do early setup check for arguments with '=' too
Follow-up for d2ebd50d7f

We now modify our cmdline to use '=' for all arguments,
but didn't change early setup check to work with that.
So every daemon-reexec does a full setup, thus breaking
running user sessions.

Fixes #27106
2023-04-02 16:22:52 +01:00
taniishkaaa
6cc19afac1
Added unit test for strv_env_name_is_valid() function listed in env-util.c (#27100)
tests: add test for strv_env_name_is_valid function listed in env-util.c
2023-04-02 14:27:29 +01:00
Luca Boccassi
8014efda19
Merge pull request #27096 from YHNdnzj/networkctl-modernize
networkctl: modernize
2023-04-02 14:23:59 +01:00
Mike Yuan
3508b1ba2b
Merge pull request #27086 from keszybz/oomd-on-v1
Do not pull in systemd-oomd on v1 to avoid repeated message in logs
2023-04-02 16:21:53 +08:00
Andrei Stepanov
7f1d261f07 po: Translated using Weblate (Russian)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Andrei Stepanov <adem4ik@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ru/
Translation: systemd/main
2023-04-02 16:25:12 +09:00
dependabot[bot]
ca0a1a3107 build(deps): bump github/codeql-action from 2.2.5 to 2.2.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.5 to 2.2.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](32dc499307...04df1262e6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 19:11:42 +02:00
Frantisek Sumsal
2e4f69946c
Merge pull request #27087 from mrc0mmand/missing-coverage
test: set ReadWritePaths= for test-.services when built w/ coverage
2023-04-01 18:59:42 +02:00
Yu Watanabe
efebf6ba3a
Merge pull request #27067 from DaanDeMeyer/find-esp-at
find-esp: Add openat() like helpers that operate on fds
2023-04-02 01:19:57 +09:00
dependabot[bot]
6e57813113 build(deps): bump ossf/scorecard-action from 2.1.2 to 2.1.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](e38b1902ae...80e868c13c)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 18:08:20 +02:00
dependabot[bot]
ca8444d471 build(deps): bump actions/labeler from 4.0.2 to 4.0.3
Bumps [actions/labeler](https://github.com/actions/labeler) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](5c7539237e...ba790c862c)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 18:07:58 +02:00
dependabot[bot]
4a0c9b60b2 build(deps): bump github/super-linter from 4.9.7 to 4.10.1
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.9.7 to 4.10.1.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](bb2d833b08...454ba4482c)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 18:07:43 +02:00
Zbigniew Jędrzejewski-Szmek
c32f496b9e man: restore description of ConditionControlGroupController=v1|v2
We use ConditionControlGroupController=v2 in systemd-oomd.service, and also
this condition makes sense in general, so it should be documented.

This reverts a part of 6d48c7cf73.

Deprecated commandline options and v1 controller names were removed from
the description.
2023-04-01 16:37:23 +02:00
Mike Yuan
5a0c810462
networkctl: use sd_bus_get_property 2023-04-01 21:51:07 +08:00
Mike Yuan
61c84edff8
networkctl: style improvements 2023-04-01 21:51:07 +08:00
Mike Yuan
7db07767d5
networkctl: use FOREACH_ARRAY more 2023-04-01 20:47:49 +08:00
Daan De Meyer
407566527d
Merge pull request #25836 from DaanDeMeyer/reset
firstboot: Add --reset option
2023-04-01 14:33:23 +02:00
Jan Janssen
7f72dca762 ukify: Strip symbol/string table for old stubs 2023-04-01 14:31:22 +02:00
Daan De Meyer
63105f33ed find-esp: Add openat() like helpers that operate on fds
We also rework the internals of find-esp to work on directory file
descriptors instead of absolute paths and do a lot of general cleanups.

By passing the parent directory file descriptor to verify_fsroot_dir()
along with the name of the directory we're operating on, we can get rid
of the fallback that goes via path to open the parent directory if '..'
fails due to permission errors.
2023-04-01 14:29:29 +02:00
Daan De Meyer
6eec59f9cc stat-util: Add xstatfsat() 2023-04-01 14:25:30 +02:00
Daan De Meyer
05c423adc9 find-esp: Drop explicit automount trigger
We call statx_fallback() which calls either statx() or fstatat(),
both of which automount by default, so we don't need the explicit
trigger.
2023-04-01 14:25:30 +02:00
Daan De Meyer
c706b27f40 btrfs-util: Add btrfs_get_block_device_at()
Let's make btrfs_get_block_device_fd() more generic by renaming it
to btrfs_get_block_device_at() so it can operate on only paths, dir_fd
and path, or only on fd by using xopenat().
2023-04-01 14:25:30 +02:00
Mike Yuan
445f0d8b47
networkctl: acquire bus only when necessary 2023-04-01 19:56:26 +08:00
Frantisek Sumsal
9fd8226312 test: shed some light into the whole coverage situation 2023-04-01 12:15:42 +02:00
Daan De Meyer
05eb2c60bd firstboot: Add --reset option
This can be used to prepare an image for firstboot by removing all
files that systemd knows about that contain machine specific
information.
2023-04-01 10:50:15 +02:00
Daan De Meyer
b39710cccf firstboot: Do not dereference symlinks
Let's always operate on paths without resolving the final component.
If the path is a symlink, it could point to a vendor default in /usr,
in which case we definitely do not want to modify the vendor defaults.
To avoid this from happening, we replace the symlink with our own file
instead of modifying the file the symlink points at.
2023-04-01 10:46:42 +02:00
Дамјан Георгиевски
86c20937c2 add a github workflow action to make a release from tags
make a github release for every tag that starts with `v*`,
and a pre-release if the tag contains "-rc".

on the 'systemd/systemd' repo, the "Release" will be draft, so that the
release manager can fill up the notes manually.

on 'systemd/systemd-stable' the release will be created immediately.

info about the action used:
https://github.com/softprops/action-gh-release
2023-04-01 00:44:50 +01:00
Daan De Meyer
02c914efe6 Trim TODO a bit
Let's drop stuff that's already implemented.
2023-03-31 19:24:19 +01:00
Dmitry V. Levin
e873a9f18a treewide: fix unnecessary $ on arithmetic variables
This should fix shellcheck warning SC2004.
2023-04-01 01:48:44 +08:00
Frantisek Sumsal
e660c590a5 test: set ReadWritePaths= for test-.services when built w/ coverage
Let's make the dropin, to make the build dir writable for gcov, a bit
more generic, so it can be used by all units starting with prefix test-.
This should help with a bunch of recent reports about missing coverage I
got, as well as with existing test units using DynamicUser=true.

This might feel a bit like a magic trick from behind the curtains, but I
want to touch the actual tests as little as possible, since it makes them
unnecessarily messy (see the various workarounds for sanitizers), and
the coverage reports are generated only in a specific CI job anyway.
2023-03-31 19:23:31 +02:00
Zbigniew Jędrzejewski-Szmek
2a4efebb3b core: skip deps on oomd if v2 or memory unavailable
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2055664
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2172146

User report that systemd repeatedly logs about not being able to start oomd
when booted with v1:

Feb 20 16:52:33   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).
Feb 20 16:52:34   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).
Feb 20 16:52:34   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).
Feb 20 16:52:34   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).
Feb 20 16:52:34   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).
Feb 20 16:52:34   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).
Feb 20 16:52:34   systemd[2067491]: Queued start job for default target default.target.
Feb 20 16:52:34   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).
Feb 20 16:52:34   systemd[2067491]: Created slice app.slice - User Application Slice.
Feb 20 16:52:34   systemd[1]: systemd-oomd.service - Userspace Out-Of-Memory (OOM) Killer was skipped because of a failed condition check (ConditionControlGroupController=v2).

systemd-oomd.service that pulls systemd-oomd.socket in (because it requires
it); systemd-oomd.service itself is pulled by user@.service because
systemd-oomd package installs an override config file that sets
ManagedOOMMemoryPressure=kill.

Add a check to the code that adds the implicit dependency to skip the
dep if we cannot start it. The check is done exactly the same as in oomd
itself.
2023-03-31 18:53:36 +02:00
OMOJOLA JOSHUA DAMILOLA
27d45db38c test: fixed negative checks in TEST-70-TPM2.
Use in-line error handling rather than redirections. Follow up on #27020
2023-03-31 17:50:59 +01:00
Thomas Blume
c7bf1959d7 test: use setpriv instead of su for user switch from root
systemd-repart needs to find mkfs.ext4 for the test.
This is located in the directory /usr/sbin on openSUSE Tumbleweed.
But since the variable ALWAYS_SET_PATH in /etc/login.defs is set to yes,
su re-initializes the $PATH variable and removes /usr/sbin.
Hence, mkfs.ext4 is not found and the test fails.
Using setpriv instead of su fixes this issue and is more appropriate to
do the switch user task from root.

[zjs: move setpriv to $BASICTOOLS and force-push to retrigger CI]
2023-03-31 22:26:44 +08:00
Lennart Poettering
6f1fe575f0 TODO: drop items regarding swap-for-hibernate-only-use
I doubt we should bother. Swap always makes sense, and having a swap
partition for hibernate only without using it all the time just makes
the system worse overall.
2023-03-31 12:21:35 +02:00
Ludwig Nussel
6fb595bc2f docs: fix coredump legacy example 2023-03-31 11:47:17 +02:00
Daan De Meyer
84d421d4fe
Merge pull request #27080 from yuwata/rm-rf
rm-rf: also chmod() directory if it cannot be opened
2023-03-31 09:59:06 +02:00
Yu Watanabe
5b6f203c95 Revert "Revert "test: add more testcases for rm_rf()""
This reverts commit 8c81a61810.
2023-03-31 11:54:23 +09:00
Yu Watanabe
7be9657706 rm-rf: also chmod() directory if it cannot be opened
Otherwise, directory with zero access mode cannot be removed.

This is a revised version of 808c8b25ee,
- dropped O_NOFOLLOW from fd_reopen()
- fixed error handling on opening path in rm_rf().
2023-03-31 11:52:03 +09:00
Mike Yuan
5171356eee core: always calculate the next restart interval
Follow-up for #26902 and #26971

Let's always calculate the next restart interval
since that's more useful.

For that, we add 1 to s->n_restarts unconditionally,
and change RestartUSecCurrent property to RestartUSecNext.
2023-03-31 01:22:58 +01:00
Luca Boccassi
ed2a4e8d78
Merge pull request #27075 from mrc0mmand/test-tweaks
test: a couple of coverage-related test tweaks
2023-03-31 01:18:15 +01:00
Zbigniew Jędrzejewski-Szmek
9b9f6aa412 bootctl: clean up handling of files with no version information
get_file_version() would return:
- various negative errors if the file could not be accessed or if it was not a
  regular file
- 0/NULL if the file was too small
- -ESRCH or -EINVAL if the file did not contain the marker
- -ENOMEM or permissions errors
-  1 if the marker was found

bootctl status iterates over /EFI/{systemd,BOOT}/*.efi and checks if the files
contain a systemd-boot version tag. Resource or permission errors should be
fatal, but lack of version information should be silently ignored.

OTOH, when updating or installing bootloader files, the version is expected
to be present.

get_file_version() is changed to return -ESRCH if the version is unavailable,
and other errnos for permission or resource errors.

The logging is reworked to always display an error if encountered, but also
to log the status at debug level what the result of the version inquiry is.
This makes it figure out what is going on:
  /efi/EFI/systemd/systemd-bootx64.efi: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38"
  /efi/EFI/BOOT/BOOTfbx64.efi: EFI binary has no LoaderInfo marker.
  /efi/EFI/BOOT/BOOTIA32.EFI: EFI binary has no LoaderInfo marker.
  /efi/EFI/BOOT/BOOTX64.EFI: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38"

Replaces #27034.
Fixes https://github.com/NixOS/nixpkgs/issues/223579.
2023-03-30 20:52:05 +01:00
Luca Boccassi
9a39283e02
Merge pull request #27072 from bluca/man_example
man: further shorten print-unit-path example
2023-03-30 19:56:14 +01:00
Frantisek Sumsal
1d6052ba5c test: make make_addresses() actually return the addresses
I noticed missing coverage in the reports and turns out this has been
broken since forever (i.e. 2016 - 9f7672b3bc), whoopsie.
2023-03-30 20:42:47 +02:00
Frantisek Sumsal
4388541237 coverage: add a wrapper for execveat()
gcov provides wrappers for the exec*() calls but there's none for execveat(),
which means we lose all coverage prior to the call. To mitigate this, let's
add a simple execveat() wrapper in gcov's style[0], which dumps and resets
the coverage data when needed.

This applies only when we're built with -Dfexecve=true.

[0] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgcc/libgcov-interface.c;h=b2ee930864183b78c8826255183ca86e15e21ded;hb=HEAD
2023-03-30 20:42:47 +02:00
Luca Boccassi
ce199d12e9 man: add example for sd_bus_call_method 2023-03-30 18:55:55 +01:00
Luca Boccassi
d10a5f6c3d man: further shorten print-unit-path example 2023-03-30 18:29:49 +01:00
Lennart Poettering
bba6046b24 man: link up new online coredump docs from man page 2023-03-31 01:15:24 +08:00
Luca Boccassi
fec36c3ba7
Merge pull request #27074 from bluca/revert_rm
Revert rm-rf changes that are causing test failures
2023-03-30 18:07:27 +01:00