MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / redisIsSupervised

Function redisIsSupervised

src/server.cpp:7227–7261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7225}
7226
7227int redisIsSupervised(int mode) {
7228 int ret = 0;
7229
7230 if (mode == SUPERVISED_AUTODETECT) {
7231 if (getenv("UPSTART_JOB")) {
7232 serverLog(LL_VERBOSE, "Upstart supervision detected.");
7233 mode = SUPERVISED_UPSTART;
7234 } else if (getenv("NOTIFY_SOCKET")) {
7235 serverLog(LL_VERBOSE, "Systemd supervision detected.");
7236 mode = SUPERVISED_SYSTEMD;
7237 }
7238 } else if (mode == SUPERVISED_UPSTART) {
7239 return redisSupervisedUpstart();
7240 } else if (mode == SUPERVISED_SYSTEMD) {
7241 serverLog(LL_WARNING,
7242 "WARNING supervised by systemd - you MUST set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.");
7243 return redisCommunicateSystemd("STATUS=KeyDB is loading...\n");
7244 }
7245
7246 switch (mode) {
7247 case SUPERVISED_UPSTART:
7248 ret = redisSupervisedUpstart();
7249 break;
7250 case SUPERVISED_SYSTEMD:
7251 ret = redisSupervisedSystemd();
7252 break;
7253 default:
7254 break;
7255 }
7256
7257 if (ret)
7258 cserver.supervised_mode = mode;
7259
7260 return ret;
7261}
7262
7263uint64_t getMvccTstamp()
7264{

Callers 1

mainFunction · 0.85

Calls 4

serverLogFunction · 0.85
redisSupervisedUpstartFunction · 0.85
redisCommunicateSystemdFunction · 0.85
redisSupervisedSystemdFunction · 0.85

Tested by

no test coverage detected