Commit 2a28540a authored by Jan Koester's avatar Jan Koester
Browse files

docker fix

parent e9aea39e
Loading
Loading
Loading
Loading
Loading
+4 −2
Changes for src/confhelper.cpp: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -863,6 +863,7 @@ namespace fenrirds::confhelper {
                      << " (config changes disabled)" << std::endl;
            return;
        }
        pid_t helperPid = getpid();
        pid_t pid = fork();
        if (pid < 0) {
            std::cerr << "[CONFHELPER] fork failed: " << strerror(errno)
@@ -877,9 +878,10 @@ namespace fenrirds::confhelper {
        }
        ::close(sv[0]);
#ifdef __linux__
        /* the server must not outlive the helper that would restart it */
        /* the server must not outlive the helper that would restart it; compare
         * with the helper's pid, not 1: in a container the helper is pid 1 */
        prctl(PR_SET_PDEATHSIG, SIGTERM);
        if (getppid() == 1)
        if (getppid() != helperPid)
            _exit(1);
#endif
        struct timeval tv = { 30, 0 };