yum repositories slow?

Gertjan Vinkesteijn fedora.1.90 at xs4all.nl
Sun Mar 7 20:57:47 UTC 2004


Gertjan Vinkesteijn wrote:

> Gertjan Vinkesteijn wrote:
>
>> thedogfarted wrote:
>>
>>> yum was very slow for me today too although i use only mirrors
>>>
>>> Alexander Dalloz wrote:
>>>
>>>> Am So, den 07.03.2004 schrieb Swamper um 20:12:
>>>>
>>>>
>>>>> It took almost 24hrs to do the initial update on my laptop
>>>>> (Vaio) after installing Fedora in just the basic mode without
>>>>> any server packages or anything and it only took around 2hrs to
>>>>> download all four CDs.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> And you really make use of mirror server(s) as source?
>>>>
>>>> Alexander
>>>>
>>>>
>>>
>>>
>> The main problems I faced, was some depencies problems, but I am 
>> using the development version. That is why I left out the -debuginfo 
>> part, I was in a hurry, my system had crashed and I wanted to be back 
>> again in a jiffy.
>> It took me less then 2 hours for the (now) about 2900 updates.
>> The coming week I will be in the hospital, so my computer willbe 
>> offline then.
>>
> don't worry, be happy (I am, at least)
>
At least, my son, I wish you luck
#!/bin/bash
#
# check-if-ppp-up
#
# Peter de Freitas aka ghovs <ghovs at plex.nl>
# not-so-fast hack to keep ADSL alive. Include in crontab
#
# example:
# /usr/local/sbin/check-if-ppp-up
# and in /etc/crontab the following line:
# one-min check if ppp0 is up
*/1 * * * * root /usr/local/sbin/check-if-ppp-up 1> /dev/null


# variables

export PPP_INTERFACE=ppp0        # ppp device
export GATEWAY=195.190.242.109        # ip of ppp device
export ADSL_ROUTER=10.0.0.138        # ip of ADSL router

export INTERNAL_INTERFACE=eth0        # interface to LAN (if any)
export INTERNAL_NETWORK=10.0.0.0    # class c used for LAN (if any)
export EXTERNAL_INTERFACE=eth1        # interface to ADSL router
export EXTERNAL_NETWORK=10.0.0.0    # class c used for ADSL router
                    # ext and int class c's -can- be equal

export LOG=/var/log/ppp.log        # logfile


# functions

add_gateway ()
{
  # add default gateway
  echo "check-if-ppp-up: trying to add default gateway..." &&
  route add default gw $GATEWAY 2> /dev/null &&
  echo "check-if-ppp-up: default gateway added." >> $LOG ||
  echo "check-if-ppp-up: failed to add default gateway." >> $LOG
}

start_pppd ()
{
  # start up pppd
  echo "check-if-ppp-up: trying to restart pppd..." >> $LOG &&
  pptp 10.0.0.138 file /etc/ppp/options 1>> $LOG &&
  echo "check-if-ppp-up: $PPP_INTERFACE brought back up." >> $LOG ||
  echo "check-if-ppp-up: failed to bring $PPP_INTERFACE back up." >> $LOG &

  sleep 35 # matches pptp failure timeout

  # add default gateway
  add_gateway
}

raise_ppp ()
{
  # bring up ppp device
  echo "check-if-ppp-up: trying to bring up $PPP_INTERFACE..." >> $LOG &&
  ifconfig $PPP_INTERFACE up 2> /dev/null &&
  echo "check-if-ppp-up: $PPP_INTERFACE brought back up." >> $LOG ||
  echo "check-if-ppp-up: attempt to bring $PPP_INTERFACE back up failed, 
DIY time." >> $LOG

  # add default gateway
  add_gateway
}

timestamp ()
{
  # timestamp for the log
  date >> $LOG
}

endstamp ()
{
 # indicate end of check-if-ppp-up instance (comment out to keep quiet)
 echo "-<->-" >> $LOG
}


# script

