19 : filename_(filename) {
27 std::ifstream fs(filename_.c_str());
49 if (kill(pid, 0) == 0) {
64 std::ofstream fs(filename_.c_str(), std::ofstream::trunc);
68 << filename_ <<
"' for write");
72 fs << pid << std::endl;
74 bool good = fs.good();
85 if ((
remove(filename_.c_str()) != 0) &&
void deleteFile() const
Delete the PID file.
int check() const
Read the PID in from the file and check it.
Exception thrown when an error occurs during PID file processing.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void write() const
Get PID of the current process and write it to the file.
Defines the logger used by the top-level component of kea-dhcp-ddns.
PIDFile(const std::string &filename)
Constructor.
Exception thrown when an error occurs trying to read a PID from an opened file.