1. ifup-ppp0 and ifdown ppp0 fron crontab
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
2. How to setup IPCHAINS?
3. powerless "ifdown ppp0" syndrom
4. Configuring ide cdrom attached to SB16 IDE port
5. '/sbin/ifdown ppp0' Not Working: Mandrake 6.0
6. Printing question
7. Why does `ifdown ppp0' redial under RH 7.0 ?
8. Trying to find "Guide"
9. /sbin/ifdown ppp0 does not turn off the serial modem in RH/Mandrake 6.0
10. can't locate module ppp0:0 ... ppp0:49
11. problem with modem and ifdown
12. Problems with ifdown on PPP
13. ppp0 problem or modem driver problem ?