[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: More diald problems.



On Sun, 12 Jan 1997 15:29:48 PST "Kevin Traas" (KTraas@uniserve.com) 
wrote:

> As requested, I've included my configuration files throughout the message
> below.  I hope this helps in figuring out what my problem is.  (I've
> stripped out my username & passwords from the files....)

I think I can understand the problem:

> Jan  9 09:58:50 sally diald[3243]: Connect script timed out. Killing
> script.

You connect script never terminates and diald thinks it has hung 
(default timeout: 60 secs).

[diald.options: ]

> defaultroute
> connect "/etc/ppp/scripts/ppp-up"

> And here's my script to crank up the connection: /etc/ppp/scripts/ppp-up
[snipped]
> exec /usr/sbin/pppd debug /dev/ttyS0 38400 \
>                     $LOCAL_IP:$REMOTE_IP \
>                     connect $DIALER_SCRIPT


Here it is !!!
Diald starts pppd itself, you don't have to start it in your dial script. The dial script is just for dialing, not starting ppp.

So what happens is that pppd is started while diald thinks you're connecting... It cannot install the defaultroute too...

Here are my scripts:

=== Diald.options:
mode ppp
accounting-log /var/log/diald.log
mtu 1500
local  207.104.147.8
remote 207.104.147.7
netmask 255.255.255.0
dynamic
two-way
reroute
defaultroute
connect "/etc/ppp/connect"
lock
speed 115200
modem
crtscts
connect-timeout 90
redial-timeout 10
kill-timeout 30
redial-backoff-start 2
redial-backoff-limit 600
dial-fail-limit 0
up

===/etc/ppp/connect:
#!/bin/sh
# Copyright (c) 1996, Eric Schenk.
#
# This script is intended to give an example of a connection script that
# uses the "message" facility of diald to communicate progress through
# the dialing process to a diald monitoring program such as dctrl or diald-top.
# It also reports progress to the system logs. This can be useful if you
# are seeing failed attempts to connect and you want to know when and why
# they are failing.
#
# This script requires the use of chat-1.9 or greater for full
# functionality. It should work with older versions of chat,
# but it will not be able to report the reason for a connection failure.

# Configuration parameters

# The initialization string for your modem

MODEM_INIT="+++ATZ"

# The phone number to dial
PHONE_NUMBERS=1
PHONE_NUMBER1="MYNUMBER"

# The chat sequence to recognize that the remote system
# is asking for your user name.
USER_CHAT_SEQ="ogin:"

# The string to send in response to the request for your user name.
USER_NAME="MYNAME"

# The chat sequence to recongnize that the remote system
# is asking for your password.
PASSWD_CHAT_SEQ="assword:"

# The string to send in response to the request for your password.
PASSWORD="MYPASSWORD"

# The prompt the remote system will give once you are logged in
# If you do not define this then the script will assume that
# there is no command to be issued to start up the remote protocol.
PROMPT1='bash$ '

# The command to issue to start up the remote protocol
PROTOCOL_START="MYCOMMANDTOSTARTPPP"

# The string to wait for to see that the protocol on the remote
# end started OK. If this is empty then no check will be performed.
START_ACK=""

# Pass a message on to diald and the system logs.
function message () {
[ $FIFO ] && echo "message $*" >$FIFO
logger -p local2.info -t connect "$*"
}

# Initialize the modem. Usually this just resets it.
message "Initializing Modem"
chat TIMEOUT 5 "" $MODEM_INIT TIMEOUT 45 OK ""
if [ $? != 0 ]; then
    message "Failed to initialize modem"
    exit 1
fi

# Dial the remote system.

i=1
connected=0
while [ $i -le $PHONE_NUMBERS ]
do
    message "Dialing system $i"
    eval phone=\$PHONE_NUMBER$i
    chat \
	    TIMEOUT 45 \
	    ABORT "NO CARRIER" \
	    ABORT BUSY \
	    ABORT "NO DIALTONE" \
	    ABORT ERROR \
	    "" ATDT$phone \
	    CONNECT ""
    case $? in
       0) message Connected; connected=1;break;;
       1) message "Chat Error"; exit 1;;
       2) message "Chat Script Error"; exit 1;;
       3) message "Chat Timeout"; exit 1;;
       4) message "No Carrier"; exit 1;;
       5) message "Busy";;
       6) message "No DialTone"; exit 1;;
       7) message "Modem Error"; exit 1;;
       *) message "Unkown Error";exit 2;;
    esac
    let i=i+1
done

if [ $connected -eq 0 ]
then
    message "All phone lines busy"
    exit 1
fi

# We're connected try to log in.
message "Loggin in"
chat \
	TIMEOUT 5 \
	$USER_CHAT_SEQ \\q$USER_NAME \
	TIMEOUT 45 \
	$PASSWD_CHAT_SEQ $PASSWORD
if [ $? != 0 ]; then
    message "Failed to log in"
    exit 1
fi

# We logged in, try to start up the protocol (provided that the
# user has specified how to do this)

eval PROMPT=\$PROMPT$i
if [ $PROMPT ]; then
    message "Starting Comm Protocol"
    chat TIMEOUT 90 $PROMPT $PROTOCOL_START GOPPP
    if [ $? != 0 ]; then
        message "Prompt not received"
        exit 1
    fi
fi

if [ $START_ACK ]; then
    chat TIMEOUT 15 $START_ACK ""
    if [ $? != 0 ]; then
	message "Failed to start Protocol"
	exit 1
    fi
fi

# Success!
message "Protocol started"

=== End.

As you can see, the connect script only starts pppd on the other side and exits.
The local pppd daemon is started by diald.
When fixed, the defaultroute command should work and you won't need the route command in ip-up.

Phil.



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: