ifup-ppp0 and ifdown ppp0 fron crontab

ifup-ppp0 and ifdown ppp0 fron crontab

Post by hazzma » Thu, 24 Feb 2000 04:00:00



I have a project I'm working on for a family member: Their Redhat box
has a crontab to dial their ISP at a given time and hangs up a given
time. Should be simple right?
Well my crontab command works to establish the connection but I think
it's failing at taking the connection down  for some reason.
here's the crontab stuff
SHELL=/bin/sh
#
MAILTO=root
##
#run at 8AM
0 8 * * *       /sbin/ifup ppp0
0 12 * * *      /sbin/ifdown ppp0

Like I say "up" is no problem. Down is the question. Here is
/etc/sysconfig/network-scripts/ifcfg-ppp0

DEVICE="ppp0"
ONBOOT=no
USERCTL=yes
MODEMPORT=/dev/ttyS3
LINESPEED=115200
PERSIST=yes <<<< is this keeping the line from going down, or just
keeping it up while it's supposed to be up
DEFABORT=yes
DEBUG=yes
INITSTRING=ATZ
DEFROUTE=yes
HARDFLOWCTL=yes
ESCAPECHARS=no
PPPOPTIONS=

REMIP=
NETMASK=""
IPADDR=
MRU=
MTU=
DISCONNECTTIMEOUT=
RETRYTIMEOUT=5
BOOTPROTO=none
PEERDNS="no"

Does anybody see what is going on? I am a little hamstrung in my
debugging attempts as the box is remote, and there's no one there who
can help me. There aren't any relevant messages in syslog nor and the
mail to root doesn't show anything germane. It just fails to hangup.

Does the "persist" option in /etc/sysconfig/network-scripts/ifcfg-ppp0
cause this?

ALso, in the course of trying to set this up, it seems from the scripts
and observation that if anyone even a user established the
connection--like with the usernet program--the /sbin/ifdown ppp0 command
will fail. Can this be correct? If so isn't there a way around it? I'm
pretty amazed that Redhat or whoever wrote these scripts would design
them in such a way that root or process owned by root would not have the
authority to shut off the network connection at will. Here is what I'm
talking about in ifdown-ppp
[/etc/sysconfig/network-scripts/ifdown-ppp ]

#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin

cd /etc/sysconfig/network-scripts
. network-functions

CONFIG=$1
source_config

file=/var/run/pppwatch-$DEVICE.pid

if [ ! -f $file ]; then
    # ppp isn't running, or we didn't start it  <<<<what is up with
this?
    exit 0
fi
So if user starts ppp0 up root's scheduled job to tear down the
connection will fail?
Please help me figure out how to set this crontab to take precedence
over RH's network scripts. I just want up orderly _on and off_ periods
for the network  and I can't believe it's this difficult.

Thanks for Your Help,
Hazzmat

 
 
 

ifup-ppp0 and ifdown ppp0 fron crontab

Post by hazzma » Thu, 24 Feb 2000 04:00:00


OK assuming the "persist" option is causing the system to redial instead
going down and staying down during the periods I want it down and
disconnected--how do I keep the connection up without "persist" if there's
no traffic?

IOW does persist just redialing on disconnect or is it responsible for
keeping the connection open (instead of being dropped by the ISP as idle)?


> I have a project I'm working on for a family member: Their Redhat box
> has a crontab to dial their ISP at a given time and hangs up a given
> time. Should be simple right?
> Well my crontab command works to establish the connection but I think
> it's failing at taking the connection down  for some reason.
> here's the crontab stuff
> SHELL=/bin/sh
> #
> MAILTO=root
> ##
> #run at 8AM
> 0 8 * * *       /sbin/ifup ppp0
> 0 12 * * *      /sbin/ifdown ppp0

> Like I say "up" is no problem. Down is the question. Here is
> /etc/sysconfig/network-scripts/ifcfg-ppp0

> DEVICE="ppp0"
> ONBOOT=no
> USERCTL=yes
> MODEMPORT=/dev/ttyS3
> LINESPEED=115200
> PERSIST=yes <<<< is this keeping the line from going down, or just
> keeping it up while it's supposed to be up
> DEFABORT=yes
> DEBUG=yes
> INITSTRING=ATZ
> DEFROUTE=yes
> HARDFLOWCTL=yes
> ESCAPECHARS=no
> PPPOPTIONS=

