| 32 | #include "unique_fd.h" |
| 33 | |
| 34 | inline bool SupervisedUpstart() { |
| 35 | const char *upstart_job = getenv("UPSTART_JOB"); |
| 36 | if (!upstart_job) { |
| 37 | WARN("upstart supervision requested, but UPSTART_JOB not found"); |
| 38 | return false; |
| 39 | } |
| 40 | INFO("supervised by upstart, will stop to signal readiness"); |
| 41 | raise(SIGSTOP); |
| 42 | unsetenv("UPSTART_JOB"); |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | inline bool SupervisedSystemd() { |
| 47 | const char *notify_socket = getenv("NOTIFY_SOCKET"); |