1

I have experience with using local named and network sockets in C, but on Linux (Fedora 14), using GNOME system monitor, I notice that a local socket, being used by the init process, has the path "@/com/ubuntu/upstart". One thing I notice is that this path (without the '@') doesn't exist, but also I have no idea what the '@' means. I've not seen this anywhere else.

Some research tells me that the init 'upstart' daemon is a fairly recent introduction to Linux, presumably replacing another older daemon. It is hosted on a subdomain of the Ubuntu website, so I sense a connection in that sense, but what does the '@' signify? And why does a non-existent path follow it?

Thanks

1 Answer 1

2

What you're seeing is an abstract socket, a special kind of socket specific to Linux. From man 7 unix:

   *  abstract: an abstract socket address is distinguished by the fact that
      sun_path[0] is a null byte ('\0').  The socket's address in this namespace
      is given by the additional bytes in sun_path that are covered by the
      specified length of the address structure.  (Null bytes in the name have no
      special significance.)  The name has no connection with file system
      pathnames.  When the address of an abstract socket is returned by
      getsockname(2), getpeername(2), and accept(2), the returned addrlen is
      greater than sizeof(sa_family_t) (i.e., greater than 2), and the name of
      the socket is contained in the first (addrlen - sizeof(sa_family_t)) bytes
      of sun_path.  The abstract socket namespace is a nonportable Linux
      extension.

While this is not mentioned, abstract socket names are printed with the first character @ instead of the null byte, as is used in bind() etc.

As is mentioned in the man page, the string after the @ or the null byte is not a filesystem path, and can be anything. In your case, it is structured as a path for organizational reasons (to avoid conflicts with other abstract sockets).

1
  • No coincidentally, '@' is the character that represents the NULL byte when you make the same translation that gets you '^A' as SOH, control character one. Jan 23, 2012 at 0:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .