File src/cmd_stop.c

Stops either a particular UBS daemon, or stops all known running daemons. This will NOT clean up after the daemons; they should do that on their own.


Included Files


Global Variable PROCNAME

char PROCNAME[128]
Included from include/ubs.h

Global Variable CUR_TIME

struct tm* CUR_TIME
Included from include/ubs.h

Global Variable GLOBAL

ubs_table GLOBAL
Included from include/ubs.h

Global Variable LOGLEVEL

int LOGLEVEL
Included from include/ubs.h

Global Function cmd_stop()

Stop a daemon

int cmd_stop ( int cmdc, char** cmdv )

int cmd_stop
Returns OK on success, NO_DIR if bin/ can't be opened, or otherwise whatever sub_stop_proc() returns.
int cmdc
Number of arguments
char** cmdv
Argument vector
Prototyped in: include/ubs-main.h
Calls: sub_help_cmd()src/cmd_help.c
  sub_stop_proc()src/cmd_stop.c
  closedir(), getopt(), opendir(), printf(), readdir(), strcasecmp(), strncmp()

Global Function sub_stop_proc()

Start up an individual daemon by name, where name is "PREFIX/bin/NAME"

int sub_stop_proc ( char* proc, int format )

int sub_stop_proc
Returns OK on success, NO_FILE if the .pid file cannot be read, NO_SIGNAL if the process cannot be killed, and NO_PERMS if kill reports it does not have sufficient privileges.
char* proc
The process name
int format
 
Prototyped in: include/ubs-main.h
Calls: __errno_location(), atoi(), fclose(), fgets(), fopen(), kill(), printf(), snprintf()
Called by: cmd_restart()src/cmd_restart.c
  cmd_stop()src/cmd_stop.c