mirror of
https://github.com/troglobit/finit.git
synced 2026-11-29 21:08:21 +00:00
Add and improve debug messages, clean out old dev. comments
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
6f26f2f9d0
commit
c59f7d23f4
5 files changed
+13
-8
No files matched your search
@@ -401,6 +401,7 @@ int api_init(uev_ctx_t *ctx)
|
|||||||
.sun_path = INIT_SOCKET,
|
.sun_path = INIT_SOCKET,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_d("Setting up external API socket ...");
|
||||||
sd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
sd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||||
if (-1 == sd) {
|
if (-1 == sd) {
|
||||||
_pe("Failed starting external API socket");
|
_pe("Failed starting external API socket");
|
||||||
|
|||||||
+1
-6
@@ -398,7 +398,7 @@ static int parse_conf_dynamic(char *file, struct timeval *mtime)
|
|||||||
/* Prepare default limits for each service */
|
/* Prepare default limits for each service */
|
||||||
memcpy(rlimit, global_rlimit, sizeof(rlimit));
|
memcpy(rlimit, global_rlimit, sizeof(rlimit));
|
||||||
|
|
||||||
_d("Parsing %s", file);
|
_d("Parsing %s <<<<<<", file);
|
||||||
while (!feof(fp)) {
|
while (!feof(fp)) {
|
||||||
char line[LINE_SIZE] = "";
|
char line[LINE_SIZE] = "";
|
||||||
|
|
||||||
@@ -417,7 +417,6 @@ static int parse_conf_dynamic(char *file, struct timeval *mtime)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reads /etc/finit.conf, once at boot */
|
|
||||||
static int parse_conf(char *file)
|
static int parse_conf(char *file)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@@ -508,10 +507,6 @@ int conf_reload_dynamic(void)
|
|||||||
|
|
||||||
rp = realpath(path, NULL);
|
rp = realpath(path, NULL);
|
||||||
if (!rp) {
|
if (!rp) {
|
||||||
/*
|
|
||||||
* XXX: Prune from rcsd?
|
|
||||||
* XXX: Possibly temporary service from last boot
|
|
||||||
*/
|
|
||||||
logit(LOG_WARNING, "Skipping %s, dangling symlink: %s", path, strerror(errno));
|
logit(LOG_WARNING, "Skipping %s, dangling symlink: %s", path, strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -256,18 +256,22 @@ static void finalize(void)
|
|||||||
/*
|
/*
|
||||||
* Network stuff
|
* Network stuff
|
||||||
*/
|
*/
|
||||||
|
_d("Setting up networking ...");
|
||||||
networking();
|
networking();
|
||||||
umask(022);
|
umask(022);
|
||||||
|
|
||||||
/* Hooks that rely on loopback, or basic networking being up. */
|
/* Hooks that rely on loopback, or basic networking being up. */
|
||||||
|
_d("Calling all network up hooks ...");
|
||||||
plugin_run_hooks(HOOK_NETWORK_UP);
|
plugin_run_hooks(HOOK_NETWORK_UP);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start all tasks/services in the configured runlevel
|
* Start all tasks/services in the configured runlevel
|
||||||
*/
|
*/
|
||||||
|
_d("Change to default runlevel, start all services ...");
|
||||||
service_runlevel(cfglevel);
|
service_runlevel(cfglevel);
|
||||||
|
|
||||||
/* Clean up bootstrap-only tasks/services that never started */
|
/* Clean up bootstrap-only tasks/services that never started */
|
||||||
|
_d("Clean up all bootstrap-only tasks/services ...");
|
||||||
svc_prune_bootstrap();
|
svc_prune_bootstrap();
|
||||||
|
|
||||||
/* All services/tasks/inetd/etc. in configure runlevel have started */
|
/* All services/tasks/inetd/etc. in configure runlevel have started */
|
||||||
@@ -291,13 +295,16 @@ static void finalize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Hooks that should run at the very end */
|
/* Hooks that should run at the very end */
|
||||||
|
_d("Calling all system up hooks ...");
|
||||||
plugin_run_hooks(HOOK_SYSTEM_UP);
|
plugin_run_hooks(HOOK_SYSTEM_UP);
|
||||||
service_step_all(SVC_TYPE_ANY);
|
service_step_all(SVC_TYPE_ANY);
|
||||||
|
|
||||||
/* Enable silent mode before starting TTYs */
|
/* Enable silent mode before starting TTYs */
|
||||||
|
_d("Going silent ...");
|
||||||
log_silent();
|
log_silent();
|
||||||
|
|
||||||
/* Delayed start of TTYs at bootstrap */
|
/* Delayed start of TTYs at bootstrap */
|
||||||
|
_d("Launching all getty services ...");
|
||||||
tty_runlevel();
|
tty_runlevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,11 +512,13 @@ int main(int argc, char* argv[])
|
|||||||
* Wait for all SVC_TYPE_RUNTASK to have completed their work in
|
* Wait for all SVC_TYPE_RUNTASK to have completed their work in
|
||||||
* [S], or timeout, before calling finalize()
|
* [S], or timeout, before calling finalize()
|
||||||
*/
|
*/
|
||||||
|
_d("Starting bootstrap finalize timer ...");
|
||||||
uev_timer_init(&loop, &timer, service_bootstrap_cb, finalize, 1000, 1000);
|
uev_timer_init(&loop, &timer, service_bootstrap_cb, finalize, 1000, 1000);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enter main loop to monior /dev/initctl and services
|
* Enter main loop to monior /dev/initctl and services
|
||||||
*/
|
*/
|
||||||
|
_d("Entering main loop ...");
|
||||||
return uev_run(&loop, 0);
|
return uev_run(&loop, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1095,7 +1095,6 @@ void service_bootstrap_cb(uev_t *w, void *arg, int events)
|
|||||||
finalize();
|
finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* indent-tabs-mode: t
|
* indent-tabs-mode: t
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ void sm_step(sm_t *sm)
|
|||||||
restart:
|
restart:
|
||||||
old_state = sm->state;
|
old_state = sm->state;
|
||||||
|
|
||||||
_d("state: %s", sm_status(sm->state));
|
_d("state: %s, runlevel: %d, newlevel: %d, teardown: %d, reload: %d",
|
||||||
|
sm_status(sm->state), runlevel, sm->newlevel, sm->in_teardown, sm->reload);
|
||||||
|
|
||||||
switch (sm->state) {
|
switch (sm->state) {
|
||||||
case SM_BOOTSTRAP_STATE:
|
case SM_BOOTSTRAP_STATE:
|
||||||
|
|||||||
Reference in new issue
Block a user