Skip to contentSkip to conversation

issue about PIDs ?

DISCUSSION cyx_mail 2 participants 6 messages May 21, 2008 – May 22, 2008 PPP protocol drivers and compressors

lore
Share & tools
lore

cyx_mail

author
#0 lore raw

Hi,all!

I got some kill PID issue. I think the data struct "ClientSessionStruct" connecting pppoe-server process and pppd process. So , when the server get a PADT, it can kill the child pppd process by according to the ClientSessionStruct's member pid. my problem:
I modified the pppoe-server code ,and let pppoe-server spawn a pppd. then let the server send SIGTEM to pppd(using kill(pppd 2's pid , SIGTEM)) not using the normal way(such as stopsession as the code written). the pppoe-server and pppd die both, why?

2008-05-21

#1 lore raw
Quoted 4 lines · cyx_mail

I modified the pppoe-server code ,and let pppoe-server spawn a pppd. then let the server send SIGTEM to pppd(using kill(pppd 2's pid , SIGTEM)) not using the normal way(such as stopsession as the code written). the pppoe-server and pppd die both, why?

I guess you mean SIGTERM. This matches my observation with pptpconfig. Workaround is to define a handler or ignore the SIGTERM signal in your pppoe-server code.

NetworkManager-pptp also specifically handles SIGTERM and SIGINT, presumably for the same reason.

Signature · 3 lines
James Cameron                         http://quozl.netrek.org/
HP Open Source, Volunteer             http://opensource.hp.com/
PPTP Client Project, Release Engineer http://pptpclient.sourceforge.net/
author
#2 lore raw
In reply to cyx_mail
Quoted 2 lines

Workaround is to define a handler or ignore the SIGTERM signal in your pppoe-server code.

you mean define a handler in pppd code? what function should call in the handler to bring the pppd down gracefully?

2008-05-22

·¢¼şÈË£º James Cameron
·¢ËÍʱ¼ä£º 2008-05-22 07:11:51
ÊÕ¼şÈË£º cyx_mail
³­ËÍ£º linux-ppp
Ö÷Ì⣺ Re: issue about PIDs ?

Quoted 4 lines · cyx_mail

I modified the pppoe-server code ,and let pppoe-server spawn a pppd. then let the server send SIGTEM to pppd(using kill(pppd 2's pid , SIGTEM)) not using the normal way(such as stopsession as the code written). the pppoe-server and pppd die both, why?

I guess you mean SIGTERM. This matches my observation with pptpconfig. Workaround is to define a handler or ignore the SIGTERM signal in your pppoe-server code.
NetworkManager-pptp also specifically handles SIGTERM and SIGINT, presumably for the same reason.

Signature · 10 lines
James Cameron                         http://quozl.netrek.org/
HP Open Source, Volunteer             http://opensource.hp.com/
PPTP Client Project, Release Engineer http://pptpclient.sourceforge.net/
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to [email protected]
__________ NOD32 3090 (20080509) Information __________
This message was checked by NOD32 antivirus system.
http://www.nod32cn.com
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±şšiş)í…æèw*jg¬±¨¶‰š�Šİ¢jÿ¾«şG«�éÿ¢¸¢·¦j:+v‰¨ŠwèjØm¶Ÿÿşø¯ù®w¥şŠàşf£¢·hš�â�úÿ†Ù¥
#3 lore raw
In reply to cyx_mail
Quoted 1 line · cyx_mail

you mean define a handler in pppd code?

No, in your pppoe-server code. Handle the SIGINT as if it is expected side-effect.

Quoted 2 lines

what function should call in the handler to bring the pppd down gracefully?

Sorry, I don't understand this question.

Signature · 3 lines
James Cameron                         http://quozl.netrek.org/
HP Open Source, Volunteer             http://opensource.hp.com/
PPTP Client Project, Release Engineer http://pptpclient.sourceforge.net/
author
#4 lore raw
In reply to cyx_mail
Quoted 4 lines

you mean define a handler in pppd code?

No, in your pppoe-server code. Handle the SIGINT as if it is expected side-effect.

so if I define a handler in pppd ,and kill pppd himself in the handler ? can solve this problem?

Quoted 4 lines

what function should call in the handler to bring the pppd down gracefully?

Sorry, I don't understand this question.

if I want to kill pppd himself in the handler that user defined in pppd, what function should I call to kill pppd himself safely?

------------------
cyx
2008-05-22

-------------------------------------------------------------
·¢¼şÈË£ºJames Cameron
·¢ËÍÈÕÆÚ£º2008-05-22 09:26:52
ÊÕ¼şÈË£ºcyx_mail
³­ËÍ£º[email protected]; James Cameron
Ö÷Ì⣺Re: Re: issue about PIDs ?

Quoted 1 line · cyx_mail

you mean define a handler in pppd code?

No, in your pppoe-server code. Handle the SIGINT as if it is expected side-effect.

Quoted 2 lines

what function should call in the handler to bring the pppd down gracefully?

Sorry, I don't understand this question.

Signature · 15 lines
James Cameron                         http://quozl.netrek.org/
HP Open Source, Volunteer             http://opensource.hp.com/
PPTP Client Project, Release Engineer http://pptpclient.sourceforge.net/
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

__________ NOD32 3090 (20080509) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32cn.com


ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±şšiş)í…æèw*jg¬±¨¶‰š�Šİ¢jÿ¾«şG«�éÿ¢¸¢·¦j:+v‰¨ŠwèjØm¶Ÿÿşø¯ù®w¥şŠàşf£¢·hš�â�úÿ†Ù¥
#5 lore raw
In reply to cyx_mail
Quoted 2 lines · cyx_mail

so if I define a handler in pppd ,and kill pppd himself in the handler?

No, I said define a handler for SIGINT in the other program in the process group that you don't want terminated. Perhaps you'd like to have another try at defining the problem?

Quoted 2 lines

if I want to kill pppd himself in the handler that user defined in pppd, what function should I call to kill pppd himself safely?

I wasn't suggesting adding a handler to pppd, so I don't need to answer this question.

Signature · 3 lines
James Cameron                         http://quozl.netrek.org/
HP Open Source, Volunteer             http://opensource.hp.com/
PPTP Client Project, Release Engineer http://pptpclient.sourceforge.net/