14 #include <boost/noncopyable.hpp> 49 class 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_;
void setPIDFileName(const std::string &pid_file_name)
Sets PID file name.
boost::shared_ptr< SignalSet > SignalSetPtr
Pointer to the isc::util::SignalSet.
virtual void handleSignal()
Invokes handler for the next received signal.
static std::string getDefaultLoggerName()
Returns default logger name.
void checkConfigFile() const
Checks the configuration file name.
std::string getProcName() const
returns the process name This value is used as when forming the default PID file name
virtual void shutdown()
Initiates shutdown procedure for the whole DHCPv6 server.
isc::util::SignalSetPtr signal_set_
A pointer to the object installing custom signal handlers.
virtual void cleanup()
Performs final deconfiguration.
virtual ~Daemon()
Destructor.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
std::string getConfigFile() const
Returns config file name.
static void setDefaultLoggerName(const std::string &logger)
Sets the default logger name.
void setProcName(const std::string &proc_name)
Sets the process name.
void setConfigFile(const std::string &config_file)
Sets the configuration file name.
boost::shared_ptr< const Element > ConstElementPtr
static std::string getVersion(bool extended)
returns Kea version on stdout and exits.
static void setVerbose(const bool verbose)
Sets or clears verbose mode.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
isc::log::Logger logger("asiodns")
Use the ASIO logger.
std::string getPIDFileName() const
Returns the current PID file name.
static void loggerInit(const char *log_name, bool verbose)
Initializes logger.
virtual size_t writeConfigFile(const std::string &config_file, isc::data::ConstElementPtr cfg=isc::data::ConstElementPtr()) const
Writes current configuration to specified file.
boost::function< void(int signum)> SignalHandler
Pointer to the signal handling function.
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)
static bool getVerbose()
Returns if running in verbose mode.
isc::util::SignalHandler signal_handler_
Pointer to the common signal handler invoked by the handleSignal function.
void setPIDFileDir(const std::string &pid_file_dir)
Sets the PID file directory.
Exception thrown when a the PID file points to a live PID.
std::string getPIDFileDir() const
Returns the directory used when forming default PID file name.
void createPIDFile(int pid=0)
Creates the PID file.
Daemon()
Default constructor.
std::string makePIDFileName() const
Manufacture the pid file name.
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the SrvConfig.
static void configureLogger(const isc::data::ConstElementPtr &log_config, const isc::process::ConfigPtr &storage)
Configures logger.