aboutsummaryrefslogtreecommitdiff
path: root/src/daemonizer/daemonizer.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-03-24 08:50:08 +0200
committerRiccardo Spagni <ric@spagni.net>2015-03-24 08:53:05 +0200
commitd7286395c97afd9d33d6170c1cf24f1e38140b37 (patch)
tree5513e1477d68755a44e0b0c7d34542b1c75eb99d /src/daemonizer/daemonizer.h
parentupdated gtest to latest (diff)
parentMerge upstream to daemonize changes (diff)
downloadmonero-d7286395c97afd9d33d6170c1cf24f1e38140b37.tar.xz
Merge pull request #243
51e3579 Fixed bug in static linking boost on MINGW (Thomas Winget) f78bb00 Hopefully fixes build on Windows for real this time (Thomas Winget) 2b0583b Hopefully fixes build on Windows (Thomas Winget) 9dab105 DNS checkpoint loading for testnet should now be correct (Thomas Winget) 52f9629 sending commands to forked daemon works on testnet now (Thomas Winget) 76289d0 Fix tests building -- function signatures changed (Thomas Winget) db53e19 revert stop_daemon method to use correct exit (Thomas Winget) 96cbecf RPC calls for background daemon added in (Thomas Winget) 9193d6f Daemonize changes pulled in -- daemon builds (Thomas Winget)
Diffstat (limited to 'src/daemonizer/daemonizer.h')
-rw-r--r--src/daemonizer/daemonizer.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/daemonizer/daemonizer.h b/src/daemonizer/daemonizer.h
new file mode 100644
index 000000000..6097a58f6
--- /dev/null
+++ b/src/daemonizer/daemonizer.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <boost/filesystem/path.hpp>
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/variables_map.hpp>
+
+namespace daemonizer
+{
+ void init_options(
+ boost::program_options::options_description & hidden_options
+ , boost::program_options::options_description & normal_options
+ );
+
+ boost::filesystem::path get_default_data_dir();
+
+ boost::filesystem::path get_relative_path_base(
+ boost::program_options::variables_map const & vm
+ );
+
+ /**
+ * @arg create_before_detach - this indicates that the daemon should be
+ * created before the fork, giving it a chance to report initialization
+ * errors. At the time of this writing, this is not possible in the primary
+ * daemon (likely due to the size of the blockchain in memory).
+ */
+ template <typename T_executor>
+ bool daemonize(
+ int argc, char const * argv[]
+ , T_executor && executor // universal ref
+ , boost::program_options::variables_map const & vm
+ );
+}
+
+#ifdef WIN32
+# include "daemonizer/windows_daemonizer.inl"
+#else
+# include "daemonizer/posix_daemonizer.inl"
+#endif