Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
055f33d7
Commit
055f33d7
authored
Mar 12, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start the worker (after -I processing) if we have a VCL and are not in -d mode.
parent
a009f792
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
15 deletions
+25
-15
mgt.h
bin/varnishd/mgt/mgt.h
+2
-1
mgt_child.c
bin/varnishd/mgt/mgt_child.c
+14
-10
mgt_main.c
bin/varnishd/mgt/mgt_main.c
+9
-4
No files found.
bin/varnishd/mgt/mgt.h
View file @
055f33d7
...
@@ -53,9 +53,10 @@ void MAC_Arg(const char *);
...
@@ -53,9 +53,10 @@ void MAC_Arg(const char *);
void
MAC_reopen_sockets
(
struct
cli
*
);
void
MAC_reopen_sockets
(
struct
cli
*
);
/* mgt_child.c */
/* mgt_child.c */
int
MCH_Init
(
int
launch
);
void
MCH_Init
(
void
);
int
MCH_Running
(
void
);
int
MCH_Running
(
void
);
void
MCH_Stop_Child
(
void
);
void
MCH_Stop_Child
(
void
);
int
MCH_Start_Child
(
void
);
void
MCH_TrackHighFd
(
int
fd
);
void
MCH_TrackHighFd
(
int
fd
);
void
MCH_Cli_Fail
(
void
);
void
MCH_Cli_Fail
(
void
);
...
...
bin/varnishd/mgt/mgt_child.c
View file @
055f33d7
...
@@ -597,6 +597,18 @@ MCH_Stop_Child(void)
...
@@ -597,6 +597,18 @@ MCH_Stop_Child(void)
mgt_reap_child
();
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
* Query if the child is running
*/
*/
...
@@ -668,17 +680,9 @@ static struct cli_proto cli_mch[] = {
...
@@ -668,17 +680,9 @@ static struct cli_proto cli_mch[] = {
* and to reincarnate it in case of trouble.
* and to reincarnate it in case of trouble.
*/
*/
int
void
MCH_Init
(
int
launch
)
MCH_Init
(
void
)
{
{
VCLS_AddFunc
(
mgt_cls
,
MCF_AUTH
,
cli_mch
);
VCLS_AddFunc
(
mgt_cls
,
MCF_AUTH
,
cli_mch
);
if
(
launch
)
{
mgt_launch_child
(
NULL
);
if
(
child_state
!=
CH_RUNNING
)
return
(
2
);
}
return
(
0
);
}
}
bin/varnishd/mgt/mgt_main.c
View file @
055f33d7
...
@@ -862,9 +862,6 @@ main(int argc, char * const *argv)
...
@@ -862,9 +862,6 @@ main(int argc, char * const *argv)
mgt_SHM_Create
();
mgt_SHM_Create
();
if
(
!
d_flag
&&
!
mgt_has_vcl
()
&&
!
novcl
)
MGT_Complain
(
C_ERR
,
"No VCL loaded yet"
);
memset
(
&
sac
,
0
,
sizeof
sac
);
memset
(
&
sac
,
0
,
sizeof
sac
);
sac
.
sa_handler
=
SIG_IGN
;
sac
.
sa_handler
=
SIG_IGN
;
sac
.
sa_flags
=
SA_RESTART
;
sac
.
sa_flags
=
SA_RESTART
;
...
@@ -872,7 +869,7 @@ main(int argc, char * const *argv)
...
@@ -872,7 +869,7 @@ main(int argc, char * const *argv)
AZ
(
sigaction
(
SIGPIPE
,
&
sac
,
NULL
));
AZ
(
sigaction
(
SIGPIPE
,
&
sac
,
NULL
));
AZ
(
sigaction
(
SIGHUP
,
&
sac
,
NULL
));
AZ
(
sigaction
(
SIGHUP
,
&
sac
,
NULL
));
u
=
MCH_Init
(
d_flag
||
novcl
?
0
:
1
);
MCH_Init
(
);
if
(
I_fd
>=
0
)
{
if
(
I_fd
>=
0
)
{
fprintf
(
stderr
,
"BEGIN of -I file processing
\n
"
);
fprintf
(
stderr
,
"BEGIN of -I file processing
\n
"
);
...
@@ -885,6 +882,14 @@ main(int argc, char * const *argv)
...
@@ -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
)
if
(
eric_fd
>=
0
)
mgt_eric_im_done
(
eric_fd
,
u
);
mgt_eric_im_done
(
eric_fd
,
u
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment