MXS-1405: Execute EXTERNCMD synchronously

The execution of external commands in MaxScale by monitors needs to be
synchronous in order to prevent the unintended detection of state changes.
This commit is contained in:
Markus Mäkelä
2017-09-13 22:47:58 +03:00
parent efb1e541e2
commit 4f7606ebc0
3 changed files with 71 additions and 49 deletions

View File

@ -22,10 +22,11 @@ MXS_BEGIN_DECLS
typedef struct extern_cmd_t
{
char** argv; /*< Argument vector for the command, first being the actual command
* being executed. */
int n_exec; /*< Number of times executed */
pid_t child; /*< PID of the child process */
char** argv; /**< Argument vector for the command, first being the
* actual command being executed */
int n_exec; /**< Number of times executed */
pid_t child; /**< PID of the child process */
uint32_t timeout; /**< Command timeout in seconds */
} EXTERNCMD;
char* externcmd_extract_command(const char* argstr);