summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2005-10-03 13:20:46 +0200
committerNiko Tyni <ntyni@iki.fi>2005-10-03 13:20:46 +0200
commit76884f2dae8556d52be6c97e66a3171a94ef8420 (patch)
treeda56cd4cfaca33eefa61b0fe59632dbdf12508ac /lib
parent244a5fca9c21faffe98cae72f64e0b9ed69d7e0b (diff)
downloadsmokeping-76884f2dae8556d52be6c97e66a3171a94ef8420.tar.gz
smokeping-76884f2dae8556d52be6c97e66a3171a94ef8420.tar.xz
* (trunk/)
doc/smokeping_install.pod, lib/Smokeping.pm, CHANGES: + make it work (hopefully) with even older versions of CGI::Carp if 'changecgiprogramname' is set to 'no' in the General section
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 56b966c..dd2df9e 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1608,7 +1608,8 @@ DOC
_vars =>
[ qw(owner imgcache imgurl datadir dyndir pagedir piddir sendmail offset
smokemail cgiurl mailhost contact netsnpp
- syslogfacility syslogpriority concurrentprobes changeprocessnames tmail) ],
+ syslogfacility syslogpriority concurrentprobes changeprocessnames tmail
+ changecgiprogramname) ],
_mandatory =>
[ qw(owner imgcache imgurl datadir piddir
smokemail cgiurl contact) ],
@@ -1777,6 +1778,19 @@ If 'concurrentprobes' is not set to 'yes', this variable has no effect.
DOC
_default => 'yes',
},
+ changecgiprogramname => {
+ _re => '(yes|no)',
+ _re_error =>"this must either be 'yes' or 'no'",
+ _doc => <<DOC,
+Usually the Smokeping CGI tries to log any possible errors with an extended
+program name that includes the IP address of the remote client for easier
+debugging. If this variable is set to 'no', the program name will not be
+modified. The only reason you would want this is if you have a very old
+version of the CGI::Carp module. See
+L<the installation document|smokeping_install> for details.
+DOC,
+ _default => 'yes',
+ },
tmail =>
{
%$FILECHECK_SUB,
@@ -2472,10 +2486,13 @@ sub daemonize_me ($) {
sub initialize_cgilog (){
$use_cgilog = 1;
+ $logging=1;
+ return if $cfg->{General}{changecgiprogramname} eq 'no';
# set_progname() is available starting with CGI.pm-2.82 / Perl 5.8.1
# so trap this inside 'eval'
+ # even this apparently isn't enough for older versions that try to
+ # find out whether they are inside an eval...oh well.
eval 'CGI::Carp::set_progname($0 . " [client " . ($ENV{REMOTE_ADDR}||"(unknown)") . "]")';
- $logging=1;
}
sub initialize_filelog ($){