[GRASS5] Problem with sockets on Linux

I've just updated my CVS (this afternoon at 16:00), run again configure
make and make install... when I try to start x0, (d.mon start=x0) I get
"no socket to connect to for monitor <x0>". What's wrong?
Bye
Andrea

PS: on the same machine, but of course in a different folder, I have
GRASSb11, and it's working (it wasn't compiled with socket support).

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Andrea

Andrea Aime wrote:

I've just updated my CVS (this afternoon at 16:00), run again
configure make and make install... when I try to start x0, (d.mon
start=x0) I get "no socket to connect to for monitor <x0>". What's
wrong?

You may have already done this but try

make distclean
configure
make
make install

If your previously compiled version was not with sockets enabled, then
some of the d.* commands need to be re-compiled. That means the object
files need to be removed.

Hope this helps.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand

People who think they know everything are very irritating to those
of us who do. ---Anonymous

Jazz and Trek Rule!!!

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

I've tried make distclean, but without success, I always get the
same error. Before "make distclean" I also deleted my installation
directory and my .grassrc5. Please note that I install with a different
prefix (that should not make any difference, but I don't understand
where the error is). Any other ideas? Some way to get more detailed
error logs?
Bye
Andrea

Justin Hickey wrote:

Hi Andrea

Andrea Aime wrote:
>
> I've just updated my CVS (this afternoon at 16:00), run again
> configure make and make install... when I try to start x0, (d.mon
> start=x0) I get "no socket to connect to for monitor <x0>". What's
> wrong?

You may have already done this but try

make distclean
configure
make
make install

If your previously compiled version was not with sockets enabled, then
some of the d.* commands need to be re-compiled. That means the object
files need to be removed.

Hope this helps.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand

People who think they know everything are very irritating to those
of us who do. ---Anonymous

Jazz and Trek Rule!!!

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Andrea

Andrea Aime wrote:

I've tried make distclean, but without success, I always get the
same error. Before "make distclean" I also deleted my installation
directory and my .grassrc5. Please note that I install with a
different prefix (that should not make any difference, but I don't
understand where the error is). Any other ideas? Some way to get more
detailed error logs?

Unfortunately, I don't have any other ideas, and our developer in charge
of the socket code (Eric Miller) is currently having ISP problems that
delay his sent mail by up to 24 hours. Hopefully a response from him is
on the way.

Sorry I couldn't offer more help.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand

People who think they know everything are very irritating to those
of us who do. ---Anonymous

Jazz and Trek Rule!!!

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Thu, Mar 08, 2001 at 09:00:37AM +0100, Andrea Aime wrote:

I've tried make distclean, but without success, I always get the
same error. Before "make distclean" I also deleted my installation
directory and my .grassrc5. Please note that I install with a different
prefix (that should not make any difference, but I don't understand
where the error is). Any other ideas? Some way to get more detailed
error logs?
Bye
Andrea

To confirm: The same problem occurs on SUN/Solaris. No effect with
make distclean and a complete re-compile (I tried twice). There must
be a recent bug... (another reason to clean out the unused driver stuff).

Regards

Markus

Justin Hickey wrote:
>
> Hi Andrea
>
> Andrea Aime wrote:
> >
> > I've just updated my CVS (this afternoon at 16:00), run again
> > configure make and make install... when I try to start x0, (d.mon
> > start=x0) I get "no socket to connect to for monitor <x0>". What's
> > wrong?
>
> You may have already done this but try
>
> make distclean
> configure
> make
> make install
>
> If your previously compiled version was not with sockets enabled, then
> some of the d.* commands need to be re-compiled. That means the object
> files need to be removed.
>
> Hope this helps.
>
> --
> Sincerely,
>
> Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
> High Performance Computing Center
> National Electronics and Computer Technology Center (NECTEC)
> Bangkok, Thailand
> ==================================================================
> People who think they know everything are very irritating to those
> of us who do. ---Anonymous
>
> Jazz and Trek Rule!!!
> ==================================================================
>
> ----------------------------------------
> If you want to unsubscribe from GRASS Development Team mailing list write to:
> minordomo@geog.uni-hannover.de with
> subject 'unsubscribe grass5'

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

--
Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Thu, Mar 08, 2001 at 09:36:13AM +0000, Markus Neteler wrote:

On Thu, Mar 08, 2001 at 09:00:37AM +0100, Andrea Aime wrote:
> I've tried make distclean, but without success, I always get the
> same error. Before "make distclean" I also deleted my installation
> directory and my .grassrc5. Please note that I install with a different
> prefix (that should not make any difference, but I don't understand
> where the error is). Any other ideas? Some way to get more detailed
> error logs?
> Bye
> Andrea

To confirm: The same problem occurs on SUN/Solaris. No effect with
make distclean and a complete re-compile (I tried twice). There must
be a recent bug... (another reason to clean out the unused driver stuff).

Is the server running (or did it exit)? (try "ps aux | grep <driver>").

Does following with a "d.mon select=<DRIVER>" succeed? (the timing
issue...).

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

No, the server is not running, I can't find any new process (I don't
know the driver name (is it simply "xo"?), but if you sort processes
by PID you see if something has been created after grass start).
The following "d.mon select=x0" of course does not work and returns
the same error.
Hope this helps
Andrea

PS: which server ports are used by the X driver? Maybe it finds them
occupied by another application (I use 4444/6001/7001 for an in-house
application...). Anyway, I think that server ports numbers should be
configurable...

