This commit from lttng-tools master should be merged into stable-2.0:

commit ceed52b545103258e84f1c7040700be9dbbbaec6
Author: Mathieu Desnoyers <[email protected]>
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 <[email protected]>

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to