mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +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);
|
network = build_cmd(NULL, x, CMD_SIZE);
|
||||||
continue;
|
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)) {
|
if (MATCH_CMD(line, "startx ", x)) {
|
||||||
svc_register(x, username);
|
svc_register(x, username);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "svc.h"
|
#include "svc.h"
|
||||||
#include "sig.h"
|
#include "sig.h"
|
||||||
|
#include "lite.h"
|
||||||
|
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
int verbose = 1;
|
int verbose = 1;
|
||||||
@@ -40,6 +41,7 @@ char *sdown = NULL;
|
|||||||
char *network = NULL;
|
char *network = NULL;
|
||||||
char *username = NULL;
|
char *username = NULL;
|
||||||
char *hostname = NULL;
|
char *hostname = NULL;
|
||||||
|
char *rcsd = FINIT_RCSD;
|
||||||
|
|
||||||
|
|
||||||
static void parse_kernel_cmdline(void)
|
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.
|
* Run startup scripts in /etc/finit.d/, if any.
|
||||||
*/
|
*/
|
||||||
_d("Running startup scripts in /etc/finit.d/ ...");
|
if (rcsd && fisdir(rcsd)) {
|
||||||
run_parts(FINIT_RCSD);
|
_d("Running startup scripts in %s ...", rcsd);
|
||||||
|
run_parts(rcsd);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hooks that should run at the very end
|
* Hooks that should run at the very end
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ extern char *sdown;
|
|||||||
extern char *network;
|
extern char *network;
|
||||||
extern char *hostname;
|
extern char *hostname;
|
||||||
extern char *username;
|
extern char *username;
|
||||||
|
extern char *rcsd;
|
||||||
|
|
||||||
/* conf.c */
|
/* conf.c */
|
||||||
void parse_finit_conf(char *file);
|
void parse_finit_conf(char *file);
|
||||||
|
|||||||
Reference in New Issue
Block a user