mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matti Aarnio <matti.aarnio@zmailer.org>
To: Jan Hudec <bulb@ucw.cz>, linux-kernel@vger.kernel.org
Subject: Re: UNIX domain socket hanging around when not closed
Date: Wed, 7 Aug 2002 18:56:06 +0300	[thread overview]
Message-ID: <20020807155606.GH32427@mea-ext.zmailer.org> (raw)
In-Reply-To: <20020807153251.GD27745@vagabond>

On Wed, Aug 07, 2002 at 05:32:51PM +0200, Jan Hudec wrote:
> Hello,
> 
> I have a (possibly stupid) question. Is it OK, that dentries created by
> binding unix-domain sockets remain in filesystem?

   That is the classical behaviour, possibly because of tradition
   where they relate to named pipes created with mknod(1) command.

     http://www.ecst.csuchico.edu/~beej/guide/ipc/usock.html

> What I do is create a unix socket in /tmp and wait for clients to
> connect in. The program removes the socket dentry when it shuts down,
> but it sometimes crashes and the socket remains there.
> 
> Is there some reason the socket should remain unless explicitely
> removed?

   Traditional is also to   unlink() the socket name just prior
   to bind(3):ing it just in case there is a left-over entity
   with that name.


   The object name (it is NAMED entity, after all) space is
   filesystem name space.   I don't see any reason why not:

      - There could pre-exist the named socket (at a R/O
        filesystem), and no new name needs to be allocated
        in the filesystem for it.

      - The entire named entity would not be allowed to
        exist purely in VFS space, that is: creation wise
        the permission verification could ignore location
        directory being on a read/only file system, and
        just use directory permissions.  (Questions about
        memory expenditure, etc.  all kinds of trade-offs.)

  What the new POSIX writes about the issue, that I haven't
  yet looked into.

> 			 Jan 'Bulb' Hudec <bulb@ucw.cz>

/Matti Aarnio

  reply	other threads:[~2002-08-07 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-07 15:32 Jan Hudec
2002-08-07 15:56 ` Matti Aarnio [this message]
2002-08-07 17:45   ` Alan Cox
2002-08-07 17:18 ` Alan Cox

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=20020807155606.GH32427@mea-ext.zmailer.org \
    --to=matti.aarnio@zmailer.org \
    --cc=bulb@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®