Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Identify ppp processses running on machine: (6 Items)
   
Identify ppp processses running on machine  
Hi 

The system for which i am working needs multiple ppp interfaces for respective serial port, and to control (activate /
deactivate PPP links) depending on command received by system.

I am activating each link throguh program by 

system("pppd/dev/ser1 proxyarp 115200 192.168.0.40:192.168.0.50");
sleep(2);
system("pppd/dev/ser2 proxyarp 115200 192.168.0.40:192.168.0.50");

through which i am able to activate two ppp links.

what should i do to deactivate any single interface among ppp0, ppp1....i had seen that ppp interface(pid) information 
will be there in /var/run/pppn.pid but my target doesnt have full fleged file system, it doesnt have /var ... so through
 what command i can know the existance of ppp interface and deactiavte(terminate/kill) the interface.

Thanks
Ravi 
Re: Identify ppp processses running on machine  
> Hi 
> 
> The system for which i am working needs multiple ppp interfaces for respective
>  serial port, and to control (activate /deactivate PPP links) depending on 
> command received by system.
> 
> I am activating each link throguh program by 
> 
> system("pppd/dev/ser1 proxyarp 115200 192.168.0.40:192.168.0.50");
> sleep(2);
> system("pppd/dev/ser2 proxyarp 115200 192.168.0.40:192.168.0.50");
> 
> through which i am able to activate two ppp links.
> 
> what should i do to deactivate any single interface among ppp0, ppp1....i had 
> seen that ppp interface(pid) information will be there in /var/run/pppn.pid 
> but my target doesnt have full fleged file system, it doesnt have /var ... so 
> through what command i can know the existance of ppp interface and deactiavte(
> terminate/kill) the interface.
> 
> Thanks
> Ravi 


Hmm does

#pidin -p pppd fd

provide You with enough infos ?

Jeevan
Re: Identify ppp processses running on machine  
Hi Jeevan 

It works fine ... it lists all ppp interfaces, i also serached and tried getting simialr information through ifaddrs ..
which is a linked list that maintians all netwrok interface related stuff. The command given by you is lisitng

pidin -p pppd fd
   pid name
618531 usr/sbin/pppd
         0  139279 rw        0 /dev/ser1
         1  106512
         2  106512 rw        0 I4UDP  *.*                   *.*
         3  106512 rw        0 I4UDP  *.*                   *.*
         4    8200 rw    10940 /var/run/pppd.tdb
         5  106512 rw        0 I4UDP  *.*                   *.*
         0s      1

i am bit confused on interpreting " 0 139279 rw 0 /dev/ser1" - can you help me in this.

Now if we want to activate or deactivate the ppp interface

- one way is to store informtion of pidin -p pppd fd into one file, filter pid number, and use...... system("kill pid").

- what i am looking at is something like system("ppp0 SIGTERM") which should terminate ppp0 interface, instead of 
reading from file - is this possible. 

Thnaks
Ravi 




> > Hi 
> > 
> > The system for which i am working needs multiple ppp interfaces for 
> respective
> >  serial port, and to control (activate /deactivate PPP links) depending on 
> > command received by system.
> > 
> > I am activating each link throguh program by 
> > 
> > system("pppd/dev/ser1 proxyarp 115200 192.168.0.40:192.168.0.50");
> > sleep(2);
> > system("pppd/dev/ser2 proxyarp 115200 192.168.0.40:192.168.0.50");
> > 
> > through which i am able to activate two ppp links.
> > 
> > what should i do to deactivate any single interface among ppp0, ppp1....i 
> had 
> > seen that ppp interface(pid) information will be there in /var/run/pppn.pid 
> 
> > but my target doesnt have full fleged file system, it doesnt have /var ... 
> so 
> > through what command i can know the existance of ppp interface and 
> deactiavte(
> > terminate/kill) the interface.
> > 
> > Thanks
> > Ravi 
> 
> 
> Hmm does
> 
> #pidin -p pppd fd
> 
> provide You with enough infos ?
> 
> Jeevan


Re: Identify ppp processses running on machine  
> Hi Jeevan 
> 
> It works fine ... it lists all ppp interfaces, i also serached and tried 
> getting simialr information through ifaddrs ..which is a linked list that 
> maintians all netwrok interface related stuff. The command given by you is 
> lisitng
> 
> pidin -p pppd fd
>    pid name
> 618531 usr/sbin/pppd
>          0   139279 rw        0 /dev/ser1

pppd's stdin is directed to Your serial driver (139279 is pid from Your serial driver) with having rw perms on /dev/ser1
 with offset 0.            

>          1  106512
>          2  106512 rw        0 I4UDP  *.*                   *.*

