Send a notify message to systemd. Returns sd_notify return code which is * a positive number on success. */
| 7179 | /* Send a notify message to systemd. Returns sd_notify return code which is |
| 7180 | * a positive number on success. */ |
| 7181 | int 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. */ |
| 7197 | static int redisSupervisedUpstart(void) { |
no test coverage detected