kill the child process of spawnvp()

I used the spawnvp() call to create a child process to start the pppd
program.

pppd_id=spawnvp(P_NOWAIT, args[0], args);

The pppd started fine, but when it came to stop the pppd program, I called
kill(pppd_id, SIGTERM), and did waitpid(). The waitpid came back with the
same id as pppd_id, but the pppd process is still there when I did
pidin|grep pppd. What am I missing?

Any help would appreciate.

-Beth

Beth <id@net.com> wrote:

The pppd started fine, but when it came to stop the pppd program, I called
kill(pppd_id, SIGTERM), and did waitpid(). The waitpid came back with the
same id as pppd_id, but the pppd process is still there when I did
pidin|grep pppd. What am I missing?

Probably the pppd forks itself, and then this behaviour is OK.

I’ve no idea how to check pppd’s existance via it’s PID,
but perhaps you can check the interfaces (/dev/io-net/ppp*) or so.

HTH and best regards,

Karsten.


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Thanks for you response. If pppd forks itself, is there anyway I can get the
process id of the pppd so that I can kill it when the parent process dies?

-Beth

<Karsten.Hoffmann@mbs-software.de> wrote in message
news:bde28j$2kb$2@gate.internal

Beth <> id@net.com> > wrote:
The pppd started fine, but when it came to stop the pppd program, I
called
kill(pppd_id, SIGTERM), and did waitpid(). The waitpid came back with
the
same id as pppd_id, but the pppd process is still there when I did
pidin|grep pppd. What am I missing?

Probably the pppd forks itself, and then this behaviour is OK.

I’ve no idea how to check pppd’s existance via it’s PID,
but perhaps you can check the interfaces (/dev/io-net/ppp*) or so.

HTH and best regards,

Karsten.


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

For those who interest in this.
pppd has a parameter “nodetach”, with this parameter set, the pppd will not
fork itself.

Thanks for all your help.

-Beth

“Beth” <id@net.com> wrote in message news:bdhjmj$lht$1@inn.qnx.com

Thanks for you response. If pppd forks itself, is there anyway I can get
the
process id of the pppd so that I can kill it when the parent process dies?

-Beth

Karsten.Hoffmann@mbs-software.de> > wrote in message
news:bde28j$2kb$> 2@gate.internal> …
Beth <> id@net.com> > wrote:
The pppd started fine, but when it came to stop the pppd program, I
called
kill(pppd_id, SIGTERM), and did waitpid(). The waitpid came back with
the
same id as pppd_id, but the pppd process is still there when I did
pidin|grep pppd. What am I missing?

Probably the pppd forks itself, and then this behaviour is OK.

I’ve no idea how to check pppd’s existance via it’s PID,
but perhaps you can check the interfaces (/dev/io-net/ppp*) or so.

HTH and best regards,

Karsten.


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld