1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00
Commit Graph

75496 Commits

Author SHA1 Message Date
Yu Watanabe
98ca8eac11 udev: manage only socket address of device monitor
Previously, the main process of systemd-udevd manages worker process
with their sd_device_monitor object to save the destination address.
Let's save only destination address, and drop worker's sd_device_monitor
object.
2024-08-02 11:16:33 +09:00
Yu Watanabe
7abc0201d0 sd-device-monitor: introduce device_monitor_get_address()
Currently it is used internally, but will be used later at other places.
2024-08-02 11:16:33 +09:00
Yu Watanabe
1f267e77ed sd-device: allow to restart device monitor
Previously, sd_device_monitor_stop() closes socket, hence we cannot
restart monitoring unless recreating sd_device_monitor object.
Let's allow to restart monitor by sd_device_monitor_start().
2024-08-02 11:16:33 +09:00
Yu Watanabe
ece1e280ee sd-device-monitor: introduce sd_device_monitor_is_running() 2024-08-02 11:16:33 +09:00
Yu Watanabe
f49faf0562 sd-device-monitor: bind socket in device_monitor_new_full()
Previously, device_monitor_enable_receiving() does
- update filter,
- bind socket.

But, binding socket can be done in when the socket is opened.
Let's remove device_monitor_enable_receiving() and bind the socket in
device_monitor_new_full().
2024-08-02 11:16:33 +09:00
Yu Watanabe
bf1283c1fb sd-device-monitor: replace -1 with -EBADF 2024-08-02 11:16:33 +09:00
Yu Watanabe
0403221a2a test: modernize test-sd-device-monitor.c 2024-08-02 11:16:33 +09:00
Yu Watanabe
029709f932 socket-util: introduce netlink_socket_get_multicast_groups()
No functional change. Preparation for later commits.
2024-08-02 11:16:33 +09:00
Luca Boccassi
b51b12af8d
Merge pull request #33904 from bluca/os_release_type
os-release: change RELEASE_TYPE value from 'pre-release' to 'development' and break into paragraphs
2024-08-01 23:29:37 +02:00
Luca Boccassi
3d689b675b os-release: break RELEASE_TYPE into paragraphs and clarify about rolling stable releases
Arch and Tumbleweed do not do EOLs but are still stable, so clarify the paragraph.
Also break the entry in paragraphs, to make it more readable when rendered.
2024-08-01 20:59:20 +01:00
Luca Boccassi
67f90b0d85 os-release: change RELEASE_TYPE value from 'pre-release' to 'development'
The point was made on https://lists.debian.org/debian-ctte/2024/08/msg00005.html
that 'pre-release sounds' like an RC candidate, ie, something that will change
very slightly in the released version. But this is not necessarily the case
for example at the beginnig of a Fedora Rawhide or Debian Testing release cycle,
so change it to a more generic 'development'

Follow-up for 7102dc52e6
2024-08-01 20:36:02 +01:00
Luca Boccassi
62bfb79b61
Merge pull request #33893 from yuwata/coverity
tree-wide: resolve several issues found by coverity
2024-08-01 20:33:53 +02:00
Luca Boccassi
98c2cb186b
Merge pull request #32988 from AdrianVovk/os-release-prerelease
os-release: Add RELEASE_TYPE=
2024-08-01 18:56:15 +02:00
Adrian Vovk
d25a9bfa8f os-release: Introduce experiment RELEASE_TYPE
This is for experimental builds of the OS made to test some specific WIP
feature.

For example, let's say the distro in question is Asahi Linux and Apple
just released the M3 SoC. The Asahi developers will start porting to the
M3, and will quickly generate builds of Asahi Linux that can technically
boot but aren't ready for any kind of daily use. These images are marked
as experimental, and can be shared among the developers. If a user
somehow stumbles upon one of these images and tries to install it,
they'll be warned that they're about to install an experimental Apple M3
port of Asahi Linux. Eventually, once the Asahi developers think that
their M3 port is ready for a wider audience, they can merge it into the
mainline Asahi repos, where it will be distributed through the usual
nightly CI builds (where RELEASE_TYPE=pre-release; M3 support is no
longer experimental).
2024-08-01 17:22:23 +01:00
Adrian Vovk
7102dc52e6 os-release: Add RELEASE_TYPE=
This will allow GUIs to customize their behavior a little based on the
type of release.

For example, an OS installer may display a warning/disclaimer if
RELEASE_TYPE=prerelease. The software updates app might be a bit more
insistent about upgrading to the next major release if
RELEASE_TYPE=stable than if RELEASE_TYPE=lts
2024-08-01 17:22:13 +01:00
Yu Watanabe
f7012a93a7 import: check overflow
Fixes CID#1548022 and CID#1548075.
2024-08-01 22:45:53 +09:00
Yu Watanabe
fea2f92d8d test: use ASSERT_OK_ERRNO() for setenv() and unsetenv() 2024-08-01 22:42:08 +09:00
Yu Watanabe
6141fe925a test: resolve "Unchecked return value" coverity warning
Follow-up for c8210d98a4.
Fixes CID#1548920.
2024-08-01 22:42:08 +09:00
Yu Watanabe
a30ac8d52c vmspawn: check overflow earlier
Follow-up for 862c68a914.
Fixes CID#1550749.
2024-08-01 22:42:08 +09:00
Yu Watanabe
96bf7e1f3b test: resolve "Unchecked return value" coverity warning
Follow-up for 5fef5552a6.
Fixes CID#1558540.
2024-08-01 22:42:08 +09:00
Yu Watanabe
dc7607f687 test: resolve "Unchecked return value" coverity warning
Follow-up for 8c57700b6b.
Fixes CID#1558539.
2024-08-01 22:42:08 +09:00
Frantisek Sumsal
ce2344bbee test: attempt to install sshd-session from multiple places
On Fedora the sshd-session binary is under /usr/libexec/openssh/ so
cover this path as well in the old framework.

Follow-up for aaa7b36bd1.
2024-08-01 15:02:34 +02:00
dependabot[bot]
89322b8c09 build(deps): bump github/codeql-action from 3.25.11 to 3.25.15
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b611370bb5...afb54ba388)

---
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>
2024-08-01 13:36:40 +02:00
dependabot[bot]
73eb21703e build(deps): bump meson from 1.4.1 to 1.5.1 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.4.1 to 1.5.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.4.1...1.5.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:34:28 +02:00
dependabot[bot]
5186b40c6f build(deps): bump systemd/mkosi
Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from 4eba736412c702bbbe2c6d4a58a92fa977219249 to 63fc1fde5b1aac1abf07ac499068c2b62263dafb.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](4eba736412...63fc1fde5b)

---
updated-dependencies:
- dependency-name: systemd/mkosi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:34:09 +02:00
dependabot[bot]
1d8de1d5ac build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](60c9f2b924...cc6721c45a)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:09:16 +02:00
dependabot[bot]
e2dca8d9c0 build(deps): bump ossf/scorecard-action from 2.3.3 to 2.4.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](dc50aa9510...62b2cac7ed)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:08:42 +02:00
Yu Watanabe
a8bc75089d journalctl: fix compile error on i386
Fixes the following error:
===
In file included from ../src/basic/macro.h:13,
                 from ../src/basic/dirent-util.h:8,
                 from ../src/journal/journalctl-misc.c:3:
../src/journal/journalctl-misc.c: In function 'show_log_ids':
../src/journal/journalctl-misc.c:107:22: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  107 |         assert(n_ids < INT64_MAX);
      |                      ^
../src/fundamental/macro-fundamental.h:70:44: note: in definition of macro '_unlikely_'
   70 | #define _unlikely_(x) (__builtin_expect(!!(x), 0))
      |                                            ^
../src/basic/macro.h:165:22: note: in expansion of macro 'assert_message_se'
  165 | #define assert(expr) assert_message_se(expr, #expr)
      |                      ^~~~~~~~~~~~~~~~~
../src/journal/journalctl-misc.c:107:9: note: in expansion of macro 'assert'
  107 |         assert(n_ids < INT64_MAX);
      |         ^~~~~~
cc1: all warnings being treated as errors
===

