Merge "Make mtcClient stop collectd before shutdown"

This commit is contained in:
Zuul 2021-02-04 14:21:13 +00:00 committed by Gerrit Code Review
commit 57a298ec29
1 changed files with 5 additions and 1 deletions

View File

@ -70,11 +70,15 @@ void stop_pmon( void )
{
/* max pipe command response length */
#define PIPE_COMMAND_RESPON_LEN (100)
ilog("Stopping collectd.");
int rc = system("/usr/local/sbin/pmon-stop collectd");
sleep (2);
ilog("Stopping pmon to prevent process recovery during shutdown");
for ( int retry = 0 ; retry < 5 ; retry++ )
{
char pipe_cmd_output [PIPE_COMMAND_RESPON_LEN] ;
int rc = system("/usr/bin/systemctl stop pmon");
rc = system("/usr/bin/systemctl stop pmon");
sleep(2);
/* confirm pmon is no longer active */