Logo Search packages:      
Sourcecode: condor version File versions  Download package

DaemonCore Class Reference

#include <condor_daemon_core.h>

Inheritance diagram for DaemonCore:

Service

List of all members.


Detailed Description

This class badly needs documentation, doesn't it? This file contains the definition for class DaemonCore. This is the central structure for every daemon in Condor. The daemon core triggers preregistered handlers for corresponding events. class Service is the base class of the classes that daemon_core can serve. In order to use a class with the DaemonCore, it has to be a derived class of Service.

Definition at line 263 of file condor_daemon_core.h.


Reaper events.

int Cancel_Reaper (int rid)
int Register_Reaper (const char *reap_descript, ReaperHandlercpp handlercpp, const char *handler_descrip, Service *s)
int Register_Reaper (const char *reap_descrip, ReaperHandler handler, const char *handler_descrip, Service *s=NULL)
int Reset_Reaper (int rid, const char *reap_descript, ReaperHandlercpp handlercpp, const char *handler_descrip, Service *s)
int Reset_Reaper (int rid, const char *reap_descrip, ReaperHandler handler, const char *handler_descrip, Service *s=NULL)
void Set_Default_Reaper (int reaper_id)
int Was_Not_Responding (pid_t pid)
static const char * GetExceptionString (int signal)

Public Member Functions

int AddAllowHost (const char *host, DCpermission perm)
bool CheckConfigAttrSecurity (const char *attr, Sock *sock)
bool CheckConfigSecurity (const char *config, Sock *sock)
void clearSession (pid_t pid)
int Continue_Family (pid_t)
bool cookie_is_valid (const unsigned char *data)
 DaemonCore (int PidSize=0, int ComSize=0, int SigSize=0, int SocSize=0, int ReapSize=0, int PipeSize=0)
void Driver ()
void Dump (int flag, const char *indent=NULL)
void Forked_Child_Wants_Exit_By_Exec (bool exit_by_exec)
bool get_cookie (int &len, unsigned char *&data)
int Get_Family_Usage (pid_t, ProcFamilyUsage &, bool full=false)
CollectorList * getCollectorList (void)
Stream ** GetInheritedSocks ()
bool GetPeacefulShutdown ()
void invalidateSessionCache ()
int Kill_Family (pid_t)
void Proc_Family_Cleanup ()
void Proc_Family_Init ()
void publish (ClassAd *ad)
void reconfig ()
void refreshDNS ()
priv_state Register_Priv_State (priv_state priv)
void RegisterTimeSkipCallback (TimeSkipFunc fnc, void *data)
int sendUpdates (int cmd, ClassAd *ad1, ClassAd *ad2=NULL, bool nonblock=false)
bool set_cookie (int len, const unsigned char *data)
void SetPeacefulShutdown (bool value)
int Suspend_Family (pid_t)
void UnregisterTimeSkipCallback (TimeSkipFunc fnc, void *data)
void UpdateLocalAd (ClassAd *daemonAd)
int Verify (char const *command_descrip, DCpermission perm, const struct sockaddr_in *sin, const char *fqu)
void WantSendChildAlive (bool send_alive)
bool wantsRestart (void)
Signal events
int Block_Signal (int sig)
int Cancel_Signal (int sig)
int Register_Signal (int sig, const char *sig_descript, SignalHandlercpp handlercpp, const char *handler_descrip, Service *s)
int Register_Signal (int sig, const char *sig_descrip, SignalHandler handler, const char *handler_descrip, Service *s=NULL)
bool Send_Signal (pid_t pid, int sig)
void Send_Signal_nonblocking (classy_counted_ptr< DCSignalMsg > msg)
int Unblock_Signal (int sig)
Socket events.
void CallSocketHandler (Stream *sock, bool default_to_HandleCommand=false)
int Cancel_And_Close_All_Sockets (void)
 Cancel and close all registed sockets.
int Cancel_Socket (Stream *insock)
int FileDescriptorSafetyLimit ()
int Lookup_Socket (Stream *iosock)
int Register_Command_Socket (Stream *iosock, const char *descrip=NULL)
int Register_Socket (Stream *iosock, const char *iosock_descrip, SocketHandlercpp handlercpp, const char *handler_descrip, Service *s, DCpermission perm=ALLOW)
int Register_Socket (Stream *iosock, const char *iosock_descrip, SocketHandler handler, const char *handler_descrip, Service *s=NULL, DCpermission perm=ALLOW)
int RegisteredSocketCount ()
bool TooManyRegisteredSockets (int fd=-1, MyString *msg=NULL, int num_fds=1)
Pipe events.
int Cancel_And_Close_All_Pipes (void)
 Cancel and close all pipes.
