OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <signal.h>
#include <sys/wait.h>
#include <cstring>
#include <cstdlib>
#include <cerrno>
#include <sstream>
#include <iostream>
#include <fstream>
#include <map>
#include "DaemonCommandHandler.h"
#include "Connection.h"
#include "Socket.h"
#include "PPTStreamBuf.h"
#include "PPTProtocol.h"
#include "BESXMLUtils.h"
#include "BESInternalFatalError.h"
#include "BESInternalError.h"
#include "BESSyntaxUserError.h"
#include "BESDebug.h"
#include "BESFSFile.h"
#include "BESFSDir.h"
#include "TheBESKeys.h"
#include "BESXMLWriter.h"
#include "BESDaemonConstants.h"
Go to the source code of this file.
Functions | |
int | start_master_beslistener () |
Start the 'master beslistener' and return its PID. More... | |
bool | stop_all_beslisteners (int) |
Stop all of the listeners (both the master listener and all of the child listeners that actually process requests). More... | |
void | unblock_signals () |
See block_signals() More... | |
Variables | |
int | master_beslistener_status |
int start_master_beslistener | ( | ) |
Start the 'master beslistener' and return its PID.
This function also sets the global 'master_beslistener_pid' so that other code in this file (like the signal handlers) can have access to it. It starts the beslistener using the global 'arguments' that is a copy of the arguments passed to this daemon.
Definition at line 314 of file daemon.cc.
References BESDEBUG, BESLISTENER_PIPE_FD, BESLISTENER_RUNNING, PPTServer::closeConnection(), master_beslistener_status, and update_beslistener_args().
Referenced by main().
bool stop_all_beslisteners | ( | int | sig | ) |
Stop all of the listeners (both the master listener and all of the child listeners that actually process requests).
A test version of this used the master beslistener's exit status to determine if the daemon should try to restart the master beslistener. That feature is retained so that the daemon can start without listening on the BESDaemonPort, thus eliminating a security issue for sites without a firewall.
Uses the master bestistener's process group to send 'sig' to all of the beslisteners.
sig | Signal to send to all beslisteners. |
Definition at line 217 of file daemon.cc.
References BESDEBUG, block_signals(), master_beslistener_status, and unblock_signals().
void unblock_signals | ( | ) |
See block_signals()
Definition at line 191 of file daemon.cc.
Referenced by ServerApp::run(), and stop_all_beslisteners().
int master_beslistener_status |
Definition at line 94 of file daemon.cc.
Referenced by main(), start_master_beslistener(), and stop_all_beslisteners().