daemonize() is not responsible for loggers
This commit is contained in:
parent
870e5a8e26
commit
829a768e82
@ -4,7 +4,7 @@
|
||||
cryptopp/cryptopp: 9
|
||||
google/gmock: 4
|
||||
google/gtest: 11
|
||||
messmer/cmake: 4
|
||||
messmer/cmake: 3
|
||||
messmer/spdlog: 0
|
||||
|
||||
[parent]
|
||||
|
@ -18,7 +18,7 @@ namespace cpputils {
|
||||
|
||||
//TODO Test daemonize()
|
||||
|
||||
void daemonize(const std::string &daemonName) {
|
||||
void daemonize() {
|
||||
pid_t pid = fork();
|
||||
if (pid < 0) {
|
||||
exit(EXIT_FAILURE);
|
||||
@ -44,9 +44,6 @@ namespace cpputils {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Setup logging to syslog.
|
||||
cpputils::logging::setLogger(spdlog::syslog_logger(daemonName, daemonName, LOG_PID));
|
||||
|
||||
// Close out the standard file descriptors. The daemon can't use them anyhow.
|
||||
close(STDIN_FILENO);
|
||||
close(STDOUT_FILENO);
|
||||
|
@ -2,10 +2,8 @@
|
||||
#ifndef MESSMER_CPPUTILS_DAEMON_DAEMONIZE_H
|
||||
#define MESSMER_CPPUTILS_DAEMON_DAEMONIZE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace cpputils {
|
||||
void daemonize(const std::string &daemonName);
|
||||
void daemonize();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user