Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [lttng-tools stable-2.0 merge req] Fix: close all file descriptors	when executed as daemon
Date: Mon, 4 Jun 2012 18:32:36 -0400	[thread overview]
Message-ID: <20120604223236.GA30869@Krystal> (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



                 reply	other threads:[~2012-06-04 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120604223236.GA30869@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox