Example #1
0
void
CLI_Run(void)
{
	int i;

	add_check = 1;

	AN(CLS_AddFd(cls, heritage.cli_in, heritage.cli_out, NULL, NULL));

	do {
		i = CLS_Poll(cls, -1);
	} while(i > 0);
	VSL(SLT_CLI, 0, "EOF on CLI connection, worker stops");
	VCA_Shutdown();
}
Example #2
0
void
child_main(void)
{

	setbuf(stdout, NULL);
	setbuf(stderr, NULL);
	printf("Child starts\n");
#if defined(__FreeBSD__) && __FreeBSD__version >= 1000000
	malloc_message = child_malloc_fail;
#endif

	cache_param = heritage.param;

	AZ(pthread_key_create(&req_key, NULL));
	AZ(pthread_key_create(&bo_key, NULL));
	AZ(pthread_key_create(&witness_key, NULL));
	AZ(pthread_key_create(&name_key, NULL));

	THR_SetName("cache-main");

	VSM_Init();	/* First, LCK needs it. */

	LCK_Init();	/* Second, locking */

	Lck_New(&vxid_lock, lck_vxid);

	CLI_Init();
	PAN_Init();
	VFP_Init();

	ObjInit();

	VCL_Init();

	HTTP_Init();

	VBO_Init();
	VBP_Init();
	VBE_InitCfg();
	Pool_Init();
	V1P_Init();

	EXP_Init();
	HSH_Init(heritage.hash);
	BAN_Init();

	VCA_Init();

	STV_open();

	VMOD_Init();

	BAN_Compile();

	VRND_Seed();
	srand48(random());
	CLI_AddFuncs(debug_cmds);

	/* Wait for persistent storage to load if asked to */
	if (FEATURE(FEATURE_WAIT_SILO))
		SMP_Ready();

	CLI_Run();

	VCA_Shutdown();
	BAN_Shutdown();
	STV_close();

	printf("Child dies\n");
}