# first attempt, in case ppp0 interface is unavailable
# (most likely)
if ! ifconfig | grep $PPP_INTERFACE &&
    # if ppp device is not up
   ! ifconfig $PPP_INTERFACE 2> /dev/null | grep $PPP_INTERFACE > /dev/null;
    # if ppp device does not exist
  then

  timestamp

  # explain problem
  echo "check-if-ppp-up: $PPP_INTERFACE does not exist." >> $LOG;

  # fix problem
  start_pppd

  endstamp


# second attempt, in case only the default gw is missing
# (not too likely)
elif route -n | grep "$GATEWAY 0.0.0.0         255.255.255.255 UH    
0      0        0 $INTERFACE" &&
    # if route to default gateway exists
   ! route -n | grep "0.0.0.0         $GATEWAY 0.0.0.0         UG    
0      0        0 $INTERFACE";
    # if default gateway is not set as such
  then

  timestamp

  # explain problem
  echo "check-if-ppp-up: the default gateway is unset." >> $LOG

  # fix problem
  add_gateway

  endstamp


# third attempt, in case someone did something like 'ifconfig ppp0 down'
# (not likely)
elif ifconfig $PPP_INTERFACE 2> /dev/null | grep $PPP_INTERFACE > 
/dev/null &&
    # if ppp device exists
   ! ifconfig | grep $PPP_INTERFACE;
    # if ppp device is not up
  then

  timestamp

  # explain problem
  echo "check-if-ppp-up: $PPP_INTERFACE exists, but is down." >> $LOG

  # fix problem
  raise_ppp

  endstamp


# fourth attempt, in case someone messed up the routing table
# (hardly likely)
# this -only- tries to get ADSL back up, it does -not- try to fix beyond 
that
elif ! route -n | grep "0.0.0.0         $GATEWAY 0.0.0.0         UG    
0      0        0 $PPP_INTERFACE" &&
    # if default gateway is not set as such
   ! route -n | grep "$GATEWAY 0.0.0.0         255.255.255.255 UH    
0      0        0 $PPP_INTERFACE" &&
    # if route to default gateway does not exist
   ! route -n | grep "$EXTERNAL_NETWORK        0.0.0.0         
255.255.255.0   U     0      0        0 $EXTERNAL_INTERFACE" ||
   ! route -n | grep "$ADSL_ROUTER      0.0.0.0         255.255.255.255 
UH    0      0        0 $EXTERNAL_INTERFACE";
    # if route to ADSL router does not exist
  then

  timestamp

  # explain problem
  echo "check-if-ppp-up: the routing table is not set up correctly." >> $LOG

  # fix problem
  # set route to ADSL router
  if [ "$INTERNAL_NETWORK" != "$EXTERNAL_NETWORK" ];
    then
    route add -net $EXTERNAL_NETWORK netmask 255.255.255.0 dev 
$EXTERNAL_INTERFACE 2> /dev/null &&
    echo "check-if-ppp-up: added route to ADSL router." >> $LOG ||
    echo "check-if-ppp-up: failed to add route to ADSL router, DIY 
time." >> $LOG

  elif [ "$INTERNAL_NETWORK" = "$EXTERNAL_NETWORK" ];
    # if internal and external network are on the same class c
    then
    route del -net $EXTERNAL_NETWORK netmask 255.255.255.0 dev 
$EXTERNAL_INTERFACE 2> /dev/null &&
    route add -host $ADSL_ROUTER dev $EXTERNAL_INTERFACE 2> /dev/null &&
    echo "check-if-ppp-up: added route to ADSL router." >> $LOG ||
    echo "check-if-ppp-up: failed to add route to ADSL router, DIY 
time." >> $LOG
  fi

  # now that the routes are all set, the ppp device can be brought back up
  start_pppd

  endstamp
fi


# changelog

# 05-nov-2001 <ghovs at plex.nl>
# - major overhaul, should function properly at last
# - added three less likely cases of ADSL breakdown, as well as
# - config variables, comments, log messages, functions
# 08-nov-2001 <ghovs at plex.nl>
# - fixed one message not going to

-- 
Peace is everywhere
http://gershwin.xs4all.nl





More information about the users mailing list