summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--lib/Smokeping.pm12
2 files changed, 13 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 129dcf4..0fee429 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,5 @@
-
+* don't die if syslogd is dead -- niko, reported by
+ Christoph Biedl <cbiedl *gmx.de> as Debian bug #395056
* add sourceaddress configurability to FPing probe (requires -S flag) -- Norman Rasmussen norman rasmussen.co.za
* allow . in section names ...
* in FTPtransfer probe set destfilename to srcfilename if it is empty
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 04e320d..3f76a7e 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -2705,12 +2705,22 @@ sub daemonize_me ($) {
$syslog_priority = $pri if defined $pri;
print "Note: logging to syslog as $syslog_facility/$syslog_priority.\n";
openlog(basename($0), 'pid', $syslog_facility);
+ eval {
+ syslog($syslog_priority, 'Starting syslog logging');
+ };
+ die("can't log to syslog: $@") if $@;
}
sub do_syslog ($){
my $str = shift;
$str =~ s,%,%%,g;
- syslog("$syslog_facility|$syslog_priority", $str);
+ eval {
+ syslog("$syslog_facility|$syslog_priority", $str);
+ };
+ # syslogd is probably dead if that failed
+ # this message is most probably lost too, if we have daemonized
+ # let's try anyway, it shouldn't hurt
+ print STDERR qq(Can't log "$str" to syslog: $@) if $@;
}
sub do_cgilog ($){