On Thu, Mar 08, 2001 at 09:36:13AM +0000, Markus Neteler wrote:
>
> On Thu, Mar 08, 2001 at 09:00:37AM +0100, Andrea Aime wrote:
> > I've tried make distclean, but without success, I always get the
> > same error. Before "make distclean" I also deleted my installation
> > directory and my .grassrc5. Please note that I install with a different
> > prefix (that should not make any difference, but I don't understand
> > where the error is). Any other ideas? Some way to get more detailed
> > error logs?
> > Bye
> > Andrea
>
> To confirm: The same problem occurs on SUN/Solaris. No effect with
> make distclean and a complete re-compile (I tried twice). There must
> be a recent bug... (another reason to clean out the unused driver stuff).

Is the server running (or did it exit)? (try "ps aux | grep <driver>").

Does following with a "d.mon select=<DRIVER>" succeed? (the timing
issue...).

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Fri, Mar 09, 2001 at 08:49:02AM +0100, Andrea Aime wrote:

No, the server is not running, I can't find any new process (I don't
know the driver name (is it simply "xo"?), but if you sort processes
by PID you see if something has been created after grass start).
The following "d.mon select=x0" of course does not work and returns
the same error.
Hope this helps
Andrea

I think the problem is d.mon isn't getting built properly for some
reason. I change the arguments for "start" if the USE_G_SOCKS symbol
is defined. I think the drivers are being called with all the fifo
args, so they are exiting (do you get a "Usage" message?).

PS: which server ports are used by the X driver? Maybe it finds them
occupied by another application (I use 4444/6001/7001 for an in-house
application...). Anyway, I think that server ports numbers should be
configurable...

No ports are used. Just local UNIX socket files. I figured UNIX
sockets are simpler and there'd be no reason another user should ever
"connect" to a display driver started by someone else. Also, UNIX
sockets should be faster since the kernel has to do less work (mearly
queues up data in a buffer from write() and pops the data to the
application on read()). Socket files currently live in
<mapset>/.tmp/<host>/<driver_name>

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

I've updated my files to last CVS, and now driver is working well.
Thanks
Andrea

"Eric G. Miller" wrote:

On Fri, Mar 09, 2001 at 08:49:02AM +0100, Andrea Aime wrote:
> No, the server is not running, I can't find any new process (I don't
> know the driver name (is it simply "xo"?), but if you sort processes
> by PID you see if something has been created after grass start).
> The following "d.mon select=x0" of course does not work and returns
> the same error.
> Hope this helps
> Andrea

I think the problem is d.mon isn't getting built properly for some
reason. I change the arguments for "start" if the USE_G_SOCKS symbol
is defined. I think the drivers are being called with all the fifo
args, so they are exiting (do you get a "Usage" message?).

> PS: which server ports are used by the X driver? Maybe it finds them
> occupied by another application (I use 4444/6001/7001 for an in-house
> application...). Anyway, I think that server ports numbers should be
> configurable...

No ports are used. Just local UNIX socket files. I figured UNIX
sockets are simpler and there'd be no reason another user should ever
"connect" to a display driver started by someone else. Also, UNIX
sockets should be faster since the kernel has to do less work (mearly
queues up data in a buffer from write() and pops the data to the
application on read()). Socket files currently live in
<mapset>/.tmp/<host>/<driver_name>

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Mon, Mar 12, 2001 at 04:48:50PM +0100, Andrea Aime wrote:

I've updated my files to last CVS, and now driver is working well.
Thanks
Andrea

Very good...

"Eric G. Miller" wrote:
>
> On Fri, Mar 09, 2001 at 08:49:02AM +0100, Andrea Aime wrote:
> No ports are used. Just local UNIX socket files. I figured UNIX
> sockets are simpler and there'd be no reason another user should ever
> "connect" to a display driver started by someone else. Also, UNIX
> sockets should be faster since the kernel has to do less work (mearly
> queues up data in a buffer from write() and pops the data to the
> application on read()). Socket files currently live in
> <mapset>/.tmp/<host>/<driver_name>

Eric,

are you planning to check in your new code for $HOME/.grass5/com/
? Then we could get rid of the "locks" directory. Or are there
objections?

Regards

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Mon, Mar 12, 2001 at 04:55:15PM +0000, Markus Neteler wrote:

Eric,

are you planning to check in your new code for $HOME/.grass5/com/
? Then we could get rid of the "locks" directory. Or are there
objections?

The "locks" directory is needed for the FIFO/IPC drivers. So, as long
as we are keeping those, we will need the "locks" directory. The
sockets code uses a different mechanism, so it doesn't matter if we have
the $HOME/.grass5/com stuff. When I last mentioned the code I'd worked
up for the $HOME/.grass5, there wasn't much consensus on it. I assumed
we didn't want to add this change at this time. I can still check in
the code file, but I guessed it was going to be a 5.1 thing (if we want
to do it).

One good reason to have the $HOME/.grass5, would be to move the socket
file out of the mapset (though, two users shouldn't be able to
simulataneously have their current mapset be the same -- or am I
mistaken?).

FYI: The sockets "lock" equivalent works like:

1) User starts a server with "d.mon".

2) Server checks if the socket file it plans to use already exists.
   
   a) If the file exists, server tries to make a connection (see if
      anything is "listening").

      i. If the connection is successful, the server exits with an
          error message.

      ii. If the connection is unsuccessful, the server removes the
          file.
    
3) Server then calls G_sock_bind() on the file name (which will create
    the file anew, but associate with the server process). Later (after
    the fork()), server calls G_sock_listen() on the file descriptor to
    begin accepting connections.

The above isn't a perfect test, but should do the right thing most of
the time. I suppose it could be possible for a driver to be running
and be busy processing another client request, such that the connection
attempt by the new server process will timeout. In that scenario, the
socket file will get "hijacked" by the new server process. It would
take some effort by the user to make this happen though. The user would
have to have a long running process tieing up the connection to a server
(say "x0"), then run "d.mon x0" to start x0 again all the while another
module is keeping the original "x0" busy.

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'