tags 395056 patch fixed-upstream thanks > > After an upgrade from sarge I noted smokeping was not running, even > > after manual restart. Further investigation revealed that the problem is > > actually a problem with a dying syslog-ng (#384021). However, smokeping > > dies if it cannot write to /dev/log which happens if there's no syslog > > daemon running. > This will be fixed in the next upstream version, and possibly in 2.0.9-2 > for etch if it looks like 2.0.10 is too late for etch. I'm raising the > severity, as I think dying silently at startup is a real bug.
For completeness, here's a patch against the current upstream SVN version. It applies to 2.0.9 too with some fuzz. Cheers, -- Niko Tyni [EMAIL PROTECTED]
Index: lib/Smokeping.pm =================================================================== --- lib/Smokeping.pm (revision 686) +++ lib/Smokeping.pm (working copy) @@ -2705,12 +2705,22 @@ $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 ($){