View previous topic :: View next topic |
Author |
Message |
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Wed Jan 06, 2010 12:35 pm Post subject: pptp timeout requires script zapping |
|
|
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 |
|
|
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Fri Jan 15, 2010 9:57 am Post subject: |
|
|
Bump |
|
Back to top |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6747
|
Posted: Fri Jan 15, 2010 5:23 pm Post subject: Re: pptp timeout requires script zapping |
|
|
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 |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Fri Jan 15, 2010 5:39 pm Post subject: Re: pptp timeout requires script zapping |
|
|
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 |
|
|
|