15 #include <boost/noncopyable.hpp> 16 #include <boost/date_time/posix_time/posix_time.hpp> 48 class Daemon :
public boost::noncopyable {
71 virtual void cleanup();
74 virtual void shutdown();
85 static void loggerInit(
const char* log_name,
bool verbose);
107 static void setVerbose(
const bool verbose);
112 static bool getVerbose();
127 static std::string getVersion(
bool extended);
131 std::string getConfigFile()
const;
136 void setConfigFile(
const std::string& config_file);
140 void checkConfigFile()
const;
158 writeConfigFile(
const std::string& config_file,
164 static std::string getProcName();
168 static void setProcName(
const std::string& proc_name);
172 std::string getPIDFileDir()
const;
177 void setPIDFileDir(
const std::string& pid_file_dir);
181 std::string getPIDFileName()
const;
191 void setPIDFileName(
const std::string& pid_file_name);
204 void createPIDFile(
int pid = 0);
208 return (default_logger_name_);
216 default_logger_name_ =
logger;
221 return (exit_value_);
239 virtual std::list<std::list<std::string>> jsonPathsToRedact()
const;
260 std::string makePIDFileName()
const;
267 std::string config_file_;
270 static std::string proc_name_;
274 std::string pid_file_dir_;
280 static bool verbose_;
283 static std::string default_logger_name_;
286 bool am_file_author_;
static std::string getDefaultLoggerName()
Returns default logger name.
boost::posix_time::ptime start_
Timestamp of the start of the daemon.
int getExitValue()
Fetches the exit value.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
static void setDefaultLoggerName(const std::string &logger)
Sets the default logger name.
boost::shared_ptr< const Element > ConstElementPtr
isc::asiolink::IOSignalSetPtr signal_set_
A pointer to the object installing custom signal handlers.
boost::shared_ptr< IOSignalSet > IOSignalSetPtr
Defines a pointer to an IOSignalSet.
ConstElementPtr redactConfig(ConstElementPtr const &element, list< string > const &json_path)
Redact a configuration.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-lfc.
isc::log::Logger logger("asiodns")
Use the ASIO logger.
void setExitValue(int value)
Sets the exit value.
boost::shared_ptr< PIDFile > PIDFilePtr
Defines a shared pointer to a PIDFile.
Base class for all services.
DaemonPIDExists(const char *file, size_t line, const char *what)
Exception thrown when the PID file points to a live PID.
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the ConfigBase.