Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - localhost: (14 Items)
   
localhost  
Would it make any kind of sense for /net/localhost to point to the local machine. I know it would make my life easy.

I tried creating a link ( ln -P ) but as I expected that didn't work.
RE: localhost  
> /net/localhost to point to the local machine. 

Never had anyone ask for that, but I *think*
you oughta be able to do that, with the process
manager namespace ... even though qnet takes
over the directory /net, you oughta be able to
plop /net/fubar on top of that, which would get
checked first when someone opened it.

Colin?

I seem to recall endless discussions about how
we were going to do the namespace thing, years 
ago - I forget how it was finally implemented.

--
aboyd   www.pittspecials.com/movies/torq.wmv

Re: localhost  
Mario Charest wrote:
> Would it make any kind of sense for /net/localhost to point to the local machine. I know it would make my life easy.
>
> I tried creating a link ( ln -P ) but as I expected that didn't work.
>   
You need to make it a "symbolic" proc symlink ... ln -sP

That will do any path redirection you need.

Thomas
Re: localhost  
> Mario Charest wrote:
> > Would it make any kind of sense for /net/localhost to point to the local 
> machine. I know it would make my life easy.
> >
> > I tried creating a link ( ln -P ) but as I expected that didn't work.
> >   
> You need to make it a "symbolic" proc symlink ... ln -sP
> 
> That will do any path redirection you need.

Nope, for:

ln -sP /net/honorificabilitudinitatibus  /net/localhost

ln: lstat() failed.  /net/localhost: No route to host

> 
> Thomas

That

RE: localhost  
I think it should have said:

ln -sP /net/honorificabilitudinitatibus  /net/localhost

ln: lstat() failed.  Could not spell "honorificabilitudinitatibus"

(OK.  That was a useless comment, but there you go).

   R.

-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com] 
Sent: Monday, April 06, 2009 2:18 PM
To: technology-networking
Subject: Re: localhost

> Mario Charest wrote:
> > Would it make any kind of sense for /net/localhost to point to the 
> > local
> machine. I know it would make my life easy.
> >
> > I tried creating a link ( ln -P ) but as I expected that didn't
work.
> >   
> You need to make it a "symbolic" proc symlink ... ln -sP
> 
> That will do any path redirection you need.

Nope, for:

ln -sP /net/honorificabilitudinitatibus  /net/localhost

ln: lstat() failed.  /net/localhost: No route to host

> 
> Thomas

That



_______________________________________________
Technology
http://community.qnx.com/sf/go/post26113
Re: RE: localhost  
I'll try again then ...

ln -sP /net/nodename  /net/localhost
 
 ln: lstat() failed.  /net/localhost: No route to host


> I think it should have said:
> 
> ln -sP /net/honorificabilitudinitatibus  /net/localhost
> 
> ln: lstat() failed.  Could not spell "honorificabilitudinitatibus"
> 
> (OK.  That was a useless comment, but there you go).
> 
>    R.
> 
> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com] 
> Sent: Monday, April 06, 2009 2:18 PM
> To: technology-networking
> Subject: Re: localhost
> 
> > Mario Charest wrote:
> > > Would it make any kind of sense for /net/localhost to point to the 
> > > local
> > machine. I know it would make my life easy.
> > >
> > > I tried creating a link ( ln -P ) but as I expected that didn't
> work.
> > >   
> > You need to make it a "symbolic" proc symlink ... ln -sP
> > 
> > That will do any path redirection you need.
> 
> Nope, for:
> 
> ln -sP /net/honorificabilitudinitatibus  /net/localhost
> 
> ln: lstat() failed.  /net/localhost: No route to host
> 
> > 
> > Thomas
> 
> That
> 
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26113


RE: RE: localhost  
How about do the way of "mixed dir":
1) before qnet is mounted, "mkdir /net".
2) create the symlink, "ln -sP /net/mybox /net/localhost".
3) start qnet, "mount -Tio-net /lib/dll/lsm-qnet.so; hostname mybox;". 