> REMIP=
> NETMASK=""
> IPADDR=
> MRU=
> MTU=
> DISCONNECTTIMEOUT=
> RETRYTIMEOUT=5
> BOOTPROTO=none
> PEERDNS="no"

> Does anybody see what is going on? I am a little hamstrung in my
> debugging attempts as the box is remote, and there's no one there who
> can help me. There aren't any relevant messages in syslog nor and the
> mail to root doesn't show anything germane. It just fails to hangup.

> Does the "persist" option in /etc/sysconfig/network-scripts/ifcfg-ppp0
> cause this?

> ALso, in the course of trying to set this up, it seems from the scripts
> and observation that if anyone even a user established the
> connection--like with the usernet program--the /sbin/ifdown ppp0 command
> will fail. Can this be correct? If so isn't there a way around it? I'm
> pretty amazed that Redhat or whoever wrote these scripts would design
> them in such a way that root or process owned by root would not have the
> authority to shut off the network connection at will. Here is what I'm
> talking about in ifdown-ppp
> [/etc/sysconfig/network-scripts/ifdown-ppp ]

> #!/bin/bash
> PATH=/sbin:/usr/sbin:/bin:/usr/bin

> cd /etc/sysconfig/network-scripts
> . network-functions

> CONFIG=$1
> source_config

> file=/var/run/pppwatch-$DEVICE.pid

> if [ ! -f $file ]; then
>     # ppp isn't running, or we didn't start it  <<<<what is up with
> this?
>     exit 0
> fi
> So if user starts ppp0 up root's scheduled job to tear down the
> connection will fail?
> Please help me figure out how to set this crontab to take precedence
> over RH's network scripts. I just want up orderly _on and off_ periods
> for the network  and I can't believe it's this difficult.

> Thanks for Your Help,
> Hazzmat


 
 
 

ifup-ppp0 and ifdown ppp0 fron crontab

Post by Robert A. Wick » Thu, 24 Feb 2000 04:00:00


I don't know why, but the ipup and down never worked well for me.  I use the
scripts found in /usr/doc/ppp-<version> folder and those work well, once I
set them to be executable and edited them.  I used those in TkSeti so that
it would dial up when it was ready to send data back to the server and
everything worked fine.


> I have a project I'm working on for a family member: Their Redhat box
> has a crontab to dial their ISP at a given time and hangs up a given
> time. Should be simple right?
> Well my crontab command works to establish the connection but I think
> it's failing at taking the connection down  for some reason.
> here's the crontab stuff
> SHELL=/bin/sh
> #
> MAILTO=root
> ##
> #run at 8AM
> 0 8 * * *       /sbin/ifup ppp0
> 0 12 * * *      /sbin/ifdown ppp0

> Like I say "up" is no problem. Down is the question. Here is
> /etc/sysconfig/network-scripts/ifcfg-ppp0

> DEVICE="ppp0"
> ONBOOT=no
> USERCTL=yes
> MODEMPORT=/dev/ttyS3
> LINESPEED=115200
> PERSIST=yes <<<< is this keeping the line from going down, or just
> keeping it up while it's supposed to be up
> DEFABORT=yes
> DEBUG=yes
> INITSTRING=ATZ
> DEFROUTE=yes
> HARDFLOWCTL=yes
> ESCAPECHARS=no
> PPPOPTIONS=

> REMIP=
> NETMASK=""
> IPADDR=
> MRU=
> MTU=
> DISCONNECTTIMEOUT=
> RETRYTIMEOUT=5
> BOOTPROTO=none
> PEERDNS="no"

> Does anybody see what is going on? I am a little hamstrung in my
> debugging attempts as the box is remote, and there's no one there who
> can help me. There aren't any relevant messages in syslog nor and the
> mail to root doesn't show anything germane. It just fails to hangup.

> Does the "persist" option in /etc/sysconfig/network-scripts/ifcfg-ppp0
> cause this?

> ALso, in the course of trying to set this up, it seems from the scripts
> and observation that if anyone even a user established the
> connection--like with the usernet program--the /sbin/ifdown ppp0 command
> will fail. Can this be correct? If so isn't there a way around it? I'm
> pretty amazed that Redhat or whoever wrote these scripts would design
> them in such a way that root or process owned by root would not have the
> authority to shut off the network connection at will. Here is what I'm
> talking about in ifdown-ppp
> [/etc/sysconfig/network-scripts/ifdown-ppp ]

