Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - pid/nid from name: (16 Items)
   
pid/nid from name  
I'm trying to find the pid/nid of a process from its name registered with name_attach().  It's the nid I'm having 
trouble with.





Re: pid/nid from name  
Can you call ConnectServerInfo on the coid?

Mario Charest wrote:
> I'm trying to find the pid/nid of a process from its name registered with name_attach().  It's the nid I'm having 
trouble with.
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26136
> 

-- 
cburgess@qnx.com
RE: pid/nid from name  
Hum not sure, the idea is it's possible the process is stuck in a loop, it's my understanding that a name_open() will 
not work, since it wouldn't be able to handle the IO_CONNECT  message.  My goal is to kill (SIGKILL) processes that 
haven't respond to our normal termination method, I cannot assume they are in a sane state.

> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com]
> Sent: April-06-09 4:23 PM
> To: technology-networking
> Subject: Re: pid/nid from name
> 
> Can you call ConnectServerInfo on the coid?
> 
> Mario Charest wrote:
> > I'm trying to find the pid/nid of a process from its name registered
> with name_attach().  It's the nid I'm having trouble with.
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post26136
> >
> 
> --
> cburgess@qnx.com
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26138
> 
RE: pid/nid from name  
Try the back door then :)

/proc/mount/dev/name/[global|local]/<your_registered_name>/<node>,<pid>,
<chid>,<ftype>,<handle>

-xtang


> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: April 6, 2009 4:35 PM
> To: technology-networking
> Subject: RE: pid/nid from name
> 
> Hum not sure, the idea is it's possible the process is stuck in a
loop,
> it's my understanding that a name_open() will not work, since it
wouldn't
> be able to handle the IO_CONNECT  message.  My goal is to kill
(SIGKILL)
> processes that haven't respond to our normal termination method, I
cannot
> assume they are in a sane state.
> 
> > -----Original Message-----
> > From: Colin Burgess [mailto:community-noreply@qnx.com]
> > Sent: April-06-09 4:23 PM
> > To: technology-networking
> > Subject: Re: pid/nid from name
> >
> > Can you call ConnectServerInfo on the coid?
> >
> > Mario Charest wrote:
> > > I'm trying to find the pid/nid of a process from its name
registered
> > with name_attach().  It's the nid I'm having trouble with.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Technology
> > > http://community.qnx.com/sf/go/post26136
> > >
> >
> > --
> > cburgess@qnx.com
> >
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post26138
> >
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26142
RE: pid/nid from name  
> -----Original Message-----
> From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> Sent: April-06-09 4:39 PM
> To: technology-networking
> Subject: RE: pid/nid from name
> 
> Try the back door then :)
> 
> /proc/mount/dev/name/[global|local]/<your_registered_name>/<node>,<pid>
> ,
> <chid>,<ftype>,<handle>

There doesn't seem to be anything under /proc/mount/dev/name/global but the info on gns

I tried it  under /dev/name/global, but the <node> field can be 0 in some cases depending on the relationship between 
the location of the program and the location of the gns server, at least that is what I observed.

> 
> -xtang
> 
> 
> > -----Original Message-----
> > From: Mario Charest [mailto:community-noreply@qnx.com]
> > Sent: April 6, 2009 4:35 PM
> > To: technology-networking
> > Subject: RE: pid/nid from name
> >
> > Hum not sure, the idea is it's possible the process is stuck in a
> loop,
> > it's my understanding that a name_open() will not work, since it
> wouldn't
> > be able to handle the IO_CONNECT  message.  My goal is to kill
> (SIGKILL)
> > processes that haven't respond to our normal termination method, I
> cannot
> > assume they are in a sane state.
> >
> > > -----Original Message-----
> > > From: Colin Burgess [mailto:community-noreply@qnx.com]
> > > Sent: April-06-09 4:23 PM
> > > To: technology-networking
> > > Subject: Re: pid/nid from name
> > >
> > > Can you call ConnectServerInfo on the coid?
> > >
> > > Mario Charest wrote:
> > > > I'm trying to find the pid/nid of a process from its name
> registered
> > > with name_attach().  It's the nid I'm having trouble with.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Technology
> > > > http://community.qnx.com/sf/go/post26136
> > > >
> > >
> > > --
> > > cburgess@qnx.com
> > >
> > > _______________________________________________
> > > Technology
> > > http://community.qnx.com/sf/go/post26138
> > >
> >
> >
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post26142
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26144
> 
RE: pid/nid from name  
There is GNS! :)

