MCPcopy Create free account
hub / github.com/F-Stack/f-stack / redisIsSupervised

Function redisIsSupervised

app/redis-6.2.6/src/server.c:6098–6126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6096}
6097
6098int redisIsSupervised(int mode) {
6099 int ret = 0;
6100
6101 if (mode == SUPERVISED_AUTODETECT) {
6102 if (getenv("UPSTART_JOB")) {
6103 serverLog(LL_VERBOSE, "Upstart supervision detected.");
6104 mode = SUPERVISED_UPSTART;
6105 } else if (getenv("NOTIFY_SOCKET")) {
6106 serverLog(LL_VERBOSE, "Systemd supervision detected.");
6107 mode = SUPERVISED_SYSTEMD;
6108 }
6109 }
6110
6111 switch (mode) {
6112 case SUPERVISED_UPSTART:
6113 ret = redisSupervisedUpstart();
6114 break;
6115 case SUPERVISED_SYSTEMD:
6116 ret = redisSupervisedSystemd();
6117 break;
6118 default:
6119 break;
6120 }
6121
6122 if (ret)
6123 server.supervised_mode = mode;
6124
6125 return ret;
6126}
6127
6128int iAmMaster(void) {
6129 return ((!server.cluster_enabled && server.masterhost == NULL) ||

Callers 1

mainFunction · 0.85

Calls 2

redisSupervisedUpstartFunction · 0.85
redisSupervisedSystemdFunction · 0.85

Tested by

no test coverage detected