Follow-up for 0a8c1f6212.
2024-08-01 10:49:40 +02:00
Yu Watanabe
12a12c5af5
Merge pull request #33888 from YHNdnzj/followups
core: a few follow-ups for recent PRs
2024-08-01 11:35:13 +09:00
Yu Watanabe
89cf6f0b0a
Merge pull request #32448 from yuwata/journalctl-current-invocation
journalctl: introduce --list-invocations, -I, --invocation= options
2024-08-01 11:33:20 +09:00
Yu Watanabe
b1b30d0226 test: add test for journalctl --list-invocations and --invocation= 2024-08-01 07:31:44 +09:00
Yu Watanabe
7d3ae6b213 journalctl: add --list-invocations command and -I/--invocation options
The --list-invocations command is similar to --list-boots, but shows
invocation IDs of specified unit. This should be useful when showing
a specific invocation of a unit.

The --invocation option is similar to --boot, but takes a invocation ID
or an offset. The -I option is equivalent to --invocation=0.
2024-08-01 07:31:44 +09:00
Yu Watanabe
82721be7d6 logs-show: extend journal_get_boots() and friends to find invocation IDs
Currently the extended features are not used, but will be used later.
2024-08-01 07:31:44 +09:00
Yu Watanabe
1a997cb732 logs-show: introduce several helper functions
Currently these are not used, but will be used later.
2024-08-01 07:31:44 +09:00
Yu Watanabe
0a8c1f6212 use int64_t for index in show_log_ids() 2024-08-01 07:31:44 +09:00
Yu Watanabe
b3a16f3985 journalctl: split out show_log_ids() from action_list_boots()
No functional change, just refactoring and prepraration for later change.
2024-08-01 07:31:44 +09:00
Yu Watanabe
a581a2ce8d journalctl: update log messages 2024-08-01 07:31:44 +09:00
Yu Watanabe
6ecee6cf2b logs-show: rename BootId -> LogId
The struct itself is generic, and can be used for other ID.
Let's rename it to more generic one.
No functional change, just refactoring and preparation for later
commits.
2024-08-01 07:31:44 +09:00
Mike Yuan
4c523d62d2
core/socket: stop hardcoding every service inactive state
History (c068650fcf,
941a12dcba) has proven
that we're not good at keeping socket and service states
in sync. Instead, let's query the high-level unit_active_state()
first, and only hardcode the two special auto-restart
service states.

Additionally, allow returning to listening state on SERVICE_CLEANING.
2024-07-31 21:56:28 +02:00
Mike Yuan
067c91fcb8
core/cgroup: use UNIT_IS_INACTIVE_OR_FAILED where appropriate 2024-07-31 21:40:28 +02:00
Mike Yuan
8574b7940b
core/unit: merge use of LOG_CONTEXT_SET_LOG_LEVEL into LOG_CONTEXT_PUSH_UNIT
No functional change, since LOG_CONTEXT_PUSH_UNIT is only used
in exec_spawn().
2024-07-31 21:40:28 +02:00
Mike Yuan
c4c416b109
core: clean up ambient capability logging
Follow-up for e0ebc81b2d
2024-07-31 21:40:28 +02:00
Daan De Meyer
3a5d72d8a3
Merge pull request #33886 from DaanDeMeyer/autologin
Two mkosi improvements
2024-07-31 20:21:12 +02:00
Daan De Meyer
ff5662129a
Merge pull request #33885 from DaanDeMeyer/pidref-kthread
Two pidfd fixes
2024-07-31 19:07:35 +02:00
Daan De Meyer
3fe25d4530 mkosi: Beef up testuser a bit
Give it a password and add it to some common groups.
2024-07-31 18:32:53 +02:00
Daan De Meyer
b3db96f230 mkosi: Switch to autologin via credentials
Let's use the newly added credentials to only enable autologin for
/dev/console (systemd-nspawn) and /dev/hvc0 (qemu) instead of enabling
autologin for every tty.
2024-07-31 17:38:12 +02:00
Daan De Meyer
e54a8e0fc3
Merge pull request #33873 from DaanDeMeyer/rename-creds
core: Add support for renaming credentials with ImportCredential=
2024-07-31 17:35:58 +02:00
Michal Sekletar
941a12dcba socket: fix socket activation of stopped services with pinned FD store 2024-07-31 16:29:07 +02:00
Luca Boccassi
0e5c97ae6f
Merge pull request #32937 from steelman/github/drop-ambient-caps-executor
core: drop ambient capabilities in systemd-executor
2024-07-31 16:11:30 +02:00
Daan De Meyer
e97429902d units: Import tty specific credentials for each getty unit
As explained in the previous commit, this allows us to configure
agetty and login for individual ttys instead of globally.
2024-07-31 15:52:29 +02:00