summaryrefslogtreecommitdiff
path: root/bin/bbstored/BackupStoreDaemon.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-08-21 11:18:39 +0000
committerChris Wilson <chris+github@qwirx.com>2008-08-21 11:18:39 +0000
commit9cae0cb415d50e28d4819e54ce76131fbd9f7c1c (patch)
treed0adebf44b25de0b1ffd47b1de3182d3e24f69c5 /bin/bbstored/BackupStoreDaemon.cpp
parent7dbcaff4f698c914f9307cb69e742983e3a1a4e1 (diff)
Run housekeeping synchronously on all platforms if daemon is run in
single process mode (-D), not just on Windows. Add a housekeeping interface to allow Boxi to run housekeeping.
Diffstat (limited to 'bin/bbstored/BackupStoreDaemon.cpp')
-rw-r--r--bin/bbstored/BackupStoreDaemon.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/bin/bbstored/BackupStoreDaemon.cpp b/bin/bbstored/BackupStoreDaemon.cpp
index ca620df2..50bd0a2b 100644
--- a/bin/bbstored/BackupStoreDaemon.cpp
+++ b/bin/bbstored/BackupStoreDaemon.cpp
@@ -172,11 +172,12 @@ void BackupStoreDaemon::Run()
const Configuration &config(GetConfiguration());
mExtendedLogging = config.GetKeyValueBool("ExtendedLogging");
-#ifdef WIN32
- // Housekeeping runs synchronously on Win32
-#else
- // Fork off housekeeping daemon -- must only do this the first time Run() is called
- if(!mHaveForkedHousekeeping)
+ // Fork off housekeeping daemon -- must only do this the first
+ // time Run() is called. Housekeeping runs synchronously on Win32
+ // because IsSingleProcess() is always true
+
+#ifndef WIN32
+ if(!IsSingleProcess() && !mHaveForkedHousekeeping)
{
// Open a socket pair for communication
int sv[2] = {-1,-1};
@@ -206,7 +207,9 @@ void BackupStoreDaemon::Run()
// Log that housekeeping started
BOX_INFO("Housekeeping process started");
// Ignore term and hup
- // Parent will handle these and alert the child via the socket, don't want to randomly die
+ // Parent will handle these and alert the
+ // child via the socket, don't want to
+ // randomly die!
::signal(SIGHUP, SIG_IGN);
::signal(SIGTERM, SIG_IGN);
}