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
3826496b
Commit
3826496b
authored
Sep 01, 2014
by
Poul-Henning Kamp
Committed by
Lasse Karstensen
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't rename the VSM file into place until we have started the
child process during startup. Fixes #1407
parent
234c2ef5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
mgt.h
bin/varnishd/mgt/mgt.h
+1
-0
mgt_child.c
bin/varnishd/mgt/mgt_child.c
+4
-1
mgt_shmem.c
bin/varnishd/mgt/mgt_shmem.c
+16
-5
No files found.
bin/varnishd/mgt/mgt.h
View file @
3826496b
...
...
@@ -107,6 +107,7 @@ void mgt_SHM_Init(void);
void
mgt_SHM_static_alloc
(
const
void
*
,
ssize_t
size
,
const
char
*
class
,
const
char
*
type
,
const
char
*
ident
);
void
mgt_SHM_Create
(
void
);
void
mgt_SHM_Commit
(
void
);
void
mgt_SHM_Destroy
(
int
keep
);
void
mgt_SHM_Size_Adjust
(
void
);
...
...
bin/varnishd/mgt/mgt_child.c
View file @
3826496b
...
...
@@ -570,6 +570,7 @@ mgt_reap_child(void)
mgt_SHM_Destroy
(
0
);
}
mgt_SHM_Create
();
mgt_SHM_Commit
();
if
(
child_state
==
CH_RUNNING
)
child_state
=
CH_DIED
;
...
...
@@ -752,13 +753,15 @@ MGT_Run(void)
REPORT0
(
LOG_ERR
,
"No VCL loaded yet"
);
else
if
(
!
d_flag
)
{
mgt_launch_child
(
NULL
);
if
(
child_state
==
CH_STOPPED
)
{
if
(
child_state
!=
CH_RUNNING
)
{
// XXX correct? or 0?
exit_status
=
2
;
return
;
}
}
mgt_SHM_Commit
();
i
=
vev_schedule
(
mgt_evb
);
if
(
i
!=
0
)
REPORT
(
LOG_ERR
,
"vev_schedule() = %d"
,
i
);
...
...
bin/varnishd/mgt/mgt_shmem.c
View file @
3826496b
...
...
@@ -246,17 +246,28 @@ mgt_SHM_Create(void)
AN
(
VSC_C_mgt
);
*
VSC_C_mgt
=
static_VSC_C_mgt
;
#ifdef __OpenBSD__
/* Commit changes, for OS's without coherent VM/buf */
AZ
(
msync
(
p
,
getpagesize
(),
MS_SYNC
));
#endif
}
/*--------------------------------------------------------------------
* Commit the VSM
*/
void
mgt_SHM_Commit
(
void
)
{
char
fnbuf
[
64
];
bprintf
(
fnbuf
,
"%s.%jd"
,
VSM_FILENAME
,
(
intmax_t
)
getpid
());
if
(
rename
(
fnbuf
,
VSM_FILENAME
))
{
fprintf
(
stderr
,
"Rename failed %s -> %s: %s
\n
"
,
fnbuf
,
VSM_FILENAME
,
strerror
(
errno
));
(
void
)
unlink
(
fnbuf
);
exit
(
1
);
}
#ifdef __OpenBSD__
/* Commit changes, for OS's without coherent VM/buf */
AZ
(
msync
(
p
,
getpagesize
(),
MS_SYNC
));
#endif
}
/*--------------------------------------------------------------------
...
...
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