diff --git a/src/services.js b/src/services.js index 6afa87d25..9a0851d53 100644 --- a/src/services.js +++ b/src/services.js @@ -1825,7 +1825,12 @@ function startGraphite(existingInfra, serviceConfig, callback) { shell.sudo('removeGraphiteDir', [ RMADDONDIR_CMD, 'graphite' ], {}, done); }, shell.exec.bind(null, 'startGraphite', cmd) - ], callback); + ], function (error) { + // restart collectd to get the disk stats after graphite starts. currently, there is no way to do graphite health check + if (!error) setTimeout(() => shell.sudo('restartcollectd', [ RESTART_SERVICE_CMD, 'collectd' ], {}, NOOP_CALLBACK), 60000); + + callback(error); + }); } function setupProxyAuth(app, options, callback) { @@ -2156,10 +2161,7 @@ function restartGraphite(callback) { docker.restartContainer('graphite', callback); - setTimeout(function () { - // wait for graphite to startup and then restart collectd. graphite migrations can be quite slow! - shell.sudo('restartcollectd', [ RESTART_SERVICE_CMD, 'collectd' ], {}, NOOP_CALLBACK); - }, 60000); + setTimeout(() => shell.sudo('restartcollectd', [ RESTART_SERVICE_CMD, 'collectd' ], {}, NOOP_CALLBACK), 60000); } function teardownOauth(app, options, callback) {