mirror of
https://github.com/troglobit/finit.git
synced 2026-10-10 16:52:39 +07:00
plugins: skip plugin in rescue mode
These plugins should not run in rescue mode, because the system may be in a very bad state and we do not want to make the situation any worse than it already is. Essentially, only services in rescue.conf should run in rescue mode. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -23,6 +23,9 @@
|
||||
|
||||
#include <glob.h>
|
||||
#include <lite/lite.h>
|
||||
|
||||
#include "finit.h"
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
|
||||
static void setup(void *arg)
|
||||
@@ -31,6 +34,11 @@ static void setup(void *arg)
|
||||
glob_t gl;
|
||||
char buf[160];
|
||||
|
||||
if (rescue) {
|
||||
_d("Skipping %s plugin in rescue mode.", __FILE__);
|
||||
return;
|
||||
}
|
||||
|
||||
glob("/run/sysctl.d/*.conf", 0, NULL, &gl);
|
||||
glob("/etc/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl);
|
||||
glob("/usr/local/lib/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl);
|
||||
|
||||
Reference in New Issue
Block a user