So the /net is a "mixed" directory as both local file system and qnet
are taking in charge of the name /net. 

Then you can "cd /net/localhost" to play there.

Thanks
Weijie


-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com] 
Sent: April 7, 2009 9:51 AM
To: technology-networking
Subject: Re: RE: localhost

I'll try again then ...

ln -sP /net/nodename  /net/localhost
 
 ln: lstat() failed.  /net/localhost: No route to host


> I think it should have said:
> 
> ln -sP /net/honorificabilitudinitatibus  /net/localhost
> 
> ln: lstat() failed.  Could not spell "honorificabilitudinitatibus"
> 
> (OK.  That was a useless comment, but there you go).
> 
>    R.
> 
> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com] 
> Sent: Monday, April 06, 2009 2:18 PM
> To: technology-networking
> Subject: Re: localhost
> 
> > Mario Charest wrote:
> > > Would it make any kind of sense for /net/localhost to point to the

> > > local
> > machine. I know it would make my life easy.
> > >
> > > I tried creating a link ( ln -P ) but as I expected that didn't
> work.
> > >   
> > You need to make it a "symbolic" proc symlink ... ln -sP
> > 
> > That will do any path redirection you need.
> 
> Nope, for:
> 
> ln -sP /net/honorificabilitudinitatibus  /net/localhost
> 
> ln: lstat() failed.  /net/localhost: No route to host
> 
> > 
> > Thomas
> 
> That
> 
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26113




_______________________________________________
Technology
http://community.qnx.com/sf/go/post26206
RE: RE: localhost  
In fact, we don't even need to "mkdir /net" if we are using the "-sP" to
the ln command because "-P" makes the link go into the proc manager
prefix tree.  

So the step is, 
1) before qnet is mounted, create the symlink, "ln -sP /net/mybox
/net/localhost".
2) start qnet. 

Thanks
Weijie


-----Original Message-----
From: Weijie Zhang 
Sent: April 7, 2009 10:34 AM
To: 'post26206@community.qnx.com'
Subject: RE: RE: localhost

How about do the way of "mixed dir":
1) before qnet is mounted, "mkdir /net".
2) create the symlink, "ln -sP /net/mybox /net/localhost".
3) start qnet, "mount -Tio-net /lib/dll/lsm-qnet.so; hostname mybox;". 

So the /net is a "mixed" directory as both local file system and qnet
are taking in charge of the name /net. 

Then you can "cd /net/localhost" to play there.

Thanks
Weijie


-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com] 
Sent: April 7, 2009 9:51 AM
To: technology-networking
Subject: Re: RE: localhost

I'll try again then ...

ln -sP /net/nodename  /net/localhost
 
 ln: lstat() failed.  /net/localhost: No route to host


> I think it should have said:
> 
> ln -sP /net/honorificabilitudinitatibus  /net/localhost
> 
> ln: lstat() failed.  Could not spell "honorificabilitudinitatibus"
> 
> (OK.  That was a useless comment, but there you go).
> 
>    R.
> 
> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com] 
> Sent: Monday, April 06, 2009 2:18 PM
> To: technology-networking
> Subject: Re: localhost
> 
> > Mario Charest wrote:
> > > Would it make any kind of sense for /net/localhost to point to the

> > > local
> > machine. I know it would make my life easy.
> > >
> > > I tried creating a link ( ln -P ) but as I expected that didn't
> work.
> > >   
> > You need to make it a "symbolic" proc symlink ... ln -sP
> > 
> > That will do any path redirection you need.
> 
> Nope, for:
> 
> ln -sP /net/honorificabilitudinitatibus  /net/localhost
> 
> ln: lstat() failed.  /net/localhost: No route to host
> 
> > 
> > Thomas
> 
> That
> 
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26113




_______________________________________________
Technology
http://community.qnx.com/sf/go/post26206
RE: RE: localhost  

> -----Original Message-----
> From: Weijie Zhang [mailto:community-noreply@qnx.com]
> Sent: April-07-09 10:54 AM
> To: technology-networking
> Subject: RE: RE: localhost
> 
> In fact, we don't even need to "mkdir /net" if we are using the "-sP"
> to
> the ln command because "-P" makes the link go into the proc manager
> prefix tree.
> 
> So the step is,
> 1) before qnet is mounted, create the symlink, "ln -sP /net/mybox
> /net/localhost".
> 2) start qnet.
> 


Ok but isn't odd that -sP doesn't work afterward?

That being said for us that is no possible because the qnet is first started with a default hostname in the .boot file, 
and then when we get access to the file system the hostname is changed.  I guess I could change that so that we umount 
qnet and then mount it again with the proper hostname.
 
> Thanks
> Weijie
> 
RE: RE: localhost  
I guess I agree there might be something not appropriate in qnet of
dealing with symlink. 

I am not quite clear on what your target system is. Suppose you have
your own target.build and build your own image, you may do "ln -sP ..."
and define hostname before running io-pkt + qnet. If your system is just
a standard nto box installed on a partition of your hard drive, how
about "echo mybox > /etc/HOSTNAME", so that each time the box is
rebooted, the /etc/rc.d/rc.sysinit will read that file and find the
hostname "mybox" you defined. Because the hostname is not localhost
anymore, the qnet will use what you defined and won't fake one. 

Thanks
Weijie




-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com] 
Sent: April 7, 2009 10:58 AM
To: technology-networking
Subject: RE: RE: localhost



> -----Original Message-----
> From: Weijie Zhang [mailto:community-noreply@qnx.com]
> Sent: April-07-09 10:54 AM
> To: technology-networking
> Subject: RE: RE: localhost
> 
> In fact, we don't even need to "mkdir /net" if we are using the "-sP"
> to
> the ln command because "-P" makes the link go into the proc manager
> prefix tree.
> 
> So the step is,
> 1) before qnet is mounted, create the symlink, "ln -sP /net/mybox
> /net/localhost".
> 2) start qnet.
> 


Ok but isn't odd that -sP doesn't work afterward?

That being said for us that is no possible because the qnet is first
started with a default hostname in the .boot file, and then when we get
access to the file system the hostname is changed.  I guess I could
change that so that we umount qnet and then mount it again with the
proper hostname.
 
> Thanks
> Weijie
> 


_______________________________________________
Technology
http://community.qnx.com/sf/go/post26232
Re: localhost  
I think the basic issue falls out because ln always tries to lstat() 
the destination, to make sure that it doesn't already exist.  However,
in the case of qnet, instead of returning ENOENT when it can't find the
destination, it returns EHOSTUNREACH; this confuses ln, so it bails.
The real question for the networking gurus is: is this the right
behaviour?  Shouldn't the /net mount point return ENOENT like any other
filesystem?  Or should ln (and anyone else who might operate on /net)
treat EHOSTUNREACH the same as ENOENT?

Mario, for your specfic case it might be the most expedient route to
compile your own little application that calls pathmgr_symlink()
directly without doing all the checks that ln does.  While it's rarely
a good long-term plan to compile your own system management utilities,
I think it might be a lesser evil than remounting qnet.

Just my $0.02,

-Will


On Tue, 7 Apr 2009 10:58:20 -0400 (EDT)
Mario Charest <community-noreply@qnx.com> wrote:

> 
> 
> > -----Original Message-----
> > From: Weijie Zhang [mailto:community-noreply@qnx.com]
> > Sent: April-07-09 10:54 AM
> > To: technology-networking
> > Subject: RE: RE: localhost
> > 
> > In fact, we don't even need to "mkdir /net" if we are using the "-sP"
> > to
> > the ln command because "-P" makes the link go into the proc manager
> > prefix tree.
> > 
> > So the step is,
> > 1) before qnet is mounted, create the symlink, "ln -sP /net/mybox
> > /net/localhost".
> > 2) start qnet.
> > 
> 
> 
> Ok but isn't odd that -sP doesn't work afterward?
> 
> That being said for us that is no possible because the qnet is first started with a default hostname in the .boot file
, and then when we get access to the file system the hostname is changed.  I guess I could change that so that we umount
 qnet and then mount it again with the proper hostname.
