Make sure that "PIDFile" option cannot be set when command-line option "-P" was used...
authorThomas D <whissi@whissi.de>
Wed, 12 Feb 2014 14:32:15 +0000 (15:32 +0100)
committerThomas D <whissi@whissi.de>
Wed, 12 Feb 2014 15:31:46 +0000 (16:31 +0100)
commit09fb81e130ad70bf0547cec3d3c349ce8cb092cf
tree39948efa84c10556f4fd378fcd76b3224b7912fe
parent204cf4f8f68cadeac474a75584f27b7339aca4c4
Make sure that "PIDFile" option cannot be set when command-line option "-P" was used. (Fixes #553)

The "PIDFile" value from command-line option "-P", which should take
precedence over any "PIDFile" value from configuration files, could be
overwritten if a configuration file contained the "PIDFile" option.

We introduced a new global variable "pidfile_from_cli" which will be set
to 1 when the command-line option "-P" was detected and the
"global_option_set" function will only set the "PIDFile" option if
"pidfile_from_cli" is 0.
src/collectd.c
src/collectd.h
src/configfile.c