summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--CHANGES4
-rw-r--r--doc/smokeping_install.pod3
-rw-r--r--lib/Smokeping.pm21
3 files changed, 26 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 7bb7813..8d5f2fd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+* make it work (hopefully) with even older versions of CGI::Carp if
+ 'changecgiprogramname' is set to 'no' in the General section
+ -- niko
+
2005/10/3 -- released version 20051003_trunk
2005/10/2 -- released version 20051002_trunk
diff --git a/doc/smokeping_install.pod b/doc/smokeping_install.pod
index 515a110..26c9854 100644
--- a/doc/smokeping_install.pod
+++ b/doc/smokeping_install.pod
@@ -133,6 +133,9 @@ If you are using a version of Perl older than 5.8.1, you should consider
installing a newer version of CGI::Carp (must be at least 1.24, included in
CGI.pm-2.82). Otherwise any error messages generated by the CGI script
will not show up quite as clean as they could in the web server error log.
+If you can't or don't want to upgrade CGI::Carp, you can also set
+the C<changecgiprogramname> variable in the C<General> section to the
+value C<no>.
=back
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 ($){