From 89ddb4e91b36fabcb99bd3cfb2940bea55befd69 Mon Sep 17 00:00:00 2001 From: obarun <eric@obarun.org> Date: Sun, 12 Mar 2023 16:44:26 +1100 Subject: [PATCH] fix container directory deletion --- src/lib66/exec/ssexec_scandir_remove.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/lib66/exec/ssexec_scandir_remove.c b/src/lib66/exec/ssexec_scandir_remove.c index 983feb19..ab07b87a 100644 --- a/src/lib66/exec/ssexec_scandir_remove.c +++ b/src/lib66/exec/ssexec_scandir_remove.c @@ -41,15 +41,29 @@ int ssexec_scandir_remove(int argc, char const *const *argv, ssexec_t *info) r = svc_scandir_ok(info->scandir.s) ; if (r < 0) log_dieusys(LOG_EXIT_SYS, "check: ", info->scandir.s) ; - if (r) + if (r) { + log_dieu(LOG_EXIT_USER, "remove: ", info->scandir.s, ": is running") ; + /* for now, i have a race condition + unsigned int m = 0 ; + int nargc = 3 ; + char const *newargv[nargc] ; + + newargv[m++] = "stop" ; + newargv[m++] = "stop" ; + newargv[m] = 0 ; + + if (ssexec_scandir_signal(m, newargv, info)) + log_dieu(LOG_EXIT_SYS, "stop scandir: ", info->scandir.s) ; + */ + } /** /run/66/scandir/0 */ auto_rm(info->scandir.s) ; /** /run/66/scandir/container */ info->scandir.len = 0 ; - if (!auto_stra(&info->scandir, info->live.s, SS_BOOT_CONTAINER_DIR, "/", info->ownerstr)) + if (!auto_stra(&info->scandir, info->live.s, SS_SCANDIR, "/", SS_BOOT_CONTAINER_DIR)) log_die_nomem("stralloc") ; auto_rm(info->scandir.s) ; -- GitLab