Function Daemon::daemonize(std::string, std::string, std::string, std::string, std::string)

Function Documentation

int Daemon::daemonize(std::string name, std::string path, std::string outfile, std::string errfile, std::string infile)

this function will daemonize a process

This function is overloaded

This version is for backwards compatibility with functions that were written prior to adding the closefd boolean argument. If that arg is missing then this will call the new function with closefd=true. I.E., the default is to close all file descriptors.

Parameters:
  • name[in] the name for this daemon

  • path[in] directory to chdir to when running daemon

  • outfile[in] where to direct stdout, /dev/null by default

  • errfile[in] where to direct stderr, /dev/null by default

  • infile[in] stdin, /dev/null by default

Returns:

0