Make mtcClient stop collectd before shutdown
The collectd process has been seen to segfault in its internal network plugin during system shutdown. This update modifies the mtcClient to stop collectd when it is commanded to reboot the system. Change-Id: I681ff45a2afb1ae66d2a929a64027ea3ed75721e Partial-Bug: 1872979 Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
parent
70e8eae049
commit
2d5c5b04ed
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue