ARB
Classes | Macros | Functions | Variables
servercntrl.cxx File Reference
#include <servercntrl.h>
#include <client_privat.h>
#include <client.h>
#include <arbdb.h>
#include <arb_file.h>
#include <arb_sleep.h>
#include <ut_valgrinded.h>
Include dependency graph for servercntrl.cxx:

Go to the source code of this file.

Classes

struct  gl_struct
 

Macros

#define TRIES   1
 

Functions

void make_async_call (char *&command)
 
charcreateCallOnSocketHost (const char *host, const char *remotePrefix, const char *command, SpawnMode spawnmode, const char *logfile)
 
GB_ERROR arb_start_server (const char *arb_tcp_env, int do_sleep)
 
static GB_ERROR arb_wait_for_server (const char *arb_tcp_env, const char *tcp_id, int magic_number, struct gl_struct *serverctrl, int wait)
 
GB_ERROR arb_look_and_start_server (long magic_number, const char *arb_tcp_env)
 
GB_ERROR arb_look_and_kill_server (int magic_number, const char *arb_tcp_env)
 
void arb_print_server_params ()
 
arb_paramsarb_trace_argv (int *argc, const char **argv)
 
void free_arb_params (arb_params *params)
 

Variables

static struct gl_struct glservercntrl
 

Macro Definition Documentation

#define TRIES   1

Definition at line 54 of file servercntrl.cxx.

Function Documentation

void make_async_call ( char *&  command)
inline

Definition at line 66 of file servercntrl.cxx.

References GBS_global_string_copy().

Referenced by createCallOnSocketHost().

char* createCallOnSocketHost ( const char host,
const char remotePrefix,
const char command,
SpawnMode  spawnmode,
const char logfile 
)

transforms a shell-command

  • use ssh if host is not local
  • add wrappers for detached execution
    Parameters
    hostsocket specification (may be 'host:port', 'host' or ':portOrSocketfile')
    remotePrefixprefixed to command if it is executed on remote host (e.g. "$ARBHOME/bin/" -> uses value of environment variable ARBHOME on remote host!)
    commandthe shell command to execute
    spawnmodehow to spawn: WAIT_FOR_TERMINATION = run "command" SPAWN_ASYNCHRONOUS = run "( command ) &" SPAWN_DAEMONIZED = do not forward kill signals, remove from joblist and redirect output to logfile
    logfileuse with SPAWN_DAEMONIZED (mandatory; NULp otherwise)
    Returns
    a SSH system call for remote hosts and direct system calls for the local machine

Definition at line 70 of file servercntrl.cxx.

References arb_assert, ARB_strdup(), ARB_strpartdup(), GB_host_is_local(), GBK_singlequote(), GBS_global_string(), GBS_global_string_copy(), make_async_call(), make_valgrinded_call, NULp, SPAWN_ASYNCHRONOUS, SPAWN_DAEMONIZED, and WAIT_FOR_TERMINATION.

Referenced by arb_start_server(), and pd_query_pt_server().

GB_ERROR arb_start_server ( const char arb_tcp_env,
int  do_sleep 
)
static GB_ERROR arb_wait_for_server ( const char arb_tcp_env,
const char tcp_id,
int  magic_number,
struct gl_struct serverctrl,
int  wait 
)
static
GB_ERROR arb_look_and_start_server ( long  magic_number,
const char arb_tcp_env 
)
GB_ERROR arb_look_and_kill_server ( int  magic_number,
const char arb_tcp_env 
)
void arb_print_server_params ( void  )

Definition at line 339 of file servercntrl.cxx.

Referenced by show_help(), and usage().

arb_params* arb_trace_argv ( int argc,
const char **  argv 
)
void free_arb_params ( arb_params params)

Variable Documentation

struct gl_struct glservercntrl
static