1
0
mirror of https://github.com/systemd/systemd synced 2025-10-03 18:54:45 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Yu Watanabe
7b20a5cbf3 TEST-13-NSPAWN: wait for a few seconds after markers found
Otherwise, the scope that the nspawn container belonging to may be
removed before the grandchild process of the machined exits and it may
be SIGKILLed.
```
[  100.829613] systemd-machined[678]: Successfully forked off '(sd-bindmnt)' as PID 2962.
[  100.833366] systemd-nspawn[2953]: Inner child finished, invoking payload.
[  100.836111] (sd-bindmnt)[2962]: Skipping PR_SET_MM, as we don't have privileges.
[  100.836401] (sd-bindmnt)[2962]: Successfully forked off '(sd-bindmnt-inner)' as PID 2964.
[  100.846498] (sd-bindmnt)[2962]: (sd-bindmnt-inner) terminated by signal KILL.
[  100.848846] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: cgroup is empty
[  100.849303] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Deactivated successfully.
[  100.849317] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Changed running -> dead
[  100.849752] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Consumed 91ms CPU time, 1.3M memory peak.
[  100.850399] systemd-machined[678]: (sd-bindmnt) failed with exit status 1.
[  100.850414] systemd-machined[678]: Child failed.
[  100.854574] systemd-machined[678]: Failed to mount /tmp/marker-varlink on /tmp/marker-varlink in the namespace of machine 'TEST-13-NSPAWN.machinectl-bind.7ye': Protocol error
```

Hopefully fixes #38434.
2025-08-01 09:49:57 +01:00
Yu Watanabe
dfc8de2c7d basic: do not use PROJECT_FILE in one more generated file
Fixes the following build warning:
```
In file included from ../../../home/runner/work/systemd/systemd/src/basic/assert-util.h:4,
                 from ../../../home/runner/work/systemd/systemd/src/basic/forward.h:17,
                 from ../../../home/runner/work/systemd/systemd/src/basic/filesystems.h:4,
                 from src/basic/filesystem-sets.c:2:
src/basic/filesystem-sets.c: In function ‘fs_in_group’:
../../../home/runner/work/systemd/systemd/src/fundamental/assert-fundamental.h:76:9: warning: array subscript 42 is above array bounds of ‘const char[28]’ [-Warray-bounds=]
   76 |         log_assert_failed_unreachable(PROJECT_FILE, __LINE__, __func__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/basic/filesystem-sets.c:559:18: note: in expansion of macro ‘assert_not_reached’
  559 |         default: assert_not_reached();
      |                  ^~~~~~~~~~~~~~~~~~
```

Follow-up for aca4353ab2b928e669e1b649a9f6987df1efb084.
Similar to fc4a9c9ce6eebbc472fc2947ae371f5925011545.
2025-08-01 09:49:23 +01:00
2 changed files with 6 additions and 1 deletions

View File

@ -282,6 +282,11 @@ def generate_fs_type_to_string():
#include <linux/magic.h> #include <linux/magic.h>
#include "filesystems.h" #include "filesystems.h"
/* PROJECT_FILE, which is used by log_xyz() thus also used by assert_not_reached(), cannot be used in
* generated files, as the build directory may be outside of the source directory. */
#undef PROJECT_FILE
#define PROJECT_FILE __FILE__
const char* fs_type_to_string(statfs_f_type_t magic) { const char* fs_type_to_string(statfs_f_type_t magic) {
switch (magic) {""") switch (magic) {""")

View File

@ -933,7 +933,7 @@ EOF
testcase_machinectl_bind() { testcase_machinectl_bind() {
local service_path service_name root container_name ec local service_path service_name root container_name ec
local cmd='for i in $(seq 1 20); do if test -f /tmp/marker && test -f /tmp/marker-varlink; then exit 0; fi; sleep .5; done; exit 1;' local cmd="timeout 10 bash -c 'until [[ -f /tmp/marker ]] && [[ -f /tmp/marker-varlink ]]; do sleep .5; done'; sleep 3"
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.machinectl-bind.XXX)" root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.machinectl-bind.XXX)"
create_dummy_container "$root" create_dummy_container "$root"