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
7a4da8d1
Commit
7a4da8d1
authored
May 27, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rotate log on SIGHUP
parent
0b2ae6b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
vapi_options.h
include/vapi/vapi_options.h
+1
-3
vut.c
lib/libvarnishtools/vut.c
+12
-0
No files found.
include/vapi/vapi_options.h
View file @
7a4da8d1
...
@@ -92,9 +92,7 @@
...
@@ -92,9 +92,7 @@
" them. The file will be overwritten unless the -a option" \
" them. The file will be overwritten unless the -a option" \
" was specified. If the application receives a SIGHUP" \
" was specified. If the application receives a SIGHUP" \
" while writing to a file, it will reopen the file" \
" while writing to a file, it will reopen the file" \
" allowing the old one to be rotated away.\n" \
" allowing the old one to be rotated away." \
"\n" \
"XXX: Log rotation not yet implemented" \
)
)
#define VSL_OPT_x \
#define VSL_OPT_x \
...
...
lib/libvarnishtools/vut.c
View file @
7a4da8d1
...
@@ -259,6 +259,18 @@ VUT_Main(VSLQ_dispatch_f *func, void *priv)
...
@@ -259,6 +259,18 @@ VUT_Main(VSLQ_dispatch_f *func, void *priv)
}
}
while
(
!
VUT
.
sigint
)
{
while
(
!
VUT
.
sigint
)
{
if
(
VUT
.
w_arg
&&
VUT
.
sighup
)
{
/* Rotate log */
VUT
.
sighup
=
0
;
AN
(
VUT
.
fo
);
fclose
(
VUT
.
fo
);
VUT
.
fo
=
VSL_WriteOpen
(
VUT
.
vsl
,
VUT
.
w_arg
,
0
,
VUT
.
u_opt
);
if
(
VUT
.
fo
==
NULL
)
VUT_Error
(
1
,
"Can't open output file (%s)"
,
VSL_Error
(
VUT
.
vsl
));
}
if
(
VUT
.
vslq
==
NULL
)
{
if
(
VUT
.
vslq
==
NULL
)
{
AZ
(
VUT
.
r_arg
);
AZ
(
VUT
.
r_arg
);
AN
(
VUT
.
vsm
);
AN
(
VUT
.
vsm
);
...
...
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