[Box Backup] Distribution Patches - Debian - Part3: default syslog facility

Reinhard Tartler boxbackup@boxbackup.org
Fri, 03 Apr 2009 09:07:37 +0200


change default syslog facility from LOG_LOCAL6 to LOG_DAEMON

is there a better way to change the default syslog location? Should it
be perhaps made configurable at configure time?

--- a/bin/bbstored/BackupStoreDaemon.cpp
+++ b/bin/bbstored/BackupStoreDaemon.cpp
@@ -203,7 +203,7 @@ void BackupStoreDaemon::Run()
 				SetProcessTitle("housekeeping, idle");
 				whichSocket = 1;
 				// Change the log name
-				::openlog("bbstored/hk", LOG_PID, LOG_LOCAL6);
+				::openlog("bbstored/hk", LOG_PID, LOG_DAEMON);
 				// Log that housekeeping started
 				BOX_INFO("Housekeeping process started");
 				// Ignore term and hup
--- a/lib/common/Logging.cpp
+++ b/lib/common/Logging.cpp
@@ -399,7 +399,7 @@ bool Syslog::Log(Log::Level level, const
 	return true;
 }
 
-Syslog::Syslog() : mFacility(LOG_LOCAL6)
+Syslog::Syslog() : mFacility(LOG_DAEMON)
 {
 	::openlog("Box Backup", LOG_PID, mFacility);
 }
@@ -437,8 +437,8 @@ int Syslog::GetNamedFacility(const std::
 	#undef CASE_RETURN
 
 	BOX_ERROR("Unknown log facility '" << rFacility << "', "
-		"using default LOCAL6");
-	return LOG_LOCAL6;
+		"using default DAEMON");
+	return LOG_DAEMON;
 }
 
 bool FileLogger::Log(Log::Level Level, const std::string& rFile, 
--- a/docs/docbook/adminguide.xml
+++ b/docs/docbook/adminguide.xml
@@ -286,6 +286,12 @@ local5.info                         /var
         <para><emphasis role="bold">Note:</emphasis> Separators must be tabs,
         otherwise these entries will be ignored.</para>
 
+        <para><emphasis role="bold">Note2:</emphasis> The packaged
+        debian and ubuntu versions of boxbackup do not log to local6,
+        but to the more standard 'daemon' facility. This means you
+        should not have anything to do to your syslog configuration,
+        since it is configured to be logged by default.</para>
+
         <programlisting>touch /var/log/box
 touch /var/log/raidfile</programlisting>
 


-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4