>  
> > Thanks
> > Weijie
> > 
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26232
> 
> 


-- 
Will Miles <wmiles@sgl.com>
RE: localhost  

> -----Original Message-----
> From: Will Miles [mailto:community-noreply@qnx.com]
> Sent: April-07-09 12:41 PM
> To: technology-networking
> Subject: Re: localhost
> 
> I think the basic issue falls out because ln always tries to lstat()
> the destination, to make sure that it doesn't already exist.  However,
> in the case of qnet, instead of returning ENOENT when it can't find the
> destination, it returns EHOSTUNREACH; this confuses ln, so it bails.
> The real question for the networking gurus is: is this the right
> behaviour?  Shouldn't the /net mount point return ENOENT like any other
> filesystem?  Or should ln (and anyone else who might operate on /net)
> treat EHOSTUNREACH the same as ENOENT?

Well I would expect the -P option of ln to totally disregard this.  It's suppose to be handled by the process manager, 
why care if the basename (/net) exist or not.

> 
> Mario, for your specfic case it might be the most expedient route to
> compile your own little application that calls pathmgr_symlink()
> directly without doing all the checks that ln does.  While it's rarely
> a good long-term plan to compile your own system management utilities,
> I think it might be a lesser evil than remounting qnet.

We'll just live without /net/localhost.  Funny that nobody else felt the need for such a feature,  I mean it's in TCP/IP
 and even in QNX4 ( node 0 is the local node). Programma

> 
> Just my $0.02,

Input appreciated !

> 
> -Will
> 
> 
> On Tue, 7 Apr 2009 10:58:20 -0400 (EDT)
> Mario Charest <community-noreply@qnx.com> wrote:
> 
> >
> >
> > > -----Original Message-----
> > > From: Weijie Zhang [mailto:community-noreply@qnx.com]
> > > Sent: April-07-09 10:54 AM
> > > To: technology-networking
> > > Subject: RE: RE: localhost
> > >
> > > In fact, we don't even need to "mkdir /net" if we are using the "-
> sP"
> > > to
> > > the ln command because "-P" makes the link go into the proc manager
> > > prefix tree.
> > >
> > > So the step is,
> > > 1) before qnet is mounted, create the symlink, "ln -sP /net/mybox
> > > /net/localhost".
> > > 2) start qnet.
> > >
> >
> >
> > Ok but isn't odd that -sP doesn't work afterward?
> >
> > That being said for us that is no possible because the qnet is first
> started with a default hostname in the .boot file, and then when we get
> access to the file system the hostname is changed.  I guess I could
> change that so that we umount qnet and then mount it again with the
> proper hostname.
> >
> > > Thanks
> > > Weijie
> > >
> >
> >
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post26232
> >
> >
> 
> 
> --
> Will Miles <wmiles@sgl.com>
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26248
> 
Re: localhost  
Comments within quoted text.

On Tue, 7 Apr 2009 13:23:37 -0400 (EDT)
Mario Charest <community-noreply@qnx.com> wrote:

> 
> 
> > -----Original Message-----
> > From: Will Miles [mailto:community-noreply@qnx.com]
> > Sent: April-07-09 12:41 PM
> > To: technology-networking
> > Subject: Re: localhost
> > 
> > I think the basic issue falls out because ln always tries to lstat()
> > the destination, to make sure that it doesn't already exist.  However,
> > in the case of qnet, instead of returning ENOENT when it can't find the
> > destination, it returns EHOSTUNREACH; this confuses ln, so it bails.
> > The real question for the networking gurus is: is this the right
> > behaviour?  Shouldn't the /net mount point return ENOENT like any other
> > filesystem?  Or should ln (and anyone else who might operate on /net)
> > treat EHOSTUNREACH the same as ENOENT?
> 
> Well I would expect the -P option of ln to totally disregard this.  It's suppose to be handled by the process manager,
 why care if the basename (/net) exist or not.
