Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

ven96.c File Reference

Detailed Description

XServer main program.

See also:

Definition in file ven96.c.

#include "gen00.h"
#include "heo00.h"
#include "vsp001c.h"
#include "geo007_1.h"
#include "gen003.h"
#include "hsp100.h"
#include "gen32.h"
#include "gen33.h"
#include "hen40.h"
#include "gen41.h"
#include "gen42.h"
#include "gen43.h"
#include "heo46.h"
#include "gen46.h"
#include "gen904.h"
#include "hsp77.h"
#include "RunTime/Diagnose/RTEDiag_Appldiag.h"
#include <poll.h>
#include <sys/resource.h>
#include <pwd.h>
#include <unistd.h>
#include <sys/types.h>
#include "RunTime/RTE_SdbStarter.h"
#include "RunTime/RTE_IniFileHandling.h"
#include "SAPDBCommon/SAPDB_Names.h"

Go to the source code of this file.


struct  updateCommandBuffer_
 buffer used to transfer update command information More...
struct  xserverConnection_


#define DBMSRV_REFERENCE   0x80000000
#define DEFAULT_XSERVER_PROT_SIZE   (64*1024)
#define MAX_ENV_PART   40
#define MF__   MOD__"e96_catchcld"
#define MF__   MOD__"e96_catchsig"
#define MF__   MOD__"e96_catch_alarm"
#define MF__   MOD__"en96_deadCheck"
#define MF__   MOD__"e96_setsig"
#define MF__   MOD__"e96_info_request"
#define MF__   MOD__"en96_transfer"
#define MF__   MOD__"en96_Connect"
#define MF__   MOD__"en96_ServerLoop"
#define MF__   MOD__"en96_OpenListenSocket"
#define MF__   MOD__"en96_GetServerAddress"
#define MF__   MOD__"en96_ChangeDebugLevel"
#define MF__   MOD__"en96_StopServer"
#define MF__   MOD__"en96_main"
#define MOD__   "ven96.c:"
#define MSG1(x_)   if ( en96_debugLevel >= 1 ) MSGD(x_)
#define MSG2(x_)   if ( en96_debugLevel >= 2 ) MSGD(x_)
#define MSG3(x_)   if ( en96_debugLevel >= 3 ) MSGD(x_)
#define MSG4(x_)   if ( en96_debugLevel >= 4 ) MSGD(x_)
#define MSG5(x_)   if ( en96_debugLevel >= 5 ) MSGD(x_)
#define MSG6(x_)   if ( en96_debugLevel >= 6 ) MSGD(x_)
#define MSG7(x_)   if ( en96_debugLevel >= 7 ) MSGD(x_)
#define MSG8(x_)   if ( en96_debugLevel >= 8 ) MSGD(x_)
#define MSG9(x_)   if ( en96_debugLevel >= 9 ) MSGD(x_)
#define NISERVER_START_EN96   2
#define NISERVER_STOP_EN96   4
#define SHOW_AS_KBYTE_EN96   1
#define SHOW_AS_NUMBER_EN96   0
#define SOMAXCONN   5
#define VSP100_CPP   1
#define XSERVER_STOP_REQUEST_REJECTED   "Stop request rejected"


typedef struct xserverConnection_ xserverConnection


enum  vserver_files { vs_protfile = 0, vs_updatepipe = 1, vs_loggerpipe = 2 }


static SAPDB_Bool BuildVserverFilename (enum vserver_files which, SAPDB_Bool oldForm, SAPDB_Char const *portOrServiceSpecified, tsp00_Pathc pathToFill, tsp01_RteError *pRteError)
int c_main_with_envp (int argc, char *argv[], char *envp[])
static SIGNALFUNCTYPE e96_catch_alarm (int sig)
static SIGNALFUNCTYPE e96_catch_sigcld (int sig)
static SIGNALFUNCTYPE e96_catch_signal (int sig)
static int e96_close_on_exec (int fd)
static int e96_info_request (rte_header *header)
static void e96_set_signals (SIGNALFUNCTYPE(*func)())
static int e96_SetSigAction (int sig, void(*handler)(int))
static int en96_ActionMatch (const char *action, char *argument)
static void en96_CallNiServer (int what)
static int en96_ChangeDebugLevel (int newDebugLevel)
 Change debug level of the running server.
