Commit 055f33d7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Start the worker (after -I processing) if we have a VCL and are not in -d mode.

parent a009f792
......@@ -53,9 +53,10 @@ void MAC_Arg(const char *);
void MAC_reopen_sockets(struct cli *);
/* mgt_child.c */
int MCH_Init(int launch);
void MCH_Init(void);
int MCH_Running(void);
void MCH_Stop_Child(void);
int MCH_Start_Child(void);
void MCH_TrackHighFd(int fd);
void MCH_Cli_Fail(void);
......
......@@ -597,6 +597,18 @@ MCH_Stop_Child(void)
mgt_reap_child();
}
/*=====================================================================
*/
int
MCH_Start_Child(void)
{
mgt_launch_child(NULL);
if (child_state != CH_RUNNING)
return (2);
return(0);
}
/*====================================================================
* Query if the child is running
*/
......@@ -668,17 +680,9 @@ static struct cli_proto cli_mch[] = {
* and to reincarnate it in case of trouble.
*/
int
MCH_Init(int launch)
void
MCH_Init(void)
{
VCLS_AddFunc(mgt_cls, MCF_AUTH, cli_mch);
if (launch) {
mgt_launch_child(NULL);
if (child_state != CH_RUNNING)
return (2);
}
return(0);
}
......@@ -862,9 +862,6 @@ main(int argc, char * const *argv)
mgt_SHM_Create();
if (!d_flag && !mgt_has_vcl() && !novcl)
MGT_Complain(C_ERR, "No VCL loaded yet");
memset(&sac, 0, sizeof sac);
sac.sa_handler = SIG_IGN;
sac.sa_flags = SA_RESTART;
......@@ -872,7 +869,7 @@ main(int argc, char * const *argv)
AZ(sigaction(SIGPIPE, &sac, NULL));
AZ(sigaction(SIGHUP, &sac, NULL));
u = MCH_Init(d_flag || novcl ? 0 : 1);
MCH_Init();
if (I_fd >= 0) {
fprintf(stderr, "BEGIN of -I file processing\n");
......@@ -885,6 +882,14 @@ main(int argc, char * const *argv)
}
}
if (!d_flag && !mgt_has_vcl() && !novcl)
MGT_Complain(C_ERR, "No VCL loaded yet");
if (mgt_has_vcl() && ! d_flag)
u = MCH_Start_Child();
else
u = 0;
if (eric_fd >= 0)
mgt_eric_im_done(eric_fd, u);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment