Esempio n. 1
0
/**
 * service_reload_dynamic - Called on SIGHUP, 'init q' or 'initctl reload'
 *
 * This function is called when Finit has recieved SIGHUP to reload
 * .conf files in /etc/finit.d.  It is responsible for starting,
 * stopping and reloading (forwarding SIGHUP) to processes affected.
 */
void service_reload_dynamic(void)
{
	/* First reload all *.conf in /etc/finit.d/ */
	conf_reload_dynamic();

	/* Then stop any disabled/removed services and non-reloadable */
	service_stop_dynamic();

	/* Finish off by starting/reload modified/new services */
	service_start_dynamic();
}
Esempio n. 2
0
File: service.c Progetto: wkz/finit
/*
 * Unless there are services we must collect first (wait for
 * them to stop), we can call HOOK_SVC_RECONF here.
 */
static int service_stop_done(svc_t *svc)
{
	if (svc && !svc_is_changed(svc))
		return 0;

	if (svc && dyn_stop_cnt)
		dyn_stop_cnt--;

	_d("dyn_stop_cnt %d", dyn_stop_cnt);
	if (!dyn_stop_cnt) {
		_d("All disabled/removed services have been stoppped, calling reconf hooks ...");
		plugin_run_hooks(HOOK_SVC_RECONF); /* Reconfigure HW/VLANs/etc here */

		/* Finish off by starting/reload modified/new services */
		service_start_dynamic();
	}

	return 1;
}