14#include <boost/noncopyable.hpp>
49class Daemon :
public boost::noncopyable {
86 static void loggerInit(
const char* log_name,
bool verbose);
209 return (default_logger_name_);
217 default_logger_name_ = logger;
253 std::string config_file_;
256 std::string proc_name_;
260 std::string pid_file_dir_;
266 static bool verbose_;
269 static std::string default_logger_name_;
272 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 a 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.
isc::util::SignalSetPtr signal_set_
A pointer to the object installing custom signal handlers.
static std::string getVersion(bool extended)
returns Kea version on stdout and exits.
static void setVerbose(const bool verbose)
Sets or clears verbose mode.
isc::util::SignalHandler signal_handler_
Pointer to the common signal handler invoked by the handleSignal function.
std::string getPIDFileName() const
Returns the current PID file name.
Daemon()
Default constructor.
virtual void shutdown()
Initiates shutdown procedure for the whole DHCPv6 server.
std::string getPIDFileDir() const
Returns the directory used when forming default PID file name.
virtual ~Daemon()
Destructor.
static void configureLogger(const isc::data::ConstElementPtr &log_config, const isc::process::ConfigPtr &storage)
Configures logger.
virtual void handleSignal()
Invokes handler for the next received signal.
static bool getVerbose()
Returns if running in verbose mode.
static void loggerInit(const char *log_name, bool verbose)
Initializes logger.
virtual void cleanup()
Performs final deconfiguration.
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.
void setProcName(const std::string &proc_name)
Sets the process name.
void createPIDFile(int pid=0)
Creates the PID file.
void setPIDFileDir(const std::string &pid_file_dir)
Sets the PID file directory.
std::string getProcName() const
returns the process name This value is used as when forming the default PID file name
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< const Element > ConstElementPtr
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< PIDFile > PIDFilePtr
Defines a shared pointer to a PIDFile.
boost::shared_ptr< SignalSet > SignalSetPtr
Pointer to the isc::util::SignalSet.
boost::function< void(int signum)> SignalHandler
Pointer to the signal handling function.
Defines the logger used by the top-level component of kea-dhcp-ddns.