Repository navigation
Conversation
000c819 to
75e0f2b
Compare
having the logger be a child of the supervisor not only means we can't respawn it, but causes stopgroup to crash some services, as killing the logger causes sigpipe
75e0f2b to
db1ac50
Compare
N-R-K
left a comment
There was a problem hiding this comment.
TBH I don't fully understand what problem is being solved here. Do you have a concrete example?
| if ((fd[1] = xopen_nonblock(redirect, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)) == -1) | ||
| eerrorx("%s: unable to redirect the logfile for stdout '%s': %s", applet, redirect, strerror(errno)); | ||
| } else if (process) { | ||
| pipe2(fd, O_CLOEXEC); |
two things: a) so far loggers were not supervised, could crash and give random EPIPEs to the socket, with this, the supervisor holds the pipe so EPIPE wouldn't happen, and is actually supervising and respawning the logger b) we hadded stopgroup=yes, which sends a signal to -pid instead of pid; the whole process group, before this the logger would be on that process group and if it's killed before the main process, they'd also get EPIPE trying to log anything at shutdown having the supervisor actually keep track of loggers means we can kill them after the service is stopped and avoid that plus, it's just cleaner to not give unexpected child processes to daemons |
|
I see. That makes sense. |
No description provided.