File src/cmd_status.c

Shows the status of the UBS daemons.


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_status()

Shows the status. Basically equivilent to displaying all the "ubs-*.status" files.

int cmd_status ( int cmdc, char** cmdv )

int cmd_status
Returns OK on success, NO_DIR if the bin/ directory can't be opened, or otherwise, whatever sub_status_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_status_proc()src/cmd_status.c
  closedir(), getopt(), opendir(), printf(), readdir(), strcasecmp(), strncmp()

Global Function sub_status_proc()

Queries a ubs daemon to see what the current status is. This is done by first opening up the status file (var/PROCNAME.pid), and then attempting to ping_pid() that process. If this can be done, then the nifty little status file (var/PROCNAME.status) is read and redisplayed.

int sub_status_proc ( char* proc, int format )

int sub_status_proc
Returns OK on success. Success is relative, here. Even if the pid file can't be opened, technically, this function has figured out the status, and thus, it was somewhat successful.
char* proc
The process name to query.
int format
The output format.
Prototyped in: include/ubs-main.h
Calls: ping_pid()lib/exec_proc.c
  __errno_location(), fclose(), fgets(), fopen(), printf(), snprintf()
Called by: cmd_status()src/cmd_status.c