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:
Joachim Nilsson
2012-10-05 18:50:21 +02:00
parent 40c7a44d4f
commit 785c21d27b
3 changed files with 12 additions and 2 deletions
+5
View File
@@ -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;
+6 -2
View File
@@ -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
+1
View File
@@ -66,6 +66,7 @@ extern char *sdown;
extern char *network;
extern char *hostname;
extern char *username;
extern char *rcsd;
/* conf.c */
void parse_finit_conf(char *file);