7 #ifndef PROCESS_SPAWN_H
8 #define PROCESS_SPAWN_H
12 #include <boost/noncopyable.hpp>
14 #include <sys/types.h>
16 #include <boost/shared_ptr.hpp>
71 const std::string& executable,
94 pid_t
spawn(
bool dismiss =
false);
143 ProcessSpawnImplPtr impl_;
149 #endif // PROCESS_SPAWN_H
ProcessSpawn(isc::asiolink::IOServicePtr io_service, const std::string &executable, const ProcessArgs &args=ProcessArgs(), const ProcessEnvVars &vars=ProcessEnvVars())
Constructor.
bool isAnyRunning() const
Checks if any of the spawned processes is still running.
pid_t spawn(bool dismiss=false)
Spawn the new process.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
std::string getCommandLine() const
Returns full command line, including arguments, for the process.
bool isRunning(const pid_t pid) const
Checks if the process is still running.
~ProcessSpawn()=default
Destructor.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
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.
Implementation of the ProcessSpawn class.
ProcessSpawnError(const char *file, size_t line, const char *what)
void clearState(const pid_t pid)
Removes the status of the process with a specified PID.
A wrapper interface for the ASIO library.
Exception thrown when error occurs during spawning a process.
boost::shared_ptr< ProcessSpawnImpl > ProcessSpawnImplPtr
Pointer to a ProcessSpawnImpl class.
int getExitStatus(const pid_t pid) const
Returns exit status of the process.
std::vector< std::string > ProcessArgs
Type of the container holding arguments of the executable being run as a background process...
std::vector< std::string > ProcessEnvVars
Type of the container holding environment variables of the executable being run as a background proce...
Utility class for spawning new processes.