LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-21-2004, 11:21 PM   #1
Ethyriel
LQ Newbie
 
Registered: Mar 2004
Location: Arizona
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
pppd doesn't run ip-down on disconnect


I'm running Slackware 9.1 straight off the CD right now, and I'm having an issue with PPP. I'm configuring PPP with the default pppsetup script using PAP on an ISA Jaton Communicator V.90 (Intel/Ambient MD5662 chipset) on ttyS1. This is on a VIA Apollo Pro 133a chipset motherboard, an Asus P3V4X to be exact. If any other hardware is relevant, let me know.

Anyway, PPP is running fairly well besides this: After I run ppp-stop I have to manually execute the ip-down script (or reboot) before I can run ppp-go again. If I try to connect without executing ip-down, it simply prints "connect script failed" after about 60 seconds.

I know you probably need more information to help, but I'm a *nix newbie, so I don't know what this would be. Which file would it print the details on the connection attempt to? Is there another script which PPPd uses to execute the ip-down script which I can post here?

Thanks for any help you can offer
Michael Salivar
 
Old 03-22-2004, 01:29 AM   #2
xgreen
Member
 
Registered: Aug 2003
Distribution: Slackware,Arch
Posts: 389

Rep: Reputation: 30
this might help you...


http://www.start-linux.com/articles/article_194.php
 
Old 03-22-2004, 03:30 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Not sure it will help but try disconnecting using ppp-off. Otherwise edit the ppp-stop script and add a line that will force ip-down to run.
 
Old 03-22-2004, 06:56 AM   #4
Ethyriel
LQ Newbie
 
Registered: Mar 2004
Location: Arizona
Distribution: Slackware
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks nazmin, it was an interesting read, but unfortunately didn't provide much insight on this matter, unless I'm just missing something

Gnashley:
Ok, I found the ppp-stop and ppp-off scripts, and their results are identical. Upon further inspections, that's because the scripts are identical.

Now, I'm getting decent at editing config files and such, but scripting is completely foreign to me. So, here's the script, and then what I'm guessing to include... but I figure I don't have a chance.

Code:
#!/bin/bash
#
# This is the standard ppp-off script that comes with ppp-2.?.?, it's
# been expanded to include the -d option for pppsetup. (1-17-98)
#
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
	DEVICE=ppp0
elif [ ! "$1" = "-d" ]; then
	DEVICE=$1	
elif [ "$1" = "-d" ]; then
	DEVICE=ppp0	
elif [ ! "$1" = "" ] && [ "$2" = "-d" ]; then
	DEVICE=$1	
fi
######################################################################
#
# This just checks if demand dialing is running, if so it
# says Demand Dialing Stoped.

if ps x | fgrep "options.demand" 1> /dev/null 2> /dev/null ; then
        D="echo Demand Dialing Stoped."
fi

#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
        if [ ! "$?" = "0" ]; then
	        killall -INT pppd 2>/dev/null
                rm -f /var/run/$DEVICE.pid
                rm -f /var/lock/LCK*
                echo "ERROR: No pppd process running, removed stale pid file."
                exit 1
        fi
#
# Success. Let pppd clean up its own junk.
        echo "PPP link to [$DEVICE] terminated."
        $D
        if [ "$1" = "-d" ]; then
	pppd file "/etc/ppp/options.demand" || exit 1
	echo "Demand Dialing Started."
	exit 0
	elif [ "$2" = "-d" ]; then
	pppd file "/etc/ppp/options.demand" || exit 1
	echo "Demand Dialing Started."
	exit 0
	else
	exit 0
fi
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on: [$DEVICE]"
exit 1
And my guess is something like this:

Code:
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
        exec /etc/ppp/ip-down
That's the third non-commented section down. Am I anywhere near the ballpark with this? I get the feeling it couldn't possibly be so simple. Anyway, I'm off to bed, thanks again for the help.
 
Old 03-22-2004, 03:45 PM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
That's it!
 
Old 03-23-2004, 02:37 AM   #6
Ethyriel
LQ Newbie
 
Registered: Mar 2004
Location: Arizona
Distribution: Slackware
Posts: 3

Original Poster
Rep: Reputation: 0
Wow, an operating system that makes sense! Be gone Microsoft!

Anyway, it's not working. I suspect that it's my modem being finicky, as it loves to do. I'm thinking the ip-down script is getting run before pppd has been fully killed, and my modem can't cope. Strangely, when ppp-stop executes ip-down, not only am I not able to connect, but running ip-down manually doesn't fix it. Instead, I have to reboot.

I'm hoping the 'wait' command will solve my problems. I'm going to try to figure this out on my own though, so please, nobody explain it to me until I give up in a hateful fit of angry frustration
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run script after connecting with pppd maginotjr Linux - Networking 1 11-20-2005 07:12 AM
Can you connect to internet as normal user without run pppd as root ? nasty_daemon Linux - Networking 2 09-13-2005 01:43 AM
Unable to run /usr/sbin/pppd. --> Check permissions [solved] flosch Linux - Networking 0 05-05-2004 09:08 AM
respawn pppd on disconnect? frieza Linux - Networking 2 01-21-2004 08:06 AM
how do I run a script on FTP disconnect GuitsBoy Linux - Software 5 11-13-2003 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration