aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-03-21 14:10:36 +0200
committerRiccardo Spagni <ric@spagni.net>2017-03-21 14:10:36 +0200
commit4b345313072bf6f37552dc8ebd6551f81cf66043 (patch)
tree6c74a9c66a107bdca6604cd2264f6e366dbc6091
parentMerge pull request #1904 (diff)
parentcreate a foreground non-interactive mode (diff)
downloadmonero-4b345313072bf6f37552dc8ebd6551f81cf66043.tar.xz
Merge pull request #1897
44a5b038 create a foreground non-interactive mode (Noah Watkins)
-rw-r--r--src/daemon/executor.cpp7
-rw-r--r--src/daemon/executor.h4
-rw-r--r--src/daemonizer/posix_daemonizer.inl9
3 files changed, 20 insertions, 0 deletions
diff --git a/src/daemon/executor.cpp b/src/daemon/executor.cpp
index 53e1c7647..6130bfa28 100644
--- a/src/daemon/executor.cpp
+++ b/src/daemon/executor.cpp
@@ -63,6 +63,13 @@ namespace daemonize
return t_daemon{vm};
}
+ bool t_executor::run_non_interactive(
+ boost::program_options::variables_map const & vm
+ )
+ {
+ return t_daemon{vm}.run(false);
+ }
+
bool t_executor::run_interactive(
boost::program_options::variables_map const & vm
)
diff --git a/src/daemon/executor.h b/src/daemon/executor.h
index b36c819ea..137e7209c 100644
--- a/src/daemon/executor.h
+++ b/src/daemon/executor.h
@@ -56,6 +56,10 @@ namespace daemonize
boost::program_options::variables_map const & vm
);
+ bool run_non_interactive(
+ boost::program_options::variables_map const & vm
+ );
+
bool run_interactive(
boost::program_options::variables_map const & vm
);
diff --git a/src/daemonizer/posix_daemonizer.inl b/src/daemonizer/posix_daemonizer.inl
index 6ddaacc9d..f8be15dda 100644
--- a/src/daemonizer/posix_daemonizer.inl
+++ b/src/daemonizer/posix_daemonizer.inl
@@ -43,6 +43,10 @@ namespace daemonizer
"detach"
, "Run as daemon"
};
+ const command_line::arg_descriptor<bool> arg_non_interactive = {
+ "non-interactive"
+ , "Run non-interactive"
+ };
}
inline void init_options(
@@ -51,6 +55,7 @@ namespace daemonizer
)
{
command_line::add_arg(normal_options, arg_detach);
+ command_line::add_arg(normal_options, arg_non_interactive);
}
inline boost::filesystem::path get_default_data_dir()
@@ -79,6 +84,10 @@ namespace daemonizer
auto daemon = executor.create_daemon(vm);
return daemon.run();
}
+ else if (command_line::has_arg(vm, arg_non_interactive))
+ {
+ return executor.run_non_interactive(vm);
+ }
else
{
//LOG_PRINT_L0("Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL);