Commit Graph
54077 Commits
Author SHA1 Message Date
Yu Watanabe 173ffdaffb nspawn/oci: replace use of deprecated CPUShares with CPUWeight 2025-04-08 02:08:37 +09:00
Yu Watanabe b7fb6ec34f nspawn/oci: also set CPUQuotaPeriodUSec DBus property 2025-04-08 02:08:37 +09:00
Yu Watanabe c019af5eed test-notify-recv: fix message string
Follow-up for 2351bc991e.
Addresses https://github.com/systemd/systemd/pull/37016#discussion_r2031363409.
2025-04-08 02:04:13 +09:00
Yu Watanabe 8bf8e51bf5 fs-util: fix typo
Follow-up for 053e0626db.
2025-04-07 16:53:15 +09:00
Yu Watanabe f0deacdd5c pcre2-util: fix typo
Follow-up for 5517e214c8.
2025-04-07 16:52:04 +09:00
Yu Watanabe f501563ec3 machine: fix typo
Follow-up for a4019c75c2.
2025-04-07 16:49:43 +09:00
Yu Watanabe 500fd53a51 string-util: fix typo
Follow-up for 87b7d9b6ff.
2025-04-07 16:46:17 +09:00
Yu Watanabe f5b09f02ac network/netdev: fix typo
Follow-up for 540eb5f037.
2025-04-07 16:44:21 +09:00
Yu Watanabe 38747451af core/service: fix typo
Follow-up for c53d2d54bd.
2025-04-07 16:42:10 +09:00
Yu Watanabe 18f7a0cad9 network: fix typo
Follow-up for 96dd66eddf.
2025-04-07 16:41:25 +09:00
Yu Watanabe 77c796d46f terminal-util: fix typo
Follow-up for 3390be38d1.
2025-04-07 16:35:18 +09:00
Yu Watanabe 79ef03740d terminal-util: fix typo
Follow-up for b27f791691.
2025-04-07 16:34:07 +09:00
Yu Watanabe 71cc90aabc udev: fix typo
Follow-up for 0ba9d06963.
2025-04-07 16:30:52 +09:00
Mike Yuan c06b8d96f4 core: do not use pidref_hash_ops_free for Manager.watch_pids
The PidRefs are in all cases owned by Unit.pids, and gets removed
from Manager.watch_pids(_more) when the unit is destructed, via
unit_unwatch_pidref(). This hasn't caused any issue because
manager_clear_jobs_and_units() is called before destroying
Manager.watch_pids(_more), but let's get this right.
2025-04-07 15:48:23 +09:00
Mike Yuan ead510fe06 core/manager: also assert on Manager.units_by_invocation_id being empty after cleanup 2025-04-07 15:48:23 +09:00
Yu Watanabe 856db27d97 udev: move extra_timeout_usec() to udev-config.c
Then, introduce manager_kill_worker_timeout() helper function.
No functional change, just refactoring.
2025-04-06 21:55:09 +01:00
ZIHCO cc9229e42d test: extend the unit test test-notify-recv.c 2025-04-07 05:28:17 +09:00
Daan De Meyer 6aa69f702b core: Resolve /dev/console if it's connected to stdin (#36666) 2025-04-06 14:14:35 +02:00
Mike Yuan c0ebcb818e build-path: teach pin_callout_binary() to search $PATH too
Prompted by 2caa462504
2025-04-06 02:39:06 +02:00
Mike Yuan 28b6bfd370 build-path: port to open_and_check_executable(), do not return resolved path
Follow-up for b58c240312

We need to be extremely careful with using the path associated with fd,
since it contains the resolved path if a symlink was opened. In particular,
it's really not desirable to return the resolved executable path in
pin_callout_binary(), which would end up as argv[0] in udev_event_spawn(),
potentially changing the behavior of spawned process.
2025-04-06 02:39:05 +02:00
Mike Yuan 326d60a9d0 path-util: generalize open_and_check_executable() 2025-04-06 02:32:47 +02:00
Yu Watanabe d893f35559 udev-watch: push inotify fd to service manager's fdstore (#36977) 2025-04-05 20:34:42 +09:00
Khem Raj fd9c4b4f49 shared/cred-util: Ensure TPM code is used with HAVE_TPM2 guards
Building with no TPM2 we end up with following error

/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
In function ‘memcpy’,
    inlined from ‘encrypt_credential_and_warn’ at ../git/src/shared/creds-util.c:1091:17:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: error: argument 2 null where non-null expected [-Werror=nonnull]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
cc1: some warnings being treated as errors   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~

This is because code referencing tpm2 data structures is still used while the
initialization of the function has been compiled out since its conditional on HAVE_TPM2

