From 2857dafaf47153a61f465eef5e6acad7da3442d5 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 2 Mar 2021 20:22:56 +0100 Subject: [PATCH] plugins: pidfile: Fall back to /run if _PATH_VARRUN doesn't exist Signed-off-by: Joachim Wiberg --- plugins/pidfile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/pidfile.c b/plugins/pidfile.c index 19a4b907..20e11afc 100644 --- a/plugins/pidfile.c +++ b/plugins/pidfile.c @@ -235,8 +235,11 @@ static void pidfile_init(void *arg) */ path = realpath(_PATH_VARRUN, NULL); if (!path) { - _pe("Failed "); - return; + path = realpath("/run", NULL); + if (!path) { + _e("System does not have %s or /run, aborting.", _PATH_VARRUN); + return; + } } if (pidfile_add_path(&iw_pidfile, path))