mirror of
https://github.com/troglobit/finit.git
synced 2026-11-20 19:41:51 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
1 parent
0da1deb487
commit
5f818f917e
1 file changed
+4
-1
+4
-1
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "finit.h"
|
#include "finit.h"
|
||||||
#include "cond.h"
|
#include "cond.h"
|
||||||
|
#include "pid.h"
|
||||||
#include "service.h"
|
#include "service.h"
|
||||||
|
|
||||||
static int cond_set_gen(const char *path, unsigned int gen)
|
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)
|
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);
|
_pe("Failed creating condition base directory '%s'", COND_PATH);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user