15#include <boost/noncopyable.hpp>
16#include <boost/date_time/posix_time/posix_time.hpp>
48class Daemon :
public boost::noncopyable {
85 static void loggerInit(
const char* log_name,
bool verbose);
168 static void setProcName(
const std::string& proc_name);
208 return (default_logger_name_);
216 default_logger_name_ = logger;
221 return (exit_value_);
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_;
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Exception thrown when the PID file points to a live PID.
DaemonPIDExists(const char *file, size_t line, const char *what)
Base class for all services.
std::string getConfigFile() const
Returns config file name.
virtual size_t writeConfigFile(const std::string &config_file, isc::data::ConstElementPtr cfg=isc::data::ConstElementPtr()) const
Writes current configuration to specified file.
static std::string getVersion(bool extended)
returns Kea version on stdout and exits.
static void setVerbose(const bool verbose)
Sets or clears verbose mode.
std::string getPIDFileName() const
Returns the current PID file name.
virtual std::list< std::list< std::string > > jsonPathsToRedact() const
Return a list of all paths that contain passwords or secrets.
Daemon()
Default constructor.
virtual void shutdown()
Initiates shutdown procedure for the whole server.
std::string getPIDFileDir() const
Returns the directory used when forming default PID file name.
virtual ~Daemon()
Destructor.
isc::asiolink::IOSignalSetPtr signal_set_
A pointer to the object installing custom signal handlers.
static void configureLogger(const isc::data::ConstElementPtr &log_config, const isc::process::ConfigPtr &storage)
Configures logger.
boost::posix_time::ptime start_
Timestamp of the start of the daemon.
static bool getVerbose()
Returns if running in verbose mode.
static void loggerInit(const char *log_name, bool verbose)
Initializes logger.
static std::string getProcName()
returns the process name This value is used as when forming the default PID file name
void setExitValue(int value)
Sets the exit value.
virtual void cleanup()
Performs final deconfiguration.
isc::data::ConstElementPtr redactConfig(isc::data::ConstElementPtr const &config)
Redact a configuration.
void checkConfigFile() const
Checks the configuration file name.
static void setDefaultLoggerName(const std::string &logger)
Sets the default logger name.
void setPIDFileName(const std::string &pid_file_name)
Sets PID file name.
static void setProcName(const std::string &proc_name)
Sets the process name.
int getExitValue()
Fetches the exit value.
void createPIDFile(int pid=0)
Creates the PID file.
void setPIDFileDir(const std::string &pid_file_dir)
Sets the PID file directory.
static std::string getDefaultLoggerName()
Returns default logger name.
std::string makePIDFileName() const
Manufacture the pid file name.
void setConfigFile(const std::string &config_file)
Sets the configuration file name.
boost::shared_ptr< IOSignalSet > IOSignalSetPtr
Defines a pointer to an IOSignalSet.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the ConfigBase.
boost::shared_ptr< PIDFile > PIDFilePtr
Defines a shared pointer to a PIDFile.
Defines the logger used by the top-level component of kea-lfc.