MCPcopy Create free account
hub / github.com/apache/kvrocks / IsSupervisedMode

Function IsSupervisedMode

src/cli/daemon_util.h:88–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88inline bool IsSupervisedMode(SupervisedMode mode) {
89 if (mode == kSupervisedAutoDetect) {
90 const char *upstart_job = getenv("UPSTART_JOB");
91 const char *notify_socket = getenv("NOTIFY_SOCKET");
92 if (upstart_job) {
93 mode = kSupervisedUpStart;
94 } else if (notify_socket) {
95 mode = kSupervisedSystemd;
96 }
97 }
98 if (mode == kSupervisedUpStart) {
99 return SupervisedUpstart();
100 } else if (mode == kSupervisedSystemd) {
101 return SupervisedSystemd();
102 }
103 return false;
104}
105
106inline void Daemonize() {
107 pid_t pid = fork();

Callers 1

mainFunction · 0.85

Calls 2

SupervisedUpstartFunction · 0.85
SupervisedSystemdFunction · 0.85

Tested by

no test coverage detected