summaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2019-03-14 19:15:09 +0000
committerArne Juul <arnej@yahoo-inc.com>2019-03-14 19:15:09 +0000
commit33bb16aa777b63646f7577be48d6b7994eb880de (patch)
treed41f2701119d0431a79e84ea1e5887bebf126476 /configd
parentff201447a3e3d1ef22232742c99ea0aa7ab72718 (diff)
stop modeling autostart / autorestart
* these flags are always true, so no need to configure them
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/service.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/configd/src/apps/sentinel/service.cpp b/configd/src/apps/sentinel/service.cpp
index ebf96d2ed53..20c2a6c9b00 100644
--- a/configd/src/apps/sentinel/service.cpp
+++ b/configd/src/apps/sentinel/service.cpp
@@ -49,14 +49,10 @@ Service::Service(const SentinelConfig::Service& service, const SentinelConfig::A
_metrics(metrics)
{
LOG(debug, "%s: created", name().c_str());
- LOG(debug, "autostart: %s", _config->autostart ? "YES" : "NO");
- LOG(debug, " restart: %s", _config->autorestart ? "YES" : "NO");
LOG(debug, " command: %s", _config->command.c_str());
LOG(debug, " configid: %s", _config->id.c_str());
- if (_config->autostart) {
- start();
- }
+ start();
}
void
@@ -67,14 +63,6 @@ Service::reconfigure(const SentinelConfig::Service& config)
"take effect at next restart", name().c_str(),
_config->command.c_str(), config.command.c_str());
}
- if (config.autostart != _config->autostart) {
- LOG(debug, "%s: reconfigured autostart %s", name().c_str(),
- config.autostart ? "OFF -> ON" : "ON -> OFF");
- }
- if (config.autorestart != _config->autorestart) {
- LOG(debug, "%s: reconfigured autorestart %s", name().c_str(),
- config.autorestart ? "OFF -> ON" : "ON -> OFF");
- }
if (config.id != _config->id) {
LOG(warning, "%s: reconfigured config id '%s' -> '%s' - signaling service restart",
name().c_str(), _config->id.c_str(), config.id.c_str());
@@ -85,8 +73,7 @@ Service::reconfigure(const SentinelConfig::Service& config)
_config = new SentinelConfig::Service(config);
if (_isAutomatic
- && ((_config->autostart && _state == READY)
- || (_config->autorestart && _state == FINISHED)))
+ && ((_state == READY) || (_state == FINISHED)))
{
LOG(debug, "%s: Restarting due to new config", name().c_str());
start();
@@ -334,9 +321,9 @@ Service::youExited(int status)
} else if (_state == KILLING) {
setState(KILLED);
}
- if (_isAutomatic && _config->autorestart && !stop()) {
+ if (_isAutomatic && !stop()) {
// ### Implement some rate limiting here maybe?
- LOG(debug, "%s: Has autorestart flag, restarting.", name().c_str());
+ LOG(debug, "%s: Restarting.", name().c_str());
setState(READY);
_metrics.totalRestartsCounter++;
_metrics.sentinel_restarts.add();