mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a32ec5c92 | ||
|
|
081622a085 | ||
|
|
2526431d8e | ||
|
|
47d8a83668 | ||
|
|
f72f3febf9 |
+3
-1
@@ -30,4 +30,6 @@ release: distcheck
|
||||
printf "$$file.sha256\t"; cat ../$$file.sha256 | cut -f1 -d' '; \
|
||||
done
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = --with-fstab=/etc/fstab
|
||||
DISTCHECK_CONFIGURE_FLAGS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
|
||||
--enable-testserv-plugin --enable-x11-common-plugin \
|
||||
--with-watchdog --with-keventd --with-fstab=/etc/fstab
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
AC_INIT([Finit],[4.4-rc1],[https://github.com/troglobit/finit/issues],[finit],[https://troglobit.com/projects/finit/])
|
||||
AC_INIT([Finit],[4.4-rc2],[https://github.com/troglobit/finit/issues],[finit],[https://troglobit.com/projects/finit/])
|
||||
AC_CONFIG_AUX_DIR(aux)
|
||||
AM_INIT_AUTOMAKE([1.11 foreign dist-xz subdir-objects])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
+44
-13
@@ -78,6 +78,9 @@ static uev_t etcw;
|
||||
|
||||
static TAILQ_HEAD(, conf_change) conf_change_list = TAILQ_HEAD_INITIALIZER(conf_change_list);
|
||||
|
||||
static char *path;
|
||||
static char *shell;
|
||||
|
||||
static int parse_conf(char *file, int is_rcsd);
|
||||
static void drop_changes(void);
|
||||
|
||||
@@ -326,6 +329,8 @@ void conf_parse_cmdline(int argc, char *argv[])
|
||||
fstab = strdup(FINIT_FSTAB);
|
||||
finit_conf = strdup(FINIT_CONF);
|
||||
finit_rcsd = strdup(FINIT_RCSD);
|
||||
path = getenv("PATH");
|
||||
shell = getenv("SHELL");
|
||||
|
||||
for (int i = 1; i < argc; i++)
|
||||
parse_arg(argv[i]);
|
||||
@@ -351,8 +356,14 @@ void conf_reset_env(void)
|
||||
free(node);
|
||||
}
|
||||
|
||||
setenv("PATH", _PATH_STDPATH, 1);
|
||||
setenv("SHELL", _PATH_BSHELL, 1);
|
||||
if (path)
|
||||
setenv("PATH", path, 1);
|
||||
else
|
||||
setenv("PATH", _PATH_STDPATH, 1);
|
||||
if (shell)
|
||||
setenv("SHELL", shell, 1);
|
||||
else
|
||||
setenv("SHELL", _PATH_BSHELL, 1);
|
||||
setenv("LOGNAME", "root", 1);
|
||||
setenv("USER", "root", 1);
|
||||
}
|
||||
@@ -1025,14 +1036,37 @@ static int parse_conf(char *file, int is_rcsd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void glob_append(glob_t *gl, int append, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
size_t len;
|
||||
char *path;
|
||||
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(NULL, 0, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
path = alloca(++len);
|
||||
if (!path) {
|
||||
warn("failed alloca() in glob_append()");
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(path, len, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
dbg("conf_reload(): glob %s ...", path);
|
||||
glob(path, append ? GLOB_APPEND : 0, NULL, gl);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reload /etc/finit.conf and all *.conf in /etc/finit.d/
|
||||
*/
|
||||
int conf_reload(void)
|
||||
{
|
||||
char path[strlen(finit_rcsd) + 16];
|
||||
size_t i;
|
||||
glob_t gl;
|
||||
size_t i;
|
||||
|
||||
/* Set time according to current time zone */
|
||||
tzset();
|
||||
@@ -1051,7 +1085,7 @@ int conf_reload(void)
|
||||
|
||||
if (rescue) {
|
||||
int rc;
|
||||
char line[80] = "tty [12345] rescue";
|
||||
char line[80] = "tty [12345789] rescue";
|
||||
|
||||
/* If rescue.conf is missing, fall back to a root shell */
|
||||
rc = parse_conf(RESCUE_CONF, 0);
|
||||
@@ -1079,12 +1113,9 @@ int conf_reload(void)
|
||||
* /etc/finit.d -- similar to how tmfiles.d(5) work. E.g., add
|
||||
* an override .conf, or an ignore by symlinking to /dev/null
|
||||
*/
|
||||
snprintf(path, sizeof(path), "%s/*.conf", finit_rcsd);
|
||||
glob(path, 0, NULL, &gl);
|
||||
snprintf(path, sizeof(path), "%s/*.conf", FINIT_SYSPATH);
|
||||
glob(path, GLOB_APPEND, NULL, &gl);
|
||||
snprintf(path, sizeof(path), "%s/enabled/*.conf", finit_rcsd);
|
||||
glob(path, GLOB_APPEND, NULL, &gl);
|
||||
glob_append(&gl, 0, "%s/*.conf", finit_rcsd);
|
||||
glob_append(&gl, 1, "%s/*.conf", FINIT_SYSPATH);
|
||||
glob_append(&gl, 1, "%s/enabled/*.conf", finit_rcsd);
|
||||
|
||||
for (i = 0; i < gl.gl_pathc; i++) {
|
||||
char *path = gl.gl_pathv[i];
|
||||
@@ -1389,7 +1420,7 @@ int conf_init(uev_ctx_t *ctx)
|
||||
*/
|
||||
#ifdef WDT_DEVNODE
|
||||
if (whichp(FINIT_EXECPATH_ "/watchdogd") && fexist(WDT_DEVNODE)) {
|
||||
service_register(SVC_TYPE_SERVICE, "[S123456789] cgroup.init name:watchdog :finit " FINIT_EXECPATH_ "/watchdogd -- Finit watchdog daemon", global_rlimit, NULL);
|
||||
service_register(SVC_TYPE_SERVICE, "[S0123456789] cgroup.init name:watchdog :finit " FINIT_EXECPATH_ "/watchdogd -- Finit watchdog daemon", global_rlimit, NULL);
|
||||
wdog = svc_find("watchdog", "finit");
|
||||
}
|
||||
#endif
|
||||
@@ -1397,7 +1428,7 @@ int conf_init(uev_ctx_t *ctx)
|
||||
* Start kernel event daemon as soon as possible, if enabled
|
||||
*/
|
||||
if (whichp(FINIT_EXECPATH_ "/keventd"))
|
||||
service_register(SVC_TYPE_SERVICE, "[S123456789] cgroup.init " FINIT_EXECPATH_ "/keventd -- Finit kernel event daemon", global_rlimit, NULL);
|
||||
service_register(SVC_TYPE_SERVICE, "[S0123456789] cgroup.init " FINIT_EXECPATH_ "/keventd -- Finit kernel event daemon", global_rlimit, NULL);
|
||||
|
||||
dbg("Allow plugins to register early runlevel 1 run/task/services ...");
|
||||
plugin_run_hooks(HOOK_SVC_PLUGIN);
|
||||
|
||||
Reference in New Issue
Block a user