plugins: pidfile: Fall back to /run if _PATH_VARRUN doesn't exist

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-03-02 20:22:56 +01:00
1 parent 8355c37285
commit 2857dafaf4
1 file changed
+5 -2
+5 -2
View File
@@ -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))