pppd's stderr is connected to the udp socket without having a connection ... (to be honest I am not realy sure, so 
hopeping for external clearence :-))

>          3  106512 rw        0 I4UDP  *.*                   *.*
>          4    8200 rw    10940 /var/run/pppd.tdb
>          5  106512 rw        0 I4UDP  *.*                   *.*
>          0s      1
> 
> i am bit confused on interpreting " 0 139279 rw 0 /dev/ser1" - can you help me
>  in this.
> 


> Now if we want to activate or deactivate the ppp interface
> 
> - one way is to store informtion of pidin -p pppd fd into one file, filter pid
>  number, and use...... system("kill pid").
> - what i am looking at is something like system("ppp0 SIGTERM") which should 
> terminate ppp0 interface, instead of reading from file - is this possible. 

Try to learn from pidin....

http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/utils/p/pidin/?root=coreos_pub&system=exsy1001

especially Coids(...) function with pidin_proc.c .

Or hope that somebody else here has some shortcut for You or completely other suitable way.

Hope this helps anyway.

> 
> Thnaks
> Ravi 
> 
> 
Regards,
Jeevan
Re: Identify ppp processses running on machine  
Hi Jeevan 

Thansk for link it gave good insight, what i understand is the structure shared_info will holds all data related to 
process. So any info of process can be derived from this. Unfortunatly when i copied pidin.h as it is from Revision: 
205640

http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/utils/p/pidin/pidin.h?root=coreos_pub&system=exsy1001&view=markup

and build the project it is throwing out some errors 
- parse errors before procfs_channel...... in pidin.h 
- include <backtrace.h> not 
found ... in pidin_proc.c

I dont see any probelm with semicolons missing any where - not really able to figure out the probelm as of now. 

Thanks
Ravi 


> > Hi Jeevan 
> > 
> > It works fine ... it lists all ppp interfaces, i also serached and tried 
> > getting simialr information through ifaddrs ..which is a linked list that 
> > maintians all netwrok interface related stuff. The command given by you is 
> > lisitng
> > 
> > pidin -p pppd fd
> >    pid name
> > 618531 usr/sbin/pppd
> >          0   139279 rw        0 /dev/ser1
> 
> pppd's stdin is directed to Your serial driver (139279 is pid from Your serial
>  driver) with having rw perms on /dev/ser1 with offset 0.            
> 
> >          1  106512
> >          2  106512 rw        0 I4UDP  *.*                   *.*
> 
> pppd's stderr is connected to the udp socket without having a connection ... (
> to be honest I am not realy sure, so hopeping for external clearence :-))
> 
> >          3  106512 rw        0 I4UDP  *.*                   *.*
> >          4    8200 rw    10940 /var/run/pppd.tdb
> >          5  106512 rw        0 I4UDP  *.*                   *.*
> >          0s      1
> > 
> > i am bit confused on interpreting " 0 139279 rw 0 /dev/ser1" - can you help 
> me
> >  in this.
> > 
> 
> 
> > Now if we want to activate or deactivate the ppp interface
> > 
> > - one way is to store informtion of pidin -p pppd fd into one file, filter 
> pid
> >  number, and use...... system("kill pid").
> > - what i am looking at is something like system("ppp0 SIGTERM") which should
>  
> > terminate ppp0 interface, instead of reading from file - is this possible. 
> 
> Try to learn from pidin....
> 
> http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/utils/p/pidin/?
> root=coreos_pub&system=exsy1001
> 
> especially Coids(...) function with pidin_proc.c .
> 
> Or hope that somebody else here has some shortcut for You or completely other 
> suitable way.
> 
> Hope this helps anyway.
> 
> > 
> > Thnaks
> > Ravi 
> > 
> > 
> Regards,
> Jeevan


Re: Identify ppp processses running on machine  
> Hi Jeevan 
> 
> Thansk for link it gave good insight, what i understand is the structure 
> shared_info will holds all data related to process. So any info of process can
>  be derived from this. Unfortunatly when i copied pidin.h as it is from 
> Revision: 205640
> 
> http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/utils/p/pidin/
> pidin.h?root=coreos_pub&system=exsy1001&view=markup
> 
> and build the project it is throwing out some errors 
> - parse errors before procfs_channel...... in pidin.h 
> - include <backtrace.h> not found ... in pidin_proc.c
> 
> I dont see any probelm with semicolons missing any where - not really able to 
> figure out the probelm as of now. 
> 
> Thanks
> Ravi 
> 

Hi Ravi,

What kind of DEV host are You using ?

The only thing I can think of is that you run in some kind of prb like me here:

http://community.qnx.com/sf/discussion/do/listPosts/projects.core_os/discussion.buildbugs.topc1359

textto the files.

Hope this helps.

Jeevan