Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
pptp timeout requires script zapping
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Wed Jan 06, 2010 12:35 pm    Post subject: pptp timeout requires script zapping Reply with quote

I connect to work via pptp.
My initial attempt works fine, but after 15-30 minutes of inactivity, the connection drops.
Code:
# /etc/init.d/QSAB stop
QSAB              | * Caching service dependencies ...                                                                                                                                                       [ ok ]
QSAB              | * Disconnecting from QSAB VPN ...
QSAB              |/usr/sbin/poff: No pppd is running.  None stopped.                                                                                                                                        [ !! ]
QSAB              | * ERROR: QSAB failed to stop
# /etc/init.d/QSAB start
QSAB              | * WARNING: QSAB has already been started
# /etc/init.d/QSAB zap
QSAB              | * Manually resetting QSAB to stopped state
# /etc/init.d/QSAB start
QSAB              | * Connecting to QSAB VPN ...

I'm guessing I've done something wrong since I need to zap the script before I can reconnect.
/etc/init.d/QSAB:
Code:
#!/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

name="VPN"

depend() {
   need net
}

start() {
   ebegin "Connecting to QSAB VPN"
   /usr/sbin/pon QSAB
   sleep 5 #Give pon a chance to get an ip
   /sbin/route add -net 192.168.175.0 netmask 255.255.255.0 dev ppp0
   eend $?
}

stop() {
   ebegin "Disconnecting from QSAB VPN"
   /usr/sbin/poff QSAB
   eend $?
}
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Fri Jan 15, 2010 9:57 am    Post subject: Reply with quote

Bump
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Fri Jan 15, 2010 5:23 pm    Post subject: Re: pptp timeout requires script zapping Reply with quote

Letharion wrote:
I connect to work via pptp.
My initial attempt works fine, but after 15-30 minutes of inactivity, the connection drops.

Probably you configured pppd somehow with the "idle" option (I didn't check how pon determines the pppd options).
If you would have named your script appropriately /etc/init.d/net.$INTERFACE (I have no idea what QSAB is - does it have an interface?), the script /etc/ppp/ip-down.d/50-initd.sh (which is executed when pppd terminates) would have automatically attempted to stop your init-script so that you do not have to stop it later manually. (You could also write your own corresponding rule in your own /etc/ppp/ip-down.d/* file).
However, the stop function of your script is not appropriate:
Quote:
Code:
stop() {
   ebegin "Disconnecting from QSAB VPN"
   /usr/sbin/poff QSAB
   eend $?
}

This function returns a nonzero exit status if poff failed; a nonzero exit status means that exiting of the script failed, i.e. it was not really stopped. However, this is not the case: Even if poff returns a nonzero exit status, it is likely that the exit was actually successful. So as an easy workaround you can just lie about the exit status:
Code:
stop() {
   ebegin "Disconnecting from QSAB VPN"
   /usr/sbin/poff QSAB
   eend $?
   :
}

Of course, you can also do more care and test in case of a nonzero exit status really no pppd is running...
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Fri Jan 15, 2010 5:39 pm    Post subject: Re: pptp timeout requires script zapping Reply with quote

Letharion wrote:
I connect to work via pptp. My initial attempt works fine, but after 15-30 minutes of inactivity

<joking>
So... you... are connecting to work for... not working ?
</joking>
As it seems being a private network, Would not it be the remote server which ends the connection ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum