mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
Support for overriding built-in default FINIT_RCSD in finit.conf
This commit adds support for the "runparts <DIR>" directive to finit.conf. Enabling the user to override the built-in default, which by default is /etc/finit.d. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -122,6 +122,11 @@ void parse_finit_conf(char *file)
|
||||
network = build_cmd(NULL, x, CMD_SIZE);
|
||||
continue;
|
||||
}
|
||||
if (MATCH_CMD(line, "runparts ", x)) {
|
||||
if (rcsd) free(rcsd);
|
||||
hostname = build_cmd(NULL, x, CMD_SIZE);
|
||||
continue;
|
||||
}
|
||||
if (MATCH_CMD(line, "startx ", x)) {
|
||||
svc_register(x, username);
|
||||
continue;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "plugin.h"
|
||||
#include "svc.h"
|
||||
#include "sig.h"
|
||||
#include "lite.h"
|
||||
|
||||
int debug = 0;
|
||||
int verbose = 1;
|
||||
@@ -40,6 +41,7 @@ char *sdown = NULL;
|
||||
char *network = NULL;
|
||||
char *username = NULL;
|
||||
char *hostname = NULL;
|
||||
char *rcsd = FINIT_RCSD;
|
||||
|
||||
|
||||
static void parse_kernel_cmdline(void)
|
||||
@@ -181,8 +183,10 @@ int main(int UNUSED(args), char *argv[])
|
||||
/*
|
||||
* Run startup scripts in /etc/finit.d/, if any.
|
||||
*/
|
||||
_d("Running startup scripts in /etc/finit.d/ ...");
|
||||
run_parts(FINIT_RCSD);
|
||||
if (rcsd && fisdir(rcsd)) {
|
||||
_d("Running startup scripts in %s ...", rcsd);
|
||||
run_parts(rcsd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks that should run at the very end
|
||||
|
||||
Reference in New Issue
Block a user