]> git.puffer.fish Git - mirror/frr.git/commit
ldpd: detach stdin/stdout/stderr from the child processes
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 3 Oct 2017 19:11:07 +0000 (16:11 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 6 Oct 2017 02:03:21 +0000 (23:03 -0300)
commitb6c604315fa7402c21836240d34644fe96386e22
tree7cf9a0c2ddeeb63e6ac797d3261b24796659b5b5
parent60b153acdf09032b83815873d7f10a1642148d29
ldpd: detach stdin/stdout/stderr from the child processes

Doing a "ssh user@node 'ldpd -d'" was making the SSH session hang. In
the original OpenBSD's ldpd(8) daemon, the daemon function takes care
of connecting stdin/stdout/stderr to /dev/null. In the FRR port, this
only happens in the frr_run() function, after all children have been
forked. Ideally we could try to rearrange libfrr.c and ldpd.c in a way
that start_child() is called only after the parent connects the standard
I/O streams to /dev/null. But since this issue needs an immediate
fix, let's do this workaround for now. Note: even when running on the
foreground, all log messages from the child processes are sent to the
parent process, which then prints the messages to stdout/stderr and/or
to a log file.

Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/ldpd.c