int Cancel_Pipe (int pipe_end)
int Close_FD (int fd)
int Close_Pipe (int pipe_end)
bool Close_Stdin_Pipe (int pid)
int Create_Pipe (int *pipe_ends, bool can_register_read=false, bool can_register_write=false, bool nonblocking_read=false, bool nonblocking_write=false, unsigned int psize=4096)
int Get_Max_Pipe_Buffer ()
int Get_Pipe_FD (int pipe_end, int *fd)
int Inherit_Pipe (int p, bool write, bool can_register, bool nonblocking, int psize=4096)
int Read_Pipe (int pipe_end, void *buffer, int len)
MyStringRead_Std_Pipe (int pid, int std_fd)
int Register_Pipe (int pipe_end, const char *pipe_descrip, PipeHandlercpp handlercpp, const char *handler_descrip, Service *s, HandlerType handler_type=HANDLE_READ, DCpermission perm=ALLOW)
int Register_Pipe (int pipe_end, const char *pipe_descrip, PipeHandler handler, const char *handler_descrip, Service *s=NULL, HandlerType handler_type=HANDLE_READ, DCpermission perm=ALLOW)
int Write_Pipe (int pipe_end, const void *buffer, int len)
int Write_Stdin_Pipe (int pid, const void *buffer, int len)
Command Events
int Cancel_Command (int command)
int InfoCommandPort ()
char * InfoCommandSinfulString (int pid=-1)
char * InfoCommandSinfulStringMyself (bool usePrivateAddress)
PidEnvID * InfoEnvironmentID (PidEnvID *penvid, int pid=-1)
int InServiceCommandSocket ()
const char * privateNetworkIpAddr (void)
const char * privateNetworkName (void)
const char * publicNetworkIpAddr (void)
int Register_Command (int command, const char *com_descript, CommandHandlercpp handlercpp, const char *handler_descrip, Service *s, DCpermission perm=ALLOW, int dprintf_flag=D_COMMAND)
int Register_Command (int command, const char *com_descrip, CommandHandler handler, const char *handler_descrip, Service *s=NULL, DCpermission perm=ALLOW, int dprintf_flag=D_COMMAND)
int ServiceCommandSocket ()
Timer events.
int Cancel_Timer (int id)
int Register_Timer (Timeslice timeslice, Eventcpp event, const char *event_descrip, Service *s)
int Register_Timer (unsigned deltawhen, unsigned period, Eventcpp event, const char *event_descrip, Service *s)
int Register_Timer (unsigned deltawhen, Eventcpp event, const char *event_descrip, Service *s)
int Register_Timer (unsigned deltawhen, unsigned period, Event event, const char *event_descrip, Service *s=NULL)
int Register_Timer (unsigned deltawhen, Event event, Release release, const char *event_descrip, Service *s=NULL)
int Register_Timer (unsigned deltawhen, Event event, const char *event_descrip, Service *s=NULL)
int Reset_Timer (int id, unsigned when, unsigned period=0)
Process management.
These work on any process, not just daemon core processes.

int Continue_Process (pid_t pid)
int Create_Process (const char *name, ArgList const &arglist, priv_state priv=PRIV_UNKNOWN, int reaper_id=1, int want_commanand_port=TRUE, Env const *env=NULL, const char *cwd=NULL, FamilyInfo *family_info=NULL, Stream *sock_inherit_list[]=NULL, int std[]=NULL, int fd_inherit_list[]=NULL, int nice_inc=0, sigset_t *sigmask=NULL, int job_opt_mask=0, size_t *core_hard_limit=NULL)
pid_t getpid ()
pid_t getppid ()
int Is_Pid_Alive (pid_t pid)
bool ProcessExitedButNotReaped (pid_t pid)
int Shutdown_Fast (pid_t pid, bool want_core=false)
int Shutdown_Graceful (pid_t pid)
int Suspend_Process (pid_t pid)
Thread management.
int Continue_Thread (int tid)
int Create_Thread (ThreadStartFunc start_func, void *arg=NULL, Stream *sock=NULL, int reaper_id=1)
bool DoFakeCreateThread ()
int Kill_Thread (int tid)
int Suspend_Thread (int tid)
Data pointer functions.
These functions deal with associating a pointer to data with a registered callback.

void * GetDataPtr ()
int Register_DataPtr (void *data)
int SetDataPtr (void *data)
Key management.
IpVerifygetIpVerify ()
KeyCache * getKeyCache ()
SecMan * getSecMan ()

Public Attributes

char * localAdFile
MapFile * mapfile
SelfMonitorData monitor_data
int soap_ssl_sock

Static Public Attributes

static const int ERRNO_EXEC_AS_ROOT = 666666
static const int ERRNO_EXIT = 666669
static const int ERRNO_PID_COLLISION = 666667
static const int ERRNO_REGISTRATION_FAILED = 666668

Private Types

typedef HashTable< pid_t,
PidEntry * > 
PidHashTable
typedef int PipeHandle
typedef struct WaitpidEntry_s WaitpidEntry

Private Member Functions

