control.c File Reference

Methods for controlling processes managed by monit. More...

Go to the source code of this file.

Functions

void control (char *action)
 Start/stop all processes in process list.

void control_group (char *G, char *action)
void d_check_process (char *P, char *action)
 Pass on to methods in http/cervlet.c to start/stop processes.

void check_process (char *P, char *action)
 Check to see if we should try to start/stop process.

void reset_depend ()


Detailed Description

Methods for controlling processes managed by monit.

Author:
Jan-Henrik Haukeland, <hauk@tildeslash.com> , Rory Toma, <rory@digeo.com> , Martin Pala, <martin.pala@iol.cz>
Version:
$Id: control.c,v 1.44 2003/02/14 08:22:33 martinp Exp $

Definition in file control.c.


Function Documentation

void check_process char *    P,
char *    action
 

Check to see if we should try to start/stop process.

Parameters:
P  A process name as stated in the config file
action  A string describing the action to execute

Definition at line 194 of file control.c.

References ASSERT, myrun::controlfile, myrun::debug, myprocess::do_validate, END_LOCK, error(), get_process(), is, is_process_running(), LOCK, log(), myrun::mutex, myprocess::name, prog, Run, myprocess::start, and myprocess::stop.

Referenced by control(), and control_group().

void control char *    action
 

Start/stop all processes in process list.

Parameters:
action  A string describing the action to execute

Definition at line 71 of file control.c.

References ASSERT, check_process(), d_check_process(), exist_daemon(), myprocess::name, myprocess::next, processlist, reset_depend(), and myprocess::visited.

void control_group char *    G,
char *    action
 

Definition at line 97 of file control.c.

References ASSERT, check_process(), d_check_process(), exist_daemon(), myprocess::group, is, myprocess::name, myprocess::next, processlist, reset_depend(), and myprocess::visited.

void d_check_process char *    P,
char *    action
 

Pass on to methods in http/cervlet.c to start/stop processes.

Parameters:
P  A process name as stated in the config file
action  A string describing the action to execute

Definition at line 126 of file control.c.

References ASSERT, myrun::bind_addr, close_socket(), close_ssl_socket(), create_socket(), delete_ssl_socket(), embed_ssl_socket(), error(), get_basic_authentication_header(), myrun::httpdport, myrun::httpdssl, myrun::httpsslpem, new_ssl_connection(), prog, Run, send_ssl_socket(), sock_send(), ssl_connection, and SSL_VERSION_AUTO.

Referenced by control(), and control_group().

void reset_depend  
 

Definition at line 267 of file control.c.

References myprocess::depend_visited, myprocess::next, processlist, and myprocess::visited.

Referenced by control(), control_group(), and validate().