We add needed guards in places where it is missing to fix this problem

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-04-05 11:28:07 +01:00
Yu Watanabe e4e40936f3 nspawn: drop cgv1 handling; core: drop cgroup agent (#36764) 2025-04-05 17:57:18 +09:00
Yu Watanabe 04ae22375a udev-watch: dump installed inotify watches on start and stop 2025-04-05 17:33:31 +09:00
Yu Watanabe beaf7e04eb udev: push inotify fd to file descriptor store
Then, if we get inotify fd on start, it is not necessary to re-enable
inotify watch.
2025-04-05 17:33:14 +09:00
Yu Watanabe 5edb07be62 udev-watch: split-out manager_process_inotify() from on_inotify()
No functional change, just refactoring.
2025-04-05 07:10:17 +09:00
Yu Watanabe ef0f8397a5 udev: move inotify watch related functions to udev-watch.c 2025-04-05 07:10:17 +09:00
David C. Manuelda 668d915a4b boot: only link libgcc when compiler is gcc
When compiling in systems which do not have gcc installed
(like a musl+llvm system) the forced linkage "-lgcc" is
stopping it to compile. As when compiler is clang it do not
need to link explicitelly to gcc I've modified meson to only
link to gcc library when compiler is gcc.

Closes: #35162
2025-04-05 07:02:37 +09:00
Beniamino Galvani f7996e2a33 network: add support for HSR netdev
Add support for creating HSR/PRP interfaces. HSR (High-availability Seamless
Redundancy) and PRP (Parallel Redundancy Protocol) are two protocols that
provide seamless failover against failure of any single network component. They
are both implemented by the "hsr" kernel driver.
2025-04-05 05:23:53 +09:00
Luca Boccassi c1b0e39ffd tree-wide: allow building with -Werror=flex-array-member-not-at-end (#36993)
Fixes #36988.
2025-04-04 18:37:54 +01:00
Mike Yuan b157a7e613 core: also stash executor path in Manager
Prompted by b58c240312

Let's not query it over and over again in exec_spawn().
2025-04-05 02:33:00 +09:00
Daan De Meyer 2b0087e5b1 exec-invoke: Always go via stdin fd in setup_pam() to get tty
We might have resolved the tty to something else if it was set to
/dev/console, so let's always go via stdin in setup_pam(). This also
means we won't set the pam tty if only stdout or stderr are connected
to a tty, which seems like a sensible thing to do.
2025-04-04 17:13:16 +02:00
Daan De Meyer 6f1d594d63 core: Resolve /dev/console if it's connected to stdin
If /dev/console is connected to stdin there's a possibility that
the unit might try to start a logind session from within the unit.
Let's make sure that any such sessions are started on the tty that
/dev/console points to and not on /dev/console itself.
2025-04-04 17:13:14 +02:00
Yu Watanabe 99d704c6e8 stat-util: drop unnecessary call of xopenat() in xstatfsat() 2025-04-05 00:13:01 +09:00
Daan De Meyer c7f7d87db5 terminal-util: Make sure resolve_dev_console() always returns a full path
Currently it returns a full path in some cases and a partial path in others.
Let's make sure it always returns a full path.
2025-04-04 17:12:58 +02:00
Mike Yuan fc4663b379 core/cgroup: drop extraneous CGRuntime check in unit_get_memory_available()
Currently, for units whose CGRuntime is not allocated just yet, e.g.
inactive ones, MemoryAvailable fails to account for their MemoryMax/High
settings. Let's remove the CGRuntime check hence. The call to
unit_get_memory_accounting() would certainly fail, but it doesn't matter,
since 'current' is initially set to 0 anyways.
2025-04-04 15:34:52 +02:00
Mike Yuan 702aa33935 core/cgroup: fold unit_get_current_memory() into generic memory accounting helper 2025-04-04 15:34:52 +02:00
Mike Yuan 40d54c2da0 procfs-util: modernize convert_meminfo_value_to_uint64_bytes() 2025-04-04 15:34:51 +02:00
Mike Yuan 110d0ff1fa procfs-util: use xsprintf() where appropriate 2025-04-04 15:34:51 +02:00
Mike Yuan 77a0d2e3ec core/cgroup: remove legacy hierarchy setup
This also makes pin_cgroupfs_fd actually pin the fs root,
so that we can port all cg_* helpers to operate under
the fd later on.
2025-04-04 15:34:51 +02:00
Mike Yuan be1d96dbc3 core: remove cgroups-agent 2025-04-04 15:34:51 +02:00
Mike Yuan 2a010ef8fd cgroup-util: remove now unused cg_kernel_controllers() 2025-04-04 14:36:14 +02:00
Mike Yuan b26a994fb8 nspawn: reject existing cgroupfs mount if cgns is enabled 2025-04-04 14:36:14 +02:00
Mike Yuan 02c4d27b17 nspawn: do not spuriously override cgroup2fs options on host 2025-04-04 14:36:14 +02:00
Mike Yuan 1614ca809e nspawn/meson: drop duplicate condition on ENABLE_NSPAWN
Follow-up for d95818f522

The whole dir is skipped if disabled, so no need for individual
conditions below.
2025-04-04 14:36:13 +02:00
Mike Yuan 6801a9d88a nspawn: drop cgroup v1 handling 2025-04-04 14:36:11 +02:00
Yu Watanabe 7200827885 udev-spawn: search executed command in build directory
This should be useful when debugging RUN{program}= and friends.
2025-04-04 21:10:25 +09:00
Yu Watanabe b58c240312 build-path: make pin_callout_binary() optionally provides the path to the found executable 2025-04-04 21:02:18 +09:00
Yu Watanabe 2c31eda469 build-path: check if found path is executable binary
Otherwise, the path may point to a non-executable, e.g. a directory.
2025-04-04 20:56:11 +09:00