Skip to content

Commit 7c50f5b

Browse files
committed
Revert "unit: add ordering dep relative to credentials dir"
Causes a cycle at shutdown, undo the backport. Jul 10 22:13:21 H systemd[1]: poweroff.target: Trying to enqueue job poweroff.target/start/replace-irreversibly Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Found ordering cycle on run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount/stop Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Found dependency on systemd-tmpfiles-setup-dev.service/stop Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Found dependency on local-fs-pre.target/stop Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Job run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount/stop deleted to break ordering cycle starting with local-fs-pre.target/stop Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found ordering cycle on systemd-tmpfiles-setup-dev.service/stop Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found dependency on local-fs-pre.target/stop Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found dependency on run-credentials-systemd\x2dsysusers.service.mount/stop Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found dependency on systemd-sysusers.service/stop Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Job systemd-tmpfiles-setup-dev.service/stop deleted to break ordering cycle starting with systemd-sysusers.service/stop This reverts commit ad10ffe. (cherry picked from commit 4728105)
1 parent d55810e commit 7c50f5b

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

src/core/execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ static bool context_has_no_new_privileges(const ExecContext *c) {
14531453
context_has_syscall_logs(c);
14541454
}
14551455

1456-
bool exec_context_has_credentials(const ExecContext *context) {
1456+
static bool exec_context_has_credentials(const ExecContext *context) {
14571457

14581458
assert(context);
14591459

src/core/execute.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ const char* exec_context_fdname(const ExecContext *c, int fd_index);
459459

460460
bool exec_context_may_touch_console(const ExecContext *c);
461461
bool exec_context_maintains_privileges(const ExecContext *c);
462-
bool exec_context_has_credentials(const ExecContext *context);
463462

464463
int exec_context_get_effective_ioprio(const ExecContext *c);
465464
bool exec_context_get_effective_mount_apivfs(const ExecContext *c);

src/core/unit.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,26 +1347,6 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
13471347
if (r < 0)
13481348
return r;
13491349

1350-
if (exec_context_has_credentials(c) && u->manager->prefix[EXEC_DIRECTORY_RUNTIME]) {
1351-
_cleanup_free_ char *p = NULL, *m = NULL;
1352-
1353-
/* Let's make sure the credentials directory of this service is unmounted *after* the service
1354-
* itself shuts down. This only matters if mount namespacing is not used for the service, and
1355-
* hence the credentials mount appears on the host. */
1356-
1357-
p = path_join(u->manager->prefix[EXEC_DIRECTORY_RUNTIME], "credentials", u->id);
1358-
if (!p)
1359-
return -ENOMEM;
1360-
1361-
r = unit_name_from_path(p, ".mount", &m);
1362-
if (r < 0)
1363-
return r;
1364-
1365-
r = unit_add_dependency_by_name(u, UNIT_AFTER, m, /* add_reference= */ true, UNIT_DEPENDENCY_FILE);
1366-
if (r < 0)
1367-
return r;
1368-
}
1369-
13701350
return 0;
13711351
}
13721352

0 commit comments

Comments
 (0)