The nid always valid to whoever is looking at it.

If on node A, you have a name. AND, from same node, you do "ls", you
should see nid = 0; but if you goes to node B, and do "ls
/net/nodeA/dev/name/...", you see a nid which won't be 0 (nodeA'd nid on
B).

Not sure this is clear enough. :)

Anyway, which ever machine you are on, you should always be able to
ConnectAttach(nid, pid, chid, ..) that returns back to you.

-xtang

> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: April 6, 2009 4:47 PM
> To: technology-networking
> Subject: RE: pid/nid from name
> 
> > -----Original Message-----
> > From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> > Sent: April-06-09 4:39 PM
> > To: technology-networking
> > Subject: RE: pid/nid from name
> >
> > Try the back door then :)
> >
> >
/proc/mount/dev/name/[global|local]/<your_registered_name>/<node>,<pid>
> > ,
> > <chid>,<ftype>,<handle>
> 
> There doesn't seem to be anything under /proc/mount/dev/name/global
but
> the info on gns
> 
> I tried it  under /dev/name/global, but the <node> field can be 0 in
some
> cases depending on the relationship between the location of the
program
> and the location of the gns server, at least that is what I observed.
> 
> >
> > -xtang
> >
> >
> > > -----Original Message-----
> > > From: Mario Charest [mailto:community-noreply@qnx.com]
> > > Sent: April 6, 2009 4:35 PM
> > > To: technology-networking
> > > Subject: RE: pid/nid from name
> > >
> > > Hum not sure, the idea is it's possible the process is stuck in a
> > loop,
> > > it's my understanding that a name_open() will not work, since it
> > wouldn't
> > > be able to handle the IO_CONNECT  message.  My goal is to kill
> > (SIGKILL)
> > > processes that haven't respond to our normal termination method, I
> > cannot
> > > assume they are in a sane state.
> > >
> > > > -----Original Message-----
> > > > From: Colin Burgess [mailto:community-noreply@qnx.com]
> > > > Sent: April-06-09 4:23 PM
> > > > To: technology-networking
> > > > Subject: Re: pid/nid from name
> > > >
> > > > Can you call ConnectServerInfo on the coid?
> > > >
> > > > Mario Charest wrote:
> > > > > I'm trying to find the pid/nid of a process from its name
> > registered
> > > > with name_attach().  It's the nid I'm having trouble with.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Technology
> > > > > http://community.qnx.com/sf/go/post26136
> > > > >
> > > >
> > > > --
> > > > cburgess@qnx.com
> > > >
> > > > _______________________________________________
> > > > Technology
> > > > http://community.qnx.com/sf/go/post26138
> > > >
> > >
> > >
> > > _______________________________________________
> > > Technology
> > > http://community.qnx.com/sf/go/post26142
> >
> >
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post26144
> >
> 
> 
> _______________________________________________
> Technology
>...
RE: pid/nid from name  

> -----Original Message-----
> From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> Sent: April-06-09 4:53 PM
> To: technology-networking
> Subject: RE: pid/nid from name
> 
> There is GNS! :)
> 
> The nid always valid to whoever is looking at it.
> 
> If on node A, you have a name. AND, from same node, you do "ls", you
> should see nid = 0; but if you goes to node B, and do "ls
> /net/nodeA/dev/name/...", you see a nid which won't be 0 (nodeA'd nid
> on
> B).
> 
> Not sure this is clear enough. :)

Yes but this not what I'm seing.

Node A (called neutrino) runs gns -s, node B runs gns -c.  I start the application on node A and it creates "/dev/name/
global/mcharest/logc/Trace_0"

ls -l gives me "lr-xr-xr-x  0 root      root              0 Apr 07 09:01 0,172687673,2,0,12 -> ../../../net/neutrino.
comact.com/ /mcharest/logc/Trace_0/0,172687673,2,0,12"

Node is 0 hence everything look ok .  Then I go on Node B.

ls -l /dev/name/global/mcharest/logc/Trace_0 returns:

lr-xr-xr-x  0 root      root              0 Apr 07 13:01 0,172687673,2,0,12 -> ./../../net/neutrino.comact.com/mcharest/
logc/Trace_0/0,172687673,2,0,12

See, the node number is still 0.  If I do like in your example, from node B I do ls -l /net/neutrino/dev/name/global/
mcharest/logc/Trace_0 I still get a 0.  Even if that method would work it's the chicken & egg problem.

> 
> Anyway, which ever machine you are on, you should always be able to
> ConnectAttach(nid, pid, chid, ..) that returns back to you.
> 
> -xtang
> 
> > -----Original Message-----
> > From: Mario Charest [mailto:community-noreply@qnx.com]
> > Sent: April 6, 2009 4:47 PM
> > To: technology-networking
> > Subject: RE: pid/nid from name
> >
> > > -----Original Message-----
> > > From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> > > Sent: April-06-09 4:39 PM
> > > To: technology-networking
> > > Subject: RE: pid/nid from name
> > >
> > > Try the back door then :)
> > >
> > >
> /proc/mount/dev/name/[global|local]/<your_registered_name>/<node>,<pid>
> > > ,
> > > <chid>,<ftype>,<handle>
> >
> > There doesn't seem to be anything under /proc/mount/dev/name/global
> but
> > the info on gns
> >
> > I tried it  under /dev/name/global, but the <node> field can be 0 in
> some
> > cases depending on the relationship between the location of the
> program
> > and the location of the gns server, at least that is what I observed.
> >
> > >
> > > -xtang
> > >
> > >
> > > > -----Original Message-----
> > > > From: Mario Charest [mailto:community-noreply@qnx.com]
> > > > Sent: April 6, 2009 4:35 PM
> > > > To: technology-networking
> > > > Subject: RE: pid/nid from name
> > > >
> > > > Hum not sure, the idea is it's possible the process is stuck in a
> > > loop,
> > > > it's my understanding that a name_open() will not work, since it
> > > wouldn't
> > > > be able to handle the IO_CONNECT  message.  My goal is to kill
> > > (SIGKILL)
> > > > processes that haven't respond to our normal termination method,
> I
> > > cannot
> > > > assume they are in a sane state.
> > > >
> > > > > -----Original Message-----
> > > > > From: Colin Burgess [mailto:community-noreply@qnx.com]
> > > > > Sent: April-06-09 4:23 PM
> > > > > To: technology-networking
> > > > > Subject: Re: pid/nid from name
> > > > >
> > >...
View Full Message
Re: RE: pid/nid from name  
Does no answer means  it's can't be done?

> 
> 
> > -----Original Message-----
> > From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> > Sent: April-06-09 4:53 PM
> > To: technology-networking
> > Subject: RE: pid/nid from name
> > 
> > There is GNS! :)
> > 
> > The nid always valid to whoever is looking at it.
> > 
> > If on node A, you have a name. AND, from same node, you do "ls", you
> > should see nid = 0; but if you goes to node B, and do "ls
> > /net/nodeA/dev/name/...", you see a nid which won't be 0 (nodeA'd nid
> > on
> > B).
> > 
> > Not sure this is clear enough. :)
> 
> Yes but this not what I'm seing.
> 
> Node A (called neutrino) runs gns -s, node B runs gns -c.  I start the 
> application on node A and it creates "/dev/name/global/mcharest/logc/Trace_0"
> 
> ls -l gives me "lr-xr-xr-x  0 root      root              0 Apr 07 09:01 0,
> 172687673,2,0,12 -> ../../../net/neutrino.comact.com/ /mcharest/logc/Trace_0/0
> ,172687673,2,0,12"
> 
> Node is 0 hence everything look ok .  Then I go on Node B.
> 
> ls -l /dev/name/global/mcharest/logc/Trace_0 returns:
> 
> lr-xr-xr-x  0 root      root              0 Apr 07 13:01 0,172687673,2,0,12 ->
>  ./../../net/neutrino.comact.com/mcharest/logc/Trace_0/0,172687673,2,0,12
> 
> See, the node number is still 0.  If I do like in your example, from node B I 
> do ls -l /net/neutrino/dev/name/global/mcharest/logc/Trace_0 I still get a 0. 
>  Even if that method would work it's the chicken & egg problem.
> 
> > 
> > Anyway, which ever machine you are on, you should always be able to
> > ConnectAttach(nid, pid, chid, ..) that returns back to you.
> > 
> > -xtang
> > 
> > > -----Original Message-----
> > > From: Mario Charest [mailto:community-noreply@qnx.com]
> > > Sent: April 6, 2009 4:47 PM
> > > To: technology-networking
> > > Subject: RE: pid/nid from name
> > >
> > > > -----Original Message-----
> > > > From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> > > > Sent: April-06-09 4:39 PM
> > > > To: technology-networking
> > > > Subject: RE: pid/nid from name
> > > >
> > > > Try the back door then :)
> > > >
> > > >
> > /proc/mount/dev/name/[global|local]/<your_registered_name>/<node>,<pid>
> > > > ,
> > > > <chid>,<ftype>,<handle>
> > >
> > > There doesn't seem to be anything under /proc/mount/dev/name/global
> > but
> > > the info on gns
> > >
> > > I tried it  under /dev/name/global, but the <node> field can be 0 in
> > some
> > > cases depending on the relationship between the location of the
> > program
> > > and the location of the gns server, at least that is what I observed.
> > >
> > > >
> > > > -xtang
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Mario Charest [mailto:community-noreply@qnx.com]
> > > > > Sent: April 6, 2009 4:35 PM
> > > > > To: technology-networking
> > > > > Subject: RE: pid/nid from name
> > > > >
> > > > > Hum not sure, the idea is it's possible the process is stuck in a
> > > > loop,
> > > > > it's my understanding that a name_open() will not work, since it
> > > > wouldn't
> > > > > be able to handle the IO_CONNECT  message.  My goal is to kill
> > > > (SIGKILL)
> > >...
View Full Message
RE: RE: pid/nid from name  
Sorry, no answer means "it's not suppose to be that way"...

> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: April 8, 2009 1:21 PM
> To: technology-networking
> Subject: Re: RE: pid/nid from name
> 
> Does no answer means  it's can't be done?
> 
> >
> >
> > > -----Original Message-----
> > > From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> > > Sent: April-06-09 4:53 PM
> > > To: technology-networking
> > > Subject: RE: pid/nid from name
> > >
> > > There is GNS! :)
> > >
> > > The nid always valid to whoever is looking at it.
> > >
> > > If on node A, you have a name. AND, from same node, you do "ls",
you
> > > should see nid = 0; but if you goes to node B, and do "ls
> > > /net/nodeA/dev/name/...", you see a nid which won't be 0 (nodeA'd
nid
> > > on
> > > B).
> > >
> > > Not sure this is clear enough. :)
> >
> > Yes but this not what I'm seing.
> >
> > Node A (called neutrino) runs gns -s, node B runs gns -c.  I start
the
> > application on node A and it creates
> "/dev/name/global/mcharest/logc/Trace_0"
> >
> > ls -l gives me "lr-xr-xr-x  0 root      root              0 Apr 07
09:01
> 0,
> > 172687673,2,0,12 -> ../../../net/neutrino.comact.com/
> /mcharest/logc/Trace_0/0
> > ,172687673,2,0,12"
> >
> > Node is 0 hence everything look ok .  Then I go on Node B.
> >
> > ls -l /dev/name/global/mcharest/logc/Trace_0 returns:
> >
> > lr-xr-xr-x  0 root      root              0 Apr 07 13:01
> 0,172687673,2,0,12 ->
> >
./../../net/neutrino.comact.com/mcharest/logc/Trace_0/0,172687673,2,0,1
> 2
> >
> > See, the node number is still 0.  If I do like in your example, from
> node B I
> > do ls -l /net/neutrino/dev/name/global/mcharest/logc/Trace_0 I still
get
> a 0.
> >  Even if that method would work it's the chicken & egg problem.
> >
> > >
> > > Anyway, which ever machine you are on, you should always be able
to
> > > ConnectAttach(nid, pid, chid, ..) that returns back to you.
> > >
> > > -xtang
> > >
> > > > -----Original Message-----
> > > > From: Mario Charest [mailto:community-noreply@qnx.com]
> > > > Sent: April 6, 2009 4:47 PM
> > > > To: technology-networking
> > > > Subject: RE: pid/nid from name
> > > >
> > > > > -----Original Message-----
> > > > > From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> > > > > Sent: April-06-09 4:39 PM
> > > > > To: technology-networking
> > > > > Subject: RE: pid/nid from name
> > > > >
> > > > > Try the back door then :)
> > > > >
> > > > >
> > >
>
/proc/mount/dev/name/[global|local]/<your_registered_name>/<node>,<pid>
> > > > > ,
> > > > > <chid>,<ftype>,<handle>
> > > >
> > > > There doesn't seem to be anything under
/proc/mount/dev/name/global
> > > but
> > > > the info on gns
> > > >
> > > > I tried it  under /dev/name/global, but the <node> field can be
0 in
> > > some
> > > > cases depending on the relationship between the location of the
> > > program
> > > > and the location of the gns server, at least that is what I
observed.
> > > >
> > > > >
> > > > > -xtang
> > > > >
> >...
View Full Message
Re: RE: RE: pid/nid from name  
> Sorry, no answer means "it's not suppose to be that way"...

Sorry, should look at the source first. :( Maybe "it is suppose to be this way". If a filename changed because it is 
viewed from different machine, things getting crazy when gns server try to sync (or it seems like...)

Anyway, the nd is "the nd of the registrer machine in gns server's view". In your case, if you register from node B 
(your gns client), you should see a non-zero nd.

So if you run your program on the same node of gns server (node A), things are simple. Otherwise, you have to parse the 
linked name and netmgr_strtond() it. 

It doesn't sound very straight forward I guess. Connect to the server and ConnectServerInfo() is still the "official way
" to go.
RE: RE: RE: pid/nid from name  

> -----Original Message-----
> From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> Sent: April-08-09 5:17 PM
> To: technology-networking
> Subject: Re: RE: RE: pid/nid from name
> 
> > Sorry, no answer means "it's not suppose to be that way"...
> 
> Sorry, should look at the source first. :( Maybe "it is suppose to be
> this way". If a filename changed because it is viewed from different
> machine, things getting crazy when gns server try to sync (or it seems
> like...)
> 
> Anyway, the nd is "the nd of the registrer machine in gns server's
> view". In your case, if you register from node B (your gns client), you
> should see a non-zero nd.
> 
> So if you run your program on the same node of gns server (node A),
> things are simple. Otherwise, you have to parse the linked name and
> netmgr_strtond() it.
> 

Ok thanks.

> It doesn't sound very straight forward I guess. Connect to the server
> and ConnectServerInfo() is still the "official way" to go.

Maybe it's official but it sucks since you can't connect to an unresponsive server.

 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26461
> 
RE: RE: RE: pid/nid from name  
The server may not be responding to an _IO_OPEN message, but you should still be able to ConnectAttach to it... maybe 
some hacky use of _connect* might get you what you want...
 
Colin

________________________________

From: Mario Charest [mailto:community-noreply@qnx.com]
Sent: Wed 4/8/2009 5:18 PM
To: technology-networking
Subject: RE: RE: RE: pid/nid from name





> -----Original Message-----
> From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> Sent: April-08-09 5:17 PM
> To: technology-networking
> Subject: Re: RE: RE: pid/nid from name
>
> > Sorry, no answer means "it's not suppose to be that way"...
>
> Sorry, should look at the source first. :( Maybe "it is suppose to be
> this way". If a filename changed because it is viewed from different
> machine, things getting crazy when gns server try to sync (or it seems
> like...)
>
> Anyway, the nd is "the nd of the registrer machine in gns server's
> view". In your case, if you register from node B (your gns client), you
> should see a non-zero nd.
>
> So if you run your program on the same node of gns server (node A),
> things are simple. Otherwise, you have to parse the linked name and
> netmgr_strtond() it.
>

Ok thanks.

> It doesn't sound very straight forward I guess. Connect to the server
> and ConnectServerInfo() is still the "official way" to go.

Maybe it's official but it sucks since you can't connect to an unresponsive server.


> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26461
>


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



Attachment: Text winmail.dat 4.46 KB
RE: RE: RE: pid/nid from name  

> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com]
> Sent: April-08-09 6:31 PM
> To: technology-networking
> Subject: RE: RE: RE: pid/nid from name
> 
> The server may not be responding to an _IO_OPEN message, but you should
> still be able to ConnectAttach to it... maybe some hacky use of
> _connect* might get you what you want...

Either I'm brain dead or I haven't made myself clear.  I'm trying to find the nid and pid of a process via the name it 
register with name_attach() so i can SigKill it.  Can't use ConnectAttach since it needs the nd, pid and chid.

Not sure what the _IO_OPEN you mentioned has to do with anything. It's the _IO_CONNECT I'm worried about. I'm assuming 
_IO_CONNECT is sent by _connect_ctrl()?


> 
> Colin
> 
> ________________________________
> 
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: Wed 4/8/2009 5:18 PM
> To: technology-networking
> Subject: RE: RE: RE: pid/nid from name
> 
> 
> 
> 
> 
> > -----Original Message-----
> > From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> > Sent: April-08-09 5:17 PM
> > To: technology-networking
> > Subject: Re: RE: RE: pid/nid from name
> >
> > > Sorry, no answer means "it's not suppose to be that way"...
> >
> > Sorry, should look at the source first. :( Maybe "it is suppose to be
> > this way". If a filename changed because it is viewed from different
> > machine, things getting crazy when gns server try to sync (or it
> seems
> > like...)
> >
> > Anyway, the nd is "the nd of the registrer machine in gns server's
> > view". In your case, if you register from node B (your gns client),
> > you should see a non-zero nd.
> >
> > So if you run your program on the same node of gns server (node A),
> > things are simple. Otherwise, you have to parse the linked name and
> > netmgr_strtond() it.
> >
> 
> Ok thanks.
> 
> > It doesn't sound very straight forward I guess. Connect to the server
> > and ConnectServerInfo() is still the "official way" to go.
> 
> Maybe it's official but it sucks since you can't connect to an
> unresponsive server.
> 
> 
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post26461
> >
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26462
> 
> 
> 
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26467
Re: pid/nid from name  
(an open is actually just an IO_CONNECT with subtype IO_CONNECT_OPEN)

but you don't need a message - the connect machinery retries the nd and chid from procnto, then does a connect
attach, THEN sends an IO_CONNECT.

So if you can get as far as the ConnectAttach you're golden.

That said, the code probably doesn't directly ALLOW for this right now... but it should be possible! :-)

Mario Charest wrote:
> 
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>> Sent: April-08-09 6:31 PM
>> To: technology-networking
>> Subject: RE: RE: RE: pid/nid from name
>>
>> The server may not be responding to an _IO_OPEN message, but you should
>> still be able to ConnectAttach to it... maybe some hacky use of
>> _connect* might get you what you want...
> 
> Either I'm brain dead or I haven't made myself clear.  I'm trying to find the nid and pid of a process via the name it
 register with name_attach() so i can SigKill it.  Can't use ConnectAttach since it needs the nd, pid and chid.
> 
> Not sure what the _IO_OPEN you mentioned has to do with anything. It's the _IO_CONNECT I'm worried about. I'm assuming
 _IO_CONNECT is sent by _connect_ctrl()?
> 
> 
>> Colin
>>
>> ________________________________
>>
>> From: Mario Charest [mailto:community-noreply@qnx.com]
>> Sent: Wed 4/8/2009 5:18 PM
>> To: technology-networking
>> Subject: RE: RE: RE: pid/nid from name
>>
>>
>>
>>
>>
>>> -----Original Message-----
>>> From: Xiaodan Tang [mailto:community-noreply@qnx.com]
>>> Sent: April-08-09 5:17 PM
>>> To: technology-networking
>>> Subject: Re: RE: RE: pid/nid from name
>>>
>>>> Sorry, no answer means "it's not suppose to be that way"...
>>> Sorry, should look at the source first. :( Maybe "it is suppose to be
>>> this way". If a filename changed because it is viewed from different
>>> machine, things getting crazy when gns server try to sync (or it
>> seems
>>> like...)
>>>
>>> Anyway, the nd is "the nd of the registrer machine in gns server's
>>> view". In your case, if you register from node B (your gns client),
>>> you should see a non-zero nd.
>>>
>>> So if you run your program on the same node of gns server (node A),
>>> things are simple. Otherwise, you have to parse the linked name and
>>> netmgr_strtond() it.
>>>
>> Ok thanks.
>>
>>> It doesn't sound very straight forward I guess. Connect to the server
>>> and ConnectServerInfo() is still the "official way" to go.
>> Maybe it's official but it sucks since you can't connect to an
>> unresponsive server.
>>
>>
>>> _______________________________________________
>>> Technology
>>> http://community.qnx.com/sf/go/post26461
>>>
>>
>> _______________________________________________
>> Technology
>> http://community.qnx.com/sf/go/post26462
>>
>>
>>
>>
>>
>> _______________________________________________
>> Technology
>> http://community.qnx.com/sf/go/post26467
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post26470
> 

-- 
cburgess@qnx.com
RE: pid/nid from name  
But we need to see the return value of _IO_CONNECT message to determine
if we are talking to the right manager...

-xtang

> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com]
> Sent: April 8, 2009 9:00 PM
> To: technology-networking
> Subject: Re: pid/nid from name
> 
> (an open is actually just an IO_CONNECT with subtype IO_CONNECT_OPEN)
> 
> but you don't need a message - the connect machinery retries the nd
and
> chid from procnto, then does a connect
> attach, THEN sends an IO_CONNECT.
> 
> So if you can get as far as the ConnectAttach you're golden.
> 
> That said, the code probably doesn't directly ALLOW for this right
now...
> but it should be possible! :-)
> 
> Mario Charest wrote:
> >
> >> -----Original Message-----
> >> From: Colin Burgess [mailto:community-noreply@qnx.com]
> >> Sent: April-08-09 6:31 PM
> >> To: technology-networking
> >> Subject: RE: RE: RE: pid/nid from name
> >>
> >> The server may not be responding to an _IO_OPEN message, but you
should
> >> still be able to ConnectAttach to it... maybe some hacky use of
> >> _connect* might get you what you want...
> >
> > Either I'm brain dead or I haven't made myself clear.  I'm trying to
> find the nid and pid of a process via the name it register with
> name_attach() so i can SigKill it.  Can't use ConnectAttach since it
needs
> the nd, pid and chid.
> >
> > Not sure what the _IO_OPEN you mentioned has to do with anything.
It's
> the _IO_CONNECT I'm worried about. I'm assuming _IO_CONNECT is sent by
> _connect_ctrl()?
> >
> >
> >> Colin
> >>
> >> ________________________________
> >>
> >> From: Mario Charest [mailto:community-noreply@qnx.com]
> >> Sent: Wed 4/8/2009 5:18 PM
> >> To: technology-networking
> >> Subject: RE: RE: RE: pid/nid from name
> >>
> >>
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Xiaodan Tang [mailto:community-noreply@qnx.com]
> >>> Sent: April-08-09 5:17 PM
> >>> To: technology-networking
> >>> Subject: Re: RE: RE: pid/nid from name
> >>>
> >>>> Sorry, no answer means "it's not suppose to be that way"...
> >>> Sorry, should look at the source first. :( Maybe "it is suppose to
be
> >>> this way". If a filename changed because it is viewed from
different
> >>> machine, things getting crazy when gns server try to sync (or it
> >> seems
> >>> like...)
> >>>
> >>> Anyway, the nd is "the nd of the registrer machine in gns server's
> >>> view". In your case, if you register from node B (your gns
client),
> >>> you should see a non-zero nd.
> >>>
> >>> So if you run your program on the same node of gns server (node
A),
> >>> things are simple. Otherwise, you have to parse the linked name
and
> >>> netmgr_strtond() it.
> >>>
> >> Ok thanks.
> >>
> >>> It doesn't sound very straight forward I guess. Connect to the
server
> >>> and ConnectServerInfo() is still the "official way" to go.
> >> Maybe it's official but it sucks since you can't connect to an
> >> unresponsive server.
> >>
> >>
> >>> _______________________________________________
> >>> Technology
> >>> http://community.qnx.com/sf/go/post26461
> >>>
> >>
> >> _______________________________________________
> >> Technology
> >>...
Re: pid/nid from name  
Yes, I guess so.

I guess the moral of the story is that your system is only as robust as your resource managers!

Xiaodan Tang wrote:
> But we need to see the return value of _IO_CONNECT message to determine
> if we are talking to the right manager...
> 
> -xtang
> 
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>> Sent: April 8, 2009 9:00 PM
>> To: technology-networking
>> Subject: Re: pid/nid from name
>>
>> (an open is actually just an IO_CONNECT with subtype IO_CONNECT_OPEN)
>>
>> but you don't need a message - the connect machinery retries the nd
> and
>> chid from procnto, then does a connect
>> attach, THEN sends an IO_CONNECT.
>>
>> So if you can get as far as the ConnectAttach you're golden.
>>
>> That said, the code probably doesn't directly ALLOW for this right
> now...
>> but it should be possible! :-)
>>
>> Mario Charest wrote:
>>>> -----Original Message-----
>>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>>> Sent: April-08-09 6:31 PM
>>>> To: technology-networking
>>>> Subject: RE: RE: RE: pid/nid from name
>>>>
>>>> The server may not be responding to an _IO_OPEN message, but you
> should
>>>> still be able to ConnectAttach to it... maybe some hacky use of
>>>> _connect* might get you what you want...
>>> Either I'm brain dead or I haven't made myself clear.  I'm trying to
>> find the nid and pid of a process via the name it register with
>> name_attach() so i can SigKill it.  Can't use ConnectAttach since it
> needs
>> the nd, pid and chid.
>>> Not sure what the _IO_OPEN you mentioned has to do with anything.
> It's
>> the _IO_CONNECT I'm worried about. I'm assuming _IO_CONNECT is sent by
>> _connect_ctrl()?
>>>
>>>> Colin
>>>>
>>>> ________________________________
>>>>
>>>> From: Mario Charest [mailto:community-noreply@qnx.com]
>>>> Sent: Wed 4/8/2009 5:18 PM
>>>> To: technology-networking
>>>> Subject: RE: RE: RE: pid/nid from name
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Xiaodan Tang [mailto:community-noreply@qnx.com]
>>>>> Sent: April-08-09 5:17 PM
>>>>> To: technology-networking
>>>>> Subject: Re: RE: RE: pid/nid from name
>>>>>
>>>>>> Sorry, no answer means "it's not suppose to be that way"...
>>>>> Sorry, should look at the source first. :( Maybe "it is suppose to
> be
>>>>> this way". If a filename changed because it is viewed from
> different
>>>>> machine, things getting crazy when gns server try to sync (or it
>>>> seems
>>>>> like...)
>>>>>
>>>>> Anyway, the nd is "the nd of the registrer machine in gns server's
>>>>> view". In your case, if you register from node B (your gns
> client),
>>>>> you should see a non-zero nd.
>>>>>
>>>>> So if you run your program on the same node of gns server (node
> A),
>>>>> things are simple. Otherwise, you have to parse the linked name
> and
>>>>> netmgr_strtond() it.
>>>>>
>>>> Ok thanks.
>>>>
>>>>> It doesn't sound very straight forward I guess. Connect to the
> server
>>>>> and ConnectServerInfo() is still the "official way" to go.
>>>> Maybe...
View Full Message