Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

direct/src/autorestart/autorestart.c File Reference

#include "dtool_config.h"
#include "gnu_getopt.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <signal.h>
#include <stdlib.h>

Go to the source code of this file.

Defines

#define TIME_BUFFER_SIZE   128
#define COUNT_RESPAWN   5
#define COUNT_RESPAWN_TIME   30

Functions

void exec_process ()
int spawn_process ()
void sigterm_handler ()
void do_autorestart ()
void double_fork ()
void usage ()
void help ()
int main (int argc, char *argv[])

Variables

char ** params = NULL
char * logfile_name = NULL
int logfile_fd = -1
int stop_on_terminate = 0
pid_t child_pid = 0


Detailed Description

Definition in file autorestart.c.


Define Documentation

#define COUNT_RESPAWN   5
 

Definition at line 51 of file autorestart.c.

Referenced by do_autorestart().

#define COUNT_RESPAWN_TIME   30
 

Definition at line 52 of file autorestart.c.

#define TIME_BUFFER_SIZE   128
 

Definition at line 47 of file autorestart.c.

Referenced by do_autorestart(), and sigterm_handler().


Function Documentation

void do_autorestart  ) 
 

Definition at line 148 of file autorestart.c.

References COUNT_RESPAWN, sigterm_handler(), TIME_BUFFER_SIZE, and time_t.

void double_fork  ) 
 

Definition at line 215 of file autorestart.c.

void exec_process  ) 
 

Definition at line 55 of file autorestart.c.

References NULL, and params.

void help  ) 
 

Definition at line 273 of file autorestart.c.

int main int  argc,
char *  argv[]
 

Definition at line 289 of file autorestart.c.

References logfile_name, optarg, optind, and stop_on_terminate.

void sigterm_handler  ) 
 

Definition at line 121 of file autorestart.c.

References child_pid, TIME_BUFFER_SIZE, and time_t.

Referenced by do_autorestart().

int spawn_process  ) 
 

Definition at line 71 of file autorestart.c.

References child_pid.

void usage  ) 
 

Definition at line 266 of file autorestart.c.


Variable Documentation

pid_t child_pid = 0
 

Definition at line 45 of file autorestart.c.

Referenced by sigterm_handler(), and spawn_process().

int logfile_fd = -1
 

Definition at line 42 of file autorestart.c.

char* logfile_name = NULL
 

Definition at line 41 of file autorestart.c.

Referenced by main().

char** params = NULL
 

Definition at line 40 of file autorestart.c.

Referenced by exec_process().

int stop_on_terminate = 0
 

Definition at line 43 of file autorestart.c.

Referenced by main().


Generated on Fri May 2 01:38:06 2003 for Direct by doxygen1.3