Server script without built-in sockets

Matt Graham danceswithcrows at usa.net
Tue Oct 23 11:39:40 MST 2007


After a long battle with technology, Craig White wrote:
> On Tue, 2007-10-23 at 10:43 -0700, Dan Lund wrote:
> > On 10/23/07, Craig White <craig at tobyhouse.com> wrote:
> > > I just assumed that a socket is a mknod file somewhere with permissions
> > > set to allow specific users/demons to pass data.
> > Sockets are created/opened by applications, and don't really follow
> > the whole mknod / dev paradigm. This is for both Unix and TCP sockets.
> OK - well this merely demonstrates my point that I am not knowledgeable
> about this stuff...I'm lucky to remember to #!/bin/sh the first line in
> my shell scripts.

I always put #!/usr/bin/perl as the first line of my shell scripts... Now why 
don't any of them WORK?  AAAAAA! *zorch*

I think part of the confusion is that there are 2 things called "sockets", and 
while they're used for similar stuff (inter-process or inter-machine 
communication), they're different.  Type 0:  Local socket.  This is a special 
file created by apps calling socket() followed by connect().  You probably 
have one in /tmp/.X11-unix/ and many others scattered throughout /var/run/ .  
Type 1:  Network socket.  This doesn't have a file associated with it.  Type 
2:  Anonymous socket pair.  This is like type 0, but the sockets don't have 
filenames.  You can see all the active sockets of types 0 and 1 
with "netstat -a".  Not sure about type 2.

-- 
   We aim to please.  If our aim or grouping fails to satisfy, we will
   cheerfully shoot you again at our own expense.
   --M. Roberds, in ASR
There is no Darkness in Eternity/But only Light too dim for us to see


More information about the PLUG-discuss mailing list