MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CPCD::Process Class Reference

Manages a process. More...

#include <CPCD.hpp>

Collaboration diagram for CPCD::Process:

Public Member Functions

 Process (const Properties &props, class CPCD *cpcd)
 Constructs and empty Process.
void monitor ()
 Monitors the process.
bool isRunning ()
 Checks if the process is running or not.
int start ()
 Starts the process.
void stop ()
 Stops the process.
int readPid ()
 Reads the pid from stable storage.
int writePid (int pid)
 Writes the pid from stable storage.
void print (FILE *)
 Prints a textual description of the process on a file.

Public Attributes

int m_id
BaseString m_name
 The name shown to the user.
BaseString m_group
 Used to group a number of processes.
BaseString m_env
 Environment variables.
BaseString m_path
 Path to the binary to run.
BaseString m_args
 Arguments to the process.
BaseString m_type
 Type of process.
ProcessType m_processType
BaseString m_cwd
 Working directory.
BaseString m_owner
 Owner of the process.
BaseString m_runas
BaseString m_stdin
 redirection for stdin
BaseString m_stdout
 redirection for stdout
BaseString m_stderr
 redirection for stderr
enum ProcessStatus m_status
 Status of the process.
BaseString m_ulimit
 ulimits for process Format c:unlimited d:0 ...
BaseString m_shutdown_options
 shutdown options

Detailed Description

Manages a process.

Definition at line 106 of file CPCD.hpp.

Member Function Documentation

bool CPCD::Process::isRunning ( )

Checks if the process is running or not.

Returns
  • true if the process is running,
  • false if the process is not running

Definition at line 119 of file Process.cpp.

void CPCD::Process::monitor ( )

Monitors the process.

The process is started or stopped as needed.

Definition at line 97 of file Process.cpp.

int CPCD::Process::readPid ( )

Reads the pid from stable storage.

Returns
The pid number

Definition at line 170 of file Process.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int CPCD::Process::start ( )

Starts the process.

Simple fork don't ignore child

PERMANENT

Definition at line 550 of file Process.cpp.

Here is the caller graph for this function:

int CPCD::Process::writePid ( int  pid)

Writes the pid from stable storage.

Returns
  • 0 if successful
  • -1 and sets errno if an error occured

Definition at line 215 of file Process.cpp.

Here is the call graph for this function:

Member Data Documentation

BaseString CPCD::Process::m_args

Arguments to the process.

Note
  • This includes argv[0].
  • If no argv[0] is given, argv[0] will be set to m_path.

Definition at line 191 of file CPCD.hpp.

BaseString CPCD::Process::m_cwd

Working directory.

Working directory the process will start in.

Definition at line 206 of file CPCD.hpp.

BaseString CPCD::Process::m_env

Environment variables.

Environmentvariables to add for the process.

Note
  • The environment cpcd started with is preserved
  • There is no way to delete variables

Definition at line 180 of file CPCD.hpp.

int CPCD::Process::m_id

Id number of the Process.

Note
This is not the same as a pid. This number is used in the protocol, and will not be changed if a processes is restarted.

Definition at line 164 of file CPCD.hpp.

BaseString CPCD::Process::m_owner

Owner of the process.

Note
This will not affect the process' uid or gid; it is only used for managemental purposes.
See Also
m_runas

Definition at line 215 of file CPCD.hpp.

BaseString CPCD::Process::m_runas

Run as

Note
This affects uid
See Also
m_owner

Definition at line 222 of file CPCD.hpp.

BaseString CPCD::Process::m_type

Type of process.

Either set to "interactive" or "permanent".

Definition at line 198 of file CPCD.hpp.


The documentation for this class was generated from the following files: