Re: [squid-users] switching squid to another link using cron

From: Stuart Clark <sclark@dont-contact.us>
Date: Wed, 4 Apr 2001 12:49:04 +1000

Why don't these commands work?
[root@proxy /]#squid -f /etc/squid/squid.conf-link2
[root@proxy /]#squid -k reconfigure

I can still see data flowing through link1

I run 2 squid.conf files

squid.conf.link1 having the below comments

tcp_outgoing_address 203.xxx.xxx.xx
udp_outgoing_address 203.xxx.xxx.xx

squid.conf.link2 having this

(the standard default route is used)
#tcp_outgoing_address 203.xxx.xxx.xx
#udp_outgoing_address 203.xxx.xxx.xx

Also thanks my squid files were broken (using pico without -w option trashed
them)

"Original Message"

Hi ,
I am trying to switch squid to a different link during peak periods.
I put the shell script below into cron and have it execute at a certain time
eg :12am
Then another different shell script to execute at 8am

#!/bin/sh

echo "Switching over to link2"
/etc/rc.d/init.d/squid stop
cp /etc/squid/squid.conf-link2 /etc/squid/squid.conf
while [ -e /var/run/squid.pid ] ; do
echo "trying to restart squid"
sleep 4
done
/etc/rc.d/init.d/squid start
echo "squid restarted"

I run 2 squid.conf files

one having the below comments

tcp_outgoing_address 203.xxx.xxx.xx
udp_outgoing_address 203.xxx.xxx.xx

The second having this
(the standard default route is used)
#tcp_outgoing_address 203.xxx.xxx.xx
#udp_outgoing_address 203.xxx.xxx.xx

----- Original Message -----
From: "Pascal Bourdais" <PBourdais@chez.com>
To: "Stuart Clark" <sclark@spacelink.com.au>; <squid-users@squid-cache.org>
Sent: Wednesday, April 04, 2001 11:43 PM
Subject: Re: [squid-users] switching squid to another link using cron

>
> > Then another different shell script to execute at 8am
> >
> > #!/bin/sh
> >
> > echo "Switching over to link2"
> > /etc/rc.d/init.d/squid stop
> > cp /etc/squid/squid.conf-link2 /etc/squid/squid.conf
> > while [ -e /var/run/squid.pid ] ; do
> > echo "trying to restart squid"
> > sleep 4
> > done
> > /etc/rc.d/init.d/squid start
> > echo "squid restarted"
>
> I think your config files are broken somewhere !
>
> wouldn't it be more efficiente to run :
>
> # link2
> <whereissquidbinary>/squid -k shutdown
> sleep 4
> <whereissquidbinary>/squid -f /etc/squid/squid.conf-link2 <and
> otheroptionssuchas-D>
>
> # link1
> <whereissquidbinary>/squid -k shutdown
> sleep 4
> <whereissquidbinary>/squid -f /etc/squid/squid.conf-link1 <and
> otheroptionssuchas-D>
>
> Pascal
>
Received on Wed Apr 04 2001 - 08:51:29 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:59:09 MST