After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 46728 - inherited file descriptors stymie automounter
inherited file descriptors stymie automounter
Status: VERIFIED FIXED
Product: bonobo-activation [was: oaf]
Classification: Deprecated
Component: general
cvs (head)
Other Linux
: Normal normal
: ---
Assigned To: Maciej Stachowiak
Maciej Stachowiak
Depends on: 79037
Blocks:
 
 
Reported: 2001-02-16 23:24 UTC by Ben Liblit
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ben Liblit 2001-09-10 00:58:00 UTC
Ina typical Red Hat 7 install, "/etc/X11/gdm/Sessions/Gnome" starts a GNOME
session with stdout and stderr redirected to "$HOME/.gnomerc-errors".  Anything
spawned by the session will inherit these open file descriptors, including oafd.

When the user logs out, nearly of those spawned programs terminate but oafd
keeps running.  That means that "$HOME/.gnomerc-errors" remains open, which in
turn stops any automounter from unmounting the user's home directory.  That's no
good, because the whole idea of an automounter is to unmount NFS volumes that
are not being used.

oafd should close stdout and stderr, and in general should not keep files under
$HOME open for indefinitely long periods.  That may mean that it has to report
problems via syslog() instead.



------- Additional Comments From liblit@acm.org 2001-02-16 18:25:54 ----

Note that fixing bug #46727 would essentially render this bug moot.



------- Additional Comments From mjs@noisehavoc.org 2001-02-20 13:38:26 ----

The simple version is to close std{in,out,error} at startup, open /dev/null, and
dup2 it to all three of these fds.

However, this will hide log output of components. Is this really a good idea?

The fancy version in bug 46727 would finesse this but would also take 16-24 hours
of work vs. the four here.




------- Additional Comments From don@eazel.com 2001-02-20 20:57:48 ----

Doing the hack you suggest won't break non-Red Hat systems, will it?




------- Additional Comments From mjs@noisehavoc.org 2001-02-21 01:14:20 ----

No. open(), /dev/null and dup2() are perfectly portable. But many people will
hate me if components no longer write any debugging output to any console,
including members of our own development team! In fact, this is a super quick
hack once I know this is OK. I will Cc Darin, and if he reassures me will do the
cheesy fix.




------- Additional Comments From mjs@noisehavoc.org 2001-02-21 01:51:03 ----

Wait, I figured out an OK way to do this. Use the /dev/null trick, but not if
the OAF_DEBUG_OUTPUT environment variable is set.

In fact, I just did it, and sent mail to warn people.




------- Bug moved to this database by unknown@bugzilla.gnome.org 2001-09-09 20:58 -------
Comment 1 Ben Liblit 2002-01-09 00:31:47 UTC
Fix confirmed.  "lsof -c oafd" shows that stdin, stdout, and stderr
are /dev/null.  More generally, no files are being held open under
$HOME.  All is as it should be.
Comment 2 Ben Liblit 2002-04-18 06:07:37 UTC
The panel is explicitly setting BONOBO_ACTIVATION_DEBUG_OUTPUT=1, in
effect causing this bug to regress.  How rude!

Since this is the panel's fault, and not bonobo-activation-server's,
I've filed a new panel bug (#79037).  This bug is marked as dependent
upon that.  I'm not going to reopen this bug, though, because nothing
actually needs to change within the bonobo-activation code: Maciej's
fix is still good, and will work as intended once the panel lets it.