[Bug 619269] Re: init: "script" stanza leaks file descriptor to child process
Dmitrijs Ledkovs
launchpad at surgut.co.uk
Sat Nov 2 22:52:12 UTC 2013
** Changed in: upstart (Ubuntu)
Status: New => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to upstart in Ubuntu.
https://bugs.launchpad.net/bugs/619269
Title:
init: "script" stanza leaks file descriptor to child process
Status in Upstart:
Fix Released
Status in “upstart” package in Ubuntu:
Fix Released
Bug description:
Upstart sends job scripts to shell via pipe represented by
/dev/fd/<fd> (/proc/self/fd/) file in proc filesystem, e.g.:
/bin/sh -e /dev/fd/9
This fd stays open while child shell process is running. There are
some applications like pvdisplay (and other lvm2 tools) which
complaint about it.
How to reproduce:
Boot to runlevel 1
Run pvdisplay:
# pvdisplay
File descriptor 9 (pipe:[9737]) leaked on pvdisplay invocation. Parent PID 845: /bin/bash
--- Physical volume ---
...
Possible solution would be send first closing pipe fd command to
shell:
+ close_fd = NIH_MUST (nih_sprintf (NULL, "<&%d- ;", fds[0]));
+ NIH_ZERO (nih_io_write (io, close_fd, strlen (close_fd)));
+
NIH_ZERO (nih_io_write (io, script, strlen (script)));
nih_io_shutdown (io);
To manage notifications about this bug go to:
https://bugs.launchpad.net/upstart/+bug/619269/+subscriptions
More information about the foundations-bugs
mailing list