void CallReaper (int reaper_id, char const *whatexited, pid_t pid, int exit_status)
void CallSocketHandler (int &i, bool default_to_HandleCommand)
void CheckForTimeSkip (time_t time_before, time_t okay_delta)
void CheckPrivState (void)
void decrementPendingSockets ()
void DumpCommandTable (int, const char *=NULL)
void DumpReapTable (int, const char *=NULL)
void DumpSigTable (int, const char *=NULL)
void DumpSocketTable (int, const char *=NULL)
void DumpTimerList (int, const char *=NULL)
bool evalExpr (ClassAd *ad, const char *param_name, const char *attr_name, const char *message)
void free_descrip (char *p)
MyString GetCommandsInAuthLevel (DCpermission perm)
int GetRegisteredSocketIndex (Stream *sock)
int HandleChildAliveCommand (int command, Stream *stream)
int HandleDC_SERVICEWAITPIDS (int sig)
int HandleDC_SIGCHLD (int sig)
int HandleProcessExit (pid_t pid, int exit_status)
int HandleProcessExitCommand (int command, Stream *stream)
int HandleReq (Stream *insock)
int HandleReq (int socki)
int HandleReqSocketHandler (Stream *stream)
int HandleReqSocketTimerHandler ()
int HandleSig (int command, int sig)
int HandleSigCommand (int command, Stream *stream)
int HungChildTimeout ()
void incrementPendingSockets ()
void Inherit (void)
void initCollectorList (void)
void InitDCCommandSocket (int command_port)
bool InitSettableAttrsList (const char *subsys, int i)
void InitSettableAttrsLists (void)
int pipeHandleTableInsert (PipeHandle)
int pipeHandleTableLookup (int, PipeHandle *=NULL)
void pipeHandleTableRemove (int)
int Register_Command (int command, const char *com_descip, CommandHandler handler, CommandHandlercpp handlercpp, const char *handler_descrip, Service *s, DCpermission perm, int dprintf_flag, int is_cpp)
bool Register_Family (pid_t child_pid, pid_t parent_pid, int max_snapshot_interval, PidEnvID *penvid, const char *login, gid_t *group, const char *glexec_proxy)
int Register_Pipe (int pipefd, const char *pipefd_descrip, PipeHandler handler, PipeHandlercpp handlercpp, const char *handler_descrip, Service *s, HandlerType handler_type, DCpermission perm, int is_cpp)
int Register_Reaper (int rid, const char *reap_descip, ReaperHandler handler, ReaperHandlercpp handlercpp, const char *handler_descrip, Service *s, int is_cpp)
int Register_Signal (int sig, const char *sig_descip, SignalHandler handler, SignalHandlercpp handlercpp, const char *handler_descrip, Service *s, int is_cpp)
int Register_Socket (Stream *iosock, const char *iosock_descrip, SocketHandler handler, SocketHandlercpp handlercpp, const char *handler_descrip, Service *s, DCpermission perm, int is_cpp)
void send_invalidate_session (const char *sinful, const char *sessid)
void Send_Signal (classy_counted_ptr< DCSignalMsg > msg, bool nonblocking)
int SendAliveToParent ()

Static Private Member Functions

static char ** ParseArgsString (const char *env)

Private Attributes

unsigned char * _cookie_data
unsigned char * _cookie_data_old
int _cookie_len
int _cookie_len_old
int async_pipe [2]
volatile bool async_pipe_empty
volatile int async_sigs_unblocked
CommandEnt * comTable
void ** curr_dataptr
void ** curr_regdataptr
ReliSock * dc_rsock
SafeSockdc_ssock
priv_state Default_Priv_State
int defaultReaper
int file_descriptor_safety_limit
StreaminheritedSocks [MAX_SOCKS_INHERITED+1]
int initial_command_sock
int inServiceCommandSocket_flag
CollectorList * m_collector_list
bool m_fake_create_thread
bool m_in_daemon_shutdown
bool m_in_daemon_shutdown_fast
bool m_invalidate_sessions_via_tcp
char * m_private_network_name
ProcFamilyInterface * m_proc_family
int m_refresh_dns_timer
List< TimeSkipWatcher > m_TimeSkipWatchers
bool m_want_send_child_alive
bool m_wants_dc_udp
bool m_wants_restart
unsigned int max_hang_time
int maxCommand
int maxPipe
int maxPipeBuffer
int maxPipeHandleIndex
int maxReap
int maxSig
int maxSocket
pid_t mypid
int nCommand
struct in_addr negotiator_sin_addr
int nPendingSockets
int nPipe
int nReap
int nSig
int nSock
bool peaceful_shutdown
PidHashTable * pidTable
ExtArray< PipeHandle > * pipeHandleTable
ExtArray< PipeEnt > * pipeTable
pid_t ppid
ReapEnt * reapTable
SecMan * sec_man
int send_child_alive_timer
volatile int sent_signal
StringList * SettableAttrsLists [LAST_PERM]
SignalEnt * sigTable
struct soap * soap
ExtArray< SockEnt > * sockTable
Queue< WaitpidEntry > WaitpidQueue

Static Private Attributes

static TimerManager t

Friends

class CreateProcessForkit
class FakeCreateThreadReaperCaller
int main (int, char **)
class TimerManager

Classes

struct  CommandEnt
class  PidEntry
struct  PipeEnt
struct  ReapEnt
struct  SignalEnt
struct  SockEnt
struct  TimeSkipWatcher
struct  WaitpidEntry_s

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

Generated by  Doxygen 1.6.0   Back to index