> 

It's the full name it's checking, not the base name.  It wants to be
sure that "/net/localhost" isn't a file that already exists before it
creates a symlink with that name; the problem in this case is that
qnet doesn't return 'ENOENT' like it's expecting if the file doesn't
exist.  I agree that it would be practical to allow ln -sP to skip these
checks though - and additionally to allow procmgr symlinks to be added
'in front of' or 'behind' a file or directory that already exists,
similar to the way mount points can be overlaid.  A clever system
administrator could compose a poor man's failover system with this
facility...

Sounds like it's time to propose a patch to ln!  

-Will



-- 
Will Miles <wmiles@sgl.com>
RE: localhost  
Or simply write a one-line code of my_ln_sP.c that calls
pathmgr_symlink().

I've created a PR on ln. Thanks.

Thanks
Weijie


-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com] 
Sent: April 7, 2009 1:24 PM
To: technology-networking
Subject: RE: localhost



> -----Original Message-----
> From: Will Miles [mailto:community-noreply@qnx.com]
> Sent: April-07-09 12:41 PM
> To: technology-networking
> Subject: Re: localhost
> 
> I think the basic issue falls out because ln always tries to lstat()
> the destination, to make sure that it doesn't already exist.  However,
> in the case of qnet, instead of returning ENOENT when it can't find
the
> destination, it returns EHOSTUNREACH; this confuses ln, so it bails.
> The real question for the networking gurus is: is this the right
> behaviour?  Shouldn't the /net mount point return ENOENT like any
other
> filesystem?  Or should ln (and anyone else who might operate on /net)
> treat EHOSTUNREACH the same as ENOENT?

Well I would expect the -P option of ln to totally disregard this.  It's
suppose to be handled by the process manager, why care if the basename
(/net) exist or not.

> 
> Mario, for your specfic case it might be the most expedient route to
> compile your own little application that calls pathmgr_symlink()
> directly without doing all the checks that ln does.  While it's rarely
> a good long-term plan to compile your own system management utilities,
> I think it might be a lesser evil than remounting qnet.

We'll just live without /net/localhost.  Funny that nobody else felt the
need for such a feature,  I mean it's in TCP/IP and even in QNX4 ( node
0 is the local node). Programma

> 
> Just my $0.02,

Input appreciated !

> 
> -Will
> 
> 
> On Tue, 7 Apr 2009 10:58:20 -0400 (EDT)
> Mario Charest <community-noreply@qnx.com> wrote:
> 
> >
> >
> > > -----Original Message-----
> > > From: Weijie Zhang [mailto:community-noreply@qnx.com]
> > > Sent: April-07-09 10:54 AM
> > > To: technology-networking
> > > Subject: RE: RE: localhost
> > >
> > > In fact, we don't even need to "mkdir /net" if we are using the "-
> sP"
> > > to
> > > the ln command because "-P" makes the link go into the proc
manager
> > > prefix tree.
> > >
> > > So the step is,
> > > 1) before qnet is mounted, create the symlink, "ln -sP /net/mybox
> > > /net/localhost".
> > > 2) start qnet.
> > >
> >
> >
> > Ok but isn't odd that -sP doesn't work afterward?
> >
> > That being said for us that is no possible because the qnet is first
> started with a default hostname in the .boot file, and then when we
get
> access to the file system the hostname is changed.  I guess I could
> change that so that we umount qnet and then mount it again with the
> proper hostname.
> >
> > > Thanks
> > > Weijie
> > >
> >
> >
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post26232
> >
> >
> 
> 
> --
> Will Miles <wmiles@sgl.com>
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26248
> 


_______________________________________________
Technology
http://community.qnx.com/sf/go/post26252