From 5f818f917ef49ab8373179e76a0c1076d0ebfe08 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 22 Jan 2018 15:09:58 +0100 Subject: [PATCH] cond_init(): Create correct condition path, /var/run might not exist The cond_init() function is called before the bootmisc.so plugin has run. It is responsble for setting up the /var/run symlink to /run on systems with the new layout. Therefore we must wrap COND_PATH with pid_runpath() to create the correct runtime path. Signed-off-by: Joachim Nilsson --- src/cond-w.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cond-w.c b/src/cond-w.c index 1936a116..43be612c 100644 --- a/src/cond-w.c +++ b/src/cond-w.c @@ -28,6 +28,7 @@ #include "finit.h" #include "cond.h" +#include "pid.h" #include "service.h" static int cond_set_gen(const char *path, unsigned int gen) @@ -224,7 +225,9 @@ void cond_reassert(const char *type) void cond_init(void) { - if (makepath(COND_PATH) && errno != EEXIST) { + char path[MAX_ARG_LEN]; + + if (makepath(pid_runpath(COND_PATH, path, sizeof(path))) && errno != EEXIST) { _pe("Failed creating condition base directory '%s'", COND_PATH); return; }