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

Function redisCommunicateSystemd

src/server.cpp:7181–7194  ·  view source on GitHub ↗

Send a notify message to systemd. Returns sd_notify return code which is * a positive number on success. */

Source from the content-addressed store, hash-verified

7179/* Send a notify message to systemd. Returns sd_notify return code which is
7180 * a positive number on success. */
7181int redisCommunicateSystemd(const char *sd_notify_msg) {
7182#ifdef HAVE_LIBSYSTEMD
7183 int ret = sd_notify(0, sd_notify_msg);
7184
7185 if (ret == 0)
7186 serverLog(LL_WARNING, "systemd supervision error: NOTIFY_SOCKET not found!");
7187 else if (ret < 0)
7188 serverLog(LL_WARNING, "systemd supervision error: sd_notify: %d", ret);
7189 return ret;
7190#else
7191 UNUSED(sd_notify_msg);
7192 return 0;
7193#endif
7194}
7195
7196/* Attempt to set up upstart supervision. Returns 1 if successful. */
7197static int redisSupervisedUpstart(void) {

Callers 6

readSyncBulkPayloadFunction · 0.85
syncWithMasterFunction · 0.85
prepareForShutdownFunction · 0.85
redisSupervisedSystemdFunction · 0.85
redisIsSupervisedFunction · 0.85
mainFunction · 0.85

Calls 1

serverLogFunction · 0.85

Tested by

no test coverage detected