> #!/bin/bash
> PATH=/sbin:/usr/sbin:/bin:/usr/bin

> cd /etc/sysconfig/network-scripts
> . network-functions

> CONFIG=$1
> source_config

> file=/var/run/pppwatch-$DEVICE.pid

> if [ ! -f $file ]; then
>     # ppp isn't running, or we didn't start it  <<<<what is up with
> this?
>     exit 0
> fi
> So if user starts ppp0 up root's scheduled job to tear down the
> connection will fail?
> Please help me figure out how to set this crontab to take precedence
> over RH's network scripts. I just want up orderly _on and off_ periods
> for the network  and I can't believe it's this difficult.

> Thanks for Your Help,
> Hazzmat

 
 
 

ifup-ppp0 and ifdown ppp0 fron crontab

Post by Greg Nede » Thu, 24 Feb 2000 04:00:00


    If the persist is keeping the interface up even after the ifdown command
is issued, could you have cron copy in a different ifcfg-ppp0 file just
before
the ifdown command.  And then have cron copy the original ifcfg-ppp0 file
just before the ifup command is issued?

    That is, have two versions of the ifcfg-ppp0 file.  One with the persist
set to yes, and another with the persist set to no.  Have cron copy the
appropriate one into place at the appropriate time, just before the ifup and
ifdown commands get run.


Quote:> OK assuming the "persist" option is causing the system to redial instead
> going down and staying down during the periods I want it down and
> disconnected--how do I keep the connection up without "persist" if there's
> no traffic?

> IOW does persist just redialing on disconnect or is it responsible for
> keeping the connection open (instead of being dropped by the ISP as idle)?

 
 
 

ifup-ppp0 and ifdown ppp0 fron crontab

Post by hazzma » Fri, 25 Feb 2000 04:00:00


Hi, I think the problem is solved now. Maybe. It seems to be working according
to schedule--I am not totally sure but I think the problem could have been that
if the connection is up, and the user tries to toggle the ppp0 interface the
modem possibly redials, causing a communications blackout on my end. The
schedule _seems_ reliable if left alone. Maybe it's totally reliable, but the
redials when I am trying to observe the system have interfered with a fair
evaluation of the schedule over time.

hazzmat


>     If the persist is keeping the interface up even after the ifdown command
> is issued, could you have cron copy in a different ifcfg-ppp0 file just
> before
> the ifdown command.  And then have cron copy the original ifcfg-ppp0 file
> just before the ifup command is issued?

>     That is, have two versions of the ifcfg-ppp0 file.  One with the persist
> set to yes, and another with the persist set to no.  Have cron copy the
> appropriate one into place at the appropriate time, just before the ifup and
> ifdown commands get run.



> > OK assuming the "persist" option is causing the system to redial instead
> > going down and staying down during the periods I want it down and
> > disconnected--how do I keep the connection up without "persist" if there's
> > no traffic?

> > IOW does persist just redialing on disconnect or is it responsible for
> > keeping the connection open (instead of being dropped by the ISP as idle)?

 
 
 

1. ifup-ppp0 not working

I've configured a ISDN dial up under X using PAP authentication.  Linux
was brave enough to create a whole bunch of files the whole world over.
I understand that by calling /etc/sysconfig/network-scripts/ifup-ppp0,
the line will come up.  I don't want to go into X every single time to
do this.  However, I can not call ifup-ppp0.  It says it's got too many
parameters.  Any ideas??

Also, once I got this going, how do I configure DialD to use this script
file then?
--
------------------------
Phil Massyn

http://www.useless.co.za
------------------------

2. Install Boot Disk

3. powerless "ifdown ppp0" syndrom

4. About inode

5. ifdown ppp0 problem

6. HELP:cannot find 'libXt.so.3'

7. can't locate module ppp0:0 ... ppp0:49

8. problem with SQUID start

9. '/sbin/ifdown ppp0' Not Working: Mandrake 6.0

10. Why does `ifdown ppp0' redial under RH 7.0 ?

11. /sbin/ifdown ppp0 does not turn off the serial modem in RH/Mandrake 6.0

12. PPP help needed (ifup: failed to activate ppp0 with error 29)

13. Getting the local IP addess after ifup ppp0