Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
ca9edbb9
Commit
ca9edbb9
authored
Jun 10, 2014
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: added config param restart.pause
parent
39d847de
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
1 deletion
+16
-1
config.c
trackrdrd/src/config.c
+3
-0
regress.sh
trackrdrd/src/test/regress.sh
+1
-1
test_config.c
trackrdrd/src/test/test_config.c
+3
-0
trackrdrd_001.conf
trackrdrd/src/test/trackrdrd_001.conf
+1
-0
trackrdrd_002.conf
trackrdrd/src/test/trackrdrd_002.conf
+1
-0
trackrdrd_003.conf
trackrdrd/src/test/trackrdrd_003.conf
+1
-0
trackrdrd.c
trackrdrd/src/trackrdrd.c
+5
-0
trackrdrd.h
trackrdrd/src/trackrdrd.h
+1
-0
No files found.
trackrdrd/src/config.c
View file @
ca9edbb9
...
...
@@ -127,6 +127,7 @@ CONF_Add(const char *lval, const char *rval)
confUnsigned
(
"hash.mlt"
,
hash_mlt
);
confUnsigned
(
"nworkers"
,
nworkers
);
confUnsigned
(
"restarts"
,
restarts
);
confUnsigned
(
"restart.pause"
,
restart_pause
);
confUnsigned
(
"thread.restarts"
,
thread_restarts
);
confUnsigned
(
"monitor.interval"
,
monitor_interval
);
...
...
@@ -209,6 +210,7 @@ CONF_Init(void)
config
.
mq_config_file
[
0
]
=
'\0'
;
config
.
nworkers
=
1
;
config
.
restarts
=
1
;
config
.
restart_pause
=
1
;
config
.
thread_restarts
=
1
;
pw
=
getpwnam
(
DEFAULT_USER
);
...
...
@@ -261,6 +263,7 @@ CONF_Dump(void)
confdump
(
"mq.config_file = %s"
,
config
.
mq_config_file
);
confdump
(
"nworkers = %u"
,
config
.
nworkers
);
confdump
(
"restarts = %u"
,
config
.
restarts
);
confdump
(
"restart.pause = %u"
,
config
.
restart_pause
);
confdump
(
"thread.restarts = %u"
,
config
.
thread_restarts
);
confdump
(
"user = %s"
,
config
.
user_name
);
}
trackrdrd/src/test/regress.sh
View file @
ca9edbb9
...
...
@@ -22,7 +22,7 @@ CMD="../trackrdrd -D -f varnish.binlog -l - -d -c test.conf"
# the user running it
CKSUM
=
$(
$CMD
|
sed
-e
's/\(initializing\) \(.*\)/\1/'
|
sed
-e
's/\(Running as\) \([a-zA-Z0-9]*\)$/\1/'
|
grep
-v
'Not running as root'
|
cksum
)
if
[
"
$CKSUM
"
!=
'
1900415110 234158
'
]
;
then
if
[
"
$CKSUM
"
!=
'
2777461934 234191
'
]
;
then
echo
"ERROR: Regression test incorrect cksum:
$CKSUM
"
exit
1
fi
...
...
trackrdrd/src/test/test_config.c
View file @
ca9edbb9
...
...
@@ -46,6 +46,7 @@
#define DEFAULT_USER "nobody"
#define DEFAULT_PID_FILE "/var/run/trackrdrd.pid"
#define DEFAULT_RESTART_PAUSE 1
#define confdump(str,val) \
i += sprintf(verbose_buffer + i, str"\n", (val))
...
...
@@ -84,6 +85,7 @@ getConfigContent(void)
confdump
(
"mq.config_file = %s"
,
config
.
mq_config_file
);
confdump
(
"nworkers = %u"
,
config
.
nworkers
);
confdump
(
"restarts = %u"
,
config
.
restarts
);
confdump
(
"restart.pause = %u"
,
config
.
restart_pause
);
confdump
(
"thread.restarts = %u"
,
config
.
thread_restarts
);
confdump
(
"user = %s"
,
config
.
user_name
);
return
verbose_buffer
;
...
...
@@ -125,6 +127,7 @@ static char
"Default user name expected:
\"
%s
\"
, but found:
\"
%s
\"
"
,
DEFAULT_USER
,
config
.
user_name
);
VMASSERT
(
!
strcmp
(
DEFAULT_PID_FILE
,
config
.
pid_file
),
"Default pid file name expected:
\"
%s
\"
, but found:
\"
%s
\"
"
,
DEFAULT_PID_FILE
,
config
.
user_name
);
MASSERT
(
DEFAULT_RESTART_PAUSE
==
config
.
restart_pause
);
return
NULL
;
}
...
...
trackrdrd/src/test/trackrdrd_001.conf
View file @
ca9edbb9
...
...
@@ -17,5 +17,6 @@ mq.module = /var/opt/varnish_tracking/lib/trackrdrd/libtrackrdr-activemq.so
mq
.
config_file
= /
etc
/
trackrdr
-
activemq
.
conf
nworkers
=
20
restarts
=
100
restart
.
pause
=
1
thread
.
restarts
=
100
user
=
root
trackrdrd/src/test/trackrdrd_002.conf
View file @
ca9edbb9
...
...
@@ -17,5 +17,6 @@ mq.module = /var/opt/varnish_tracking/lib/trackrdrd/libtrackrdr-activemq.so
mq
.
config_file
= /
etc
/
trackrdr
-
activemq
.
conf
nworkers
=
2
restarts
=
3
restart
.
pause
=
2
thread
.
restarts
=
4
user
=
nobody
trackrdrd/src/test/trackrdrd_003.conf
View file @
ca9edbb9
...
...
@@ -17,5 +17,6 @@ mq.module = /var/opt/varnish_tracking/lib/trackrdrd/libtrackrdr-activemq.so
mq
.
config_file
= /
etc
/
trackrdr
-
activemq
.
conf
nworkers
=
1
restarts
=
1
restart
.
pause
=
0
thread
.
restarts
=
1
user
=
root
trackrdrd/src/trackrdrd.c
View file @
ca9edbb9
...
...
@@ -196,6 +196,11 @@ parent_main(pid_t child_pid, struct VSM_data *vd, int endless)
parent_shutdown
(
EXIT_FAILURE
,
0
);
}
if
(
config
.
restart_pause
>
0
)
{
LOG_Log
(
LOG_INFO
,
"Pausing %u seconds before restarting child"
,
config
.
restart_pause
);
TIM_sleep
(
config
.
restart_pause
);
}
child_pid
=
child_restart
(
child_pid
,
vd
,
endless
,
0
);
restarts
++
;
}
...
...
trackrdrd/src/trackrdrd.h
View file @
ca9edbb9
...
...
@@ -322,6 +322,7 @@ struct config {
char
mq_config_file
[
BUFSIZ
];
unsigned
nworkers
;
unsigned
restarts
;
unsigned
restart_pause
;
unsigned
thread_restarts
;
char
user_name
[
BUFSIZ
];
uid_t
uid
;
...
...
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