ddc
Functions | Variables
ddc_daemon.cpp File Reference
#include "../CommonLib/utilit.h"
#include "../ConcordLib/ConcCommon.h"
#include "../ConcordDmnLib/Corpora.h"
#include <sys/wait.h>
#include <errno.h>
#include <string.h>
#include <sys/resource.h>
#include <syslog.h>
Include dependency graph for ddc_daemon.cpp:

Functions

void PrintUsage ()
 
void RemoveFile (const string &filename)
 
void RemoveLockFiles ()
 
void RemoveLockFile ()
 
void RemoveWaitFile ()
 
void CreateWaitFile ()
 
void UnloadData ()
 
void ShutdownServerSockets ()
 
void termination_handler (int signum)
 
int puke (const std::string &msg)
 
bool read_pid_from_lock_file (pid_t &pid)
 
int print_status ()
 
int do_stop (void)
 
int do_start (bool clientMode=false)
 
int main (int argc, char **argv)
 

Variables

string LockFileName
 
string WaitFileName
 
string CorporaFile
 
string ServerCorporaFile
 
string Action
 
bool doFork
 
bool gotLogLevel =false
 
bool log_stderr =false
 
bool log_syslog =false
 
bool log_files =true
 
char log_label [64]
 
CDDCServerOptions ServerOptions
 
vector< string > ServerOptionsFiles
 
bool LoadedServerOptions = false
 
size_t nWorkers = 0
 
bool got_nWorkers
 
const char * prog = "ddc_daemon"
 

Function Documentation

◆ PrintUsage()

void PrintUsage ( )

References DDCVersionStr, and prog.

Referenced by main().

Here is the caller graph for this function:

◆ RemoveFile()

void RemoveFile ( const string &  filename)

Referenced by RemoveLockFile(), RemoveLockFiles(), and RemoveWaitFile().

Here is the caller graph for this function:

◆ RemoveLockFiles()

void RemoveLockFiles ( )

References LockFileName, RemoveFile(), and WaitFileName.

Here is the call graph for this function:

◆ RemoveLockFile()

void RemoveLockFile ( )

References LockFileName, and RemoveFile().

Referenced by do_start(), do_stop(), main(), puke(), and UnloadData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveWaitFile()

void RemoveWaitFile ( )

References RemoveFile(), and WaitFileName.

Referenced by do_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateWaitFile()

void CreateWaitFile ( )

References StrError(), and WaitFileName.

Referenced by do_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnloadData()

void UnloadData ( )

References FreeConcordDicts(), RemoveLockFile(), SocketDeinitialize(), and UnloadLocalCorporaAndServer().

Referenced by puke(), and termination_handler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShutdownServerSockets()

void ShutdownServerSockets ( )

References ddcLogInfo, ShutdownDDCServer(), and ShutdownLocalCorpora().

Referenced by termination_handler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ termination_handler()

void termination_handler ( int  signum)

References ddcLogInfo, ShutdownServerSockets(), and UnloadData().

Referenced by do_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ puke()

int puke ( const std::string &  msg)

References ddcLogError, RemoveLockFile(), SocketDeinitialize(), and UnloadData().

Referenced by do_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_pid_from_lock_file()

bool read_pid_from_lock_file ( pid_t &  pid)

References LockFileName, and StrError().

Referenced by do_stop(), and print_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_status()

int print_status ( )

References read_pid_from_lock_file().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_stop()

int do_stop ( void  )

References read_pid_from_lock_file(), RemoveLockFile(), and StrError().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_start()

int do_start ( bool  clientMode = false)

◆ main()

int main ( int  argc,
char **  argv 
)

Variable Documentation

◆ LockFileName

string LockFileName

◆ WaitFileName

string WaitFileName

◆ CorporaFile

string CorporaFile

Referenced by do_start(), and main().

◆ ServerCorporaFile

string ServerCorporaFile

Referenced by do_start(), and main().

◆ Action

string Action

Referenced by main().

◆ doFork

bool doFork

Referenced by do_start(), and main().

◆ gotLogLevel

bool gotLogLevel =false

Referenced by do_start(), and main().

◆ log_stderr

bool log_stderr =false

Referenced by do_start(), and main().

◆ log_syslog

bool log_syslog =false

Referenced by do_start(), and main().

◆ log_files

bool log_files =true

Referenced by do_start(), and main().

◆ log_label

char log_label[64]

◆ ServerOptions

CDDCServerOptions ServerOptions

◆ ServerOptionsFiles

vector<string> ServerOptionsFiles

Referenced by main().

◆ LoadedServerOptions

bool LoadedServerOptions = false

◆ nWorkers

size_t nWorkers = 0

◆ got_nWorkers

bool got_nWorkers

Referenced by main().

◆ prog

const char* prog = "ddc_daemon"

Referenced by do_start(), main(), and PrintUsage().