From eca38349cb25ccae89acf3a0dc4dfd9a6ca8770c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 22 Apr 2024 22:47:27 +0200 Subject: fs: Make the full directory path for the pid file and the control socket Build systems should not attempt to create $runstatedir (or anything under it). Doing so causes warnings in packaging systems, such as in Alpine Linux, as reported by Andy. But unitd(8) can be configured to be installed under /opt, or other trees, where no directories exist before hand. Expecting that the user creates the entire directory trees that unit will need is a bit unreasonable. Instead, let's just create any directories that we need, with all their parents, at run time. Fixes: 57fc9201cb91 ("Socket: Created control socket & pid file directories.") Link: Reported-by: Andy Postnikov Tested-by: Andy Postnikov Tested-by: Andrew Clayton Reviewed-by: Andrew Clayton Acked-by: Konstantin Pavlov Cc: Liam Crilly Signed-off-by: Alejandro Colomar --- src/nxt_controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nxt_controller.c') diff --git a/src/nxt_controller.c b/src/nxt_controller.c index 109324b8..b4ae8d09 100644 --- a/src/nxt_controller.c +++ b/src/nxt_controller.c @@ -695,7 +695,7 @@ nxt_runtime_controller_socket(nxt_task_t *task, nxt_runtime_t *rt) if (ls->sockaddr->u.sockaddr.sa_family == AF_UNIX) { const char *path = ls->sockaddr->u.sockaddr_un.sun_path; - nxt_fs_mkdir_dirname((const u_char *) path, 0755); + nxt_fs_mkdir_p_dirname((const u_char *) path, 0755); } #endif -- cgit