9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] ctrl-d and rio
Date: Thu,  4 Nov 2004 18:52:40 +0000	[thread overview]
Message-ID: <09bc4af6170d58bf7301230f8f37b748@vitanuova.com> (raw)
In-Reply-To: <334ef3045cd1529b82e0bf9767ba99f5@plan9.ucalgary.ca>

> never been bothered by it enough to look at the cause and assumed it's
> just open file descriptors.  still, i am interested in hearing
> explanations/solutions.

this has nagged at me too in the past, so i just had a look into it.

there are two reasons (in in the plumber case, at any rate)
why the shell window doesn't disappear correctly.
the first is a bug in /sys/src/cmd/plumb/fsys.c:/^startfsys

	procrfork(fsysproc, nil, Stack, RFFDG);

should be:

	procrfork(fsysproc, nil, Stack, RFFDG|RFNAMEG);

otherwise the process serving the plumbing namespace is also holding
that namespace open.

but even with that fixed, the plumber automatically creates an entry
in /srv.  this holds the 9p pipe to the plumber open even when the
shell holding the plumber's namespace exits.

removing the /srv file allows the window to disappear correctly (a rio
window only exits when the window's namespace is no longer
referenced).

so, assuming the first fix,

	plumber
	rm `{cat /env/plumbsrv}

would be sufficient (although an option suppressing the /srv posting
would likely be preferable).



  reply	other threads:[~2004-11-04 18:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04 17:10 Steve Simon
2004-11-04 17:21 ` andrey mirtchovski
2004-11-04 18:52   ` rog [this message]
2004-11-04 19:11   ` rog

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=09bc4af6170d58bf7301230f8f37b748@vitanuova.com \
    --to=rog@vitanuova.com \
    --cc=9fans@cse.psu.edu \
    /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;
as well as URLs for NNTP newsgroup(s).