static int en96_CheckForUpdateRequest ()
 check the signaled input on update pipe
static int en96_CheckRunningVersion (int *pIsNewer, int *pIsAlreadyStarted)
 use ping request to get running x_servers version and compare against own version
static int en96_Connect ()
static int en96_CreatePathesAndChangeDirectory ()
 create path to niserver, protocol file, protocol pipe and update pipe and change working directory
static SIGNALFUNCTYPE en96_deadCheck (int sig)
static int en96_deadSocketCheck (void *arg)
static int en96_GetServerAddress ()
static int en96_OpenListenSocket (int *isRunning)
 open and bind the socket to listen to
static void en96_ReleaseZombies ()
static int en96_ServerLoop ()
static void en96_ShowEnviron (int argc, char *argv[], char *envp[], SAPDB_Int4 callerUid, SAPDB_Int4 callerGid)
static void en96_ShowReply (tsp00_Int4 replyClassId)
static void en96_ShowRequest (tsp00_Int4 myref)
static void en96_ShowResourceLimit (int what, const char *info, int asKb)
static int en96_StartToListen ()
 start to listen on socket
static int en96_StopServer ()
 Stop the running server.
static int en96_StopXserver ()
static int en96_transfer ()
static int en96_TryToUpdate (int argc, char *argv[])
 inform the running x_server via its update pipe and wait for its response
static void en96_Usage (int longForm)
static int en96_WriteCommandToUpdateFifo (char *commandBuffer, int totalLength)
 write given buffer into update fifo
static int en96_WriteUpdateCallToUpdateFifo (int argc, char *argv[])
 write the update command line


static connection_info * e96_cip
static connection_info e96_connection
static SQL_DBNAMEC e96_remote_db
static int e96_remote_ref
static int e96_remote_swap
static SAPDB_Int8 en96_AcceptCount = 0
static char en96_AcceptId [32] = { 0 }
int en96_debugLevel = 0
static int en96_fastModeSelected = 0
static int en96_foundRunningVersion = false
static xserverConnection en96_ListenSocketInfo
static pid_t en96_masterPid = (pid_t)0
static char en96_niserverPath [sizeof(tsp00_Pathc)+16]
static tsp00_Pathc en96_oldProtfile
static tsp00_Pathc en96_oldProtocolPipePath
static tsp00_Pathc en96_oldUpdateFifoPath
static tsp00_Pathc en96_oldUpdateFifoReplyPath
static pid_t en96_pid = (pid_t)0
static SAPDB_Char en96_processIdString [40]
static tsp00_Pathc en96_protfile
static int en96_protocolPipe = UNDEF
static tsp00_Pathc en96_protocolPipePath
static tsp00_Versionc en96_RTEVersionString
static tsp100_VersionID en96_runningVersionId
static char * en96_service_or_port_specified = 0
static int en96_suppressAutomaticNIServerHandling = 0
static int en96_takeoverSocket = UNDEF
static int en96_updateFifo = UNDEF
static tsp00_Pathc en96_updateFifoPath
static tsp00_Pathc en96_updateFifoReplyPath
static int en96_updateFifoReplyTag = 0
char * PROTFILE = "xserver.prt"
char * PROTOCOLFIFOFILE = "xserver_logger"
int sql22_fd
char * sql22_file
int sql22_keep_open
int sql22_timestamp
char * UPDATEFIFOFILE = "xserver_update"
static char const * vs_filesuffixes [] = { ".prt", "_update", "_logger" }

Generated by  Doxygen 1.6.0   Back to index