From d5d9cd5645d5605e6f03a3016f1aec4c9ce5f3dc Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 7 Jan 2024 13:56:31 +0100 Subject: [PATCH] tmpfiles: fix error message and ignore unremovable dirs (EBUSY) Fix copy-paste of error message from cond-w.c A read-only root filesystem may have /var/lock, while we want to remove it and add a symlink to ../run/lock. Ignore errors from this since we cannot do anything about it. It is up to the user to fix their skeleton or use an overlay. Signed-off-by: Joachim Wiberg --- src/tmpfiles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tmpfiles.c b/src/tmpfiles.c index f367432b..d62b09f0 100644 --- a/src/tmpfiles.c +++ b/src/tmpfiles.c @@ -78,8 +78,8 @@ static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct if (ftw->level == 0) return 1; - if (remove(fpath)) - warn("Failed removing condition %s", fpath); + if (remove(fpath) && errno != EBUSY) + warn("Failed removing %s", fpath); return 0;