* [lttng-dev] [lttng-tools stable-2.0 merge req] Fix: close all file descriptors when executed as daemon
@ 2012-06-04 22:32 Mathieu Desnoyers
0 siblings, 0 replies; only message in thread
From: Mathieu Desnoyers @ 2012-06-04 22:32 UTC (permalink / raw)
This commit from lttng-tools master should be merged into stable-2.0:
commit ceed52b545103258e84f1c7040700be9dbbbaec6
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date: Mon Jun 4 18:08:24 2012 -0400
Fix: close all file descriptors when executed as daemon
Both sessiond and consumerd support the option "-d" to run as daemon. In
some specific cases, e.g. when launched from dpkg installation scripts,
file descriptors 3, 4, 5 are left open and don't seem to have O_CLOEXEC
flag set, so the install script hangs because the sessiond still holds a
reference to them. daemon(3) only closes standard FD 0, 1, 2.
Fix this issue by closing all file descriptors after calling daemon(3).
Note: we make sure no file descriptor is opened before calling daemon(3)
by moving the init_thread_quit_pipe() call after the FD close.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-04 22:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-04 22:32 [lttng-dev] [lttng-tools stable-2.0 merge req] Fix: close all file descriptors when executed as daemon Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox