LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-06-2011, 04:36 AM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Rep: Reputation: 30
squid not updating


I have a current version of squid on my system 3.1.4
I tried updating to 3.1.18 by doing this:

wget http://www.squid-cache.org/Versions/...-3.1.18.tar.gz
cd /usr/local/sbin/myscripts
tar xzf squid-3.1.18.tar.gz
cd squid-3.1.18
./configure --prefix=/etc/squid --enable-delay-pools --enable-useragent-log
make
make install
service squid restart

but on restarting and running squid -v, it still reports 3.1.4

Last edited by qwertyjjj; 12-06-2011 at 09:40 AM.
 
Old 12-06-2011, 04:48 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

To where is the symbolic link of Squid pointing? Most likely the new version got installed in a subdirectory of its own. Check to where the init script is pointing, then check if that's a binary/symbolic link. If it's a symbolic link, find out where it points to, find out where the new binary got installed and change the symlink.

Kind regards,

Eric
 
1 members found this post helpful.
Old 12-06-2011, 04:51 AM   #3
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by EricTRA View Post
Hello,

To where is the symbolic link of Squid pointing? Most likely the new version got installed in a subdirectory of its own. Check to where the init script is pointing, then check if that's a binary/symbolic link. If it's a symbolic link, find out where it points to, find out where the new binary got installed and change the symlink.

Kind regards,

Eric
SHouldn't this install it in /etc?

./configure --prefix=/etc/squid --enable-delay-pools --enable-useragent-log
 
Old 12-06-2011, 04:54 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Yes, indicating it with that prefix would install it there. But you start it with the service command using the init script in /etc/init.d (or /etc/rc.d/init.d for RH if I recall correct). Where is that script's start option pointing to?

Kind regards,

Eric
 
1 members found this post helpful.
Old 12-06-2011, 05:24 AM   #5
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by EricTRA View Post
Hi,

Yes, indicating it with that prefix would install it there. But you start it with the service command using the init script in /etc/init.d (or /etc/rc.d/init.d for RH if I recall correct). Where is that script's start option pointing to?

Kind regards,

Eric
hmm not sure:

Code:
start() {
        probe

        parse=`$SQUID -k parse -f $SQUID_CONF 2>&1`
        RETVAL=$?
        if [ $RETVAL -ne 0 ]; then
                echo -n $"Starting $prog: "
                echo_failure
                echo
                echo "$parse"
                return 1
        fi
        for adir in $CACHE_SWAP; do
                if [ ! -d $adir/00 ]; then
                        echo -n "init_cache_dir $adir... "
                        $SQUID -z -F -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
                fi
        done
        echo -n $"Starting $prog: "
        $SQUID $SQUID_OPTS -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
        RETVAL=$?
        if [ $RETVAL -eq 0 ]; then
                timeout=0;
                while : ; do
                        [ ! -f /var/run/squid.pid ] || break
                        if [ $timeout -ge $SQUID_PIDFILE_TIMEOUT ]; then
                                RETVAL=1
                                break
                        fi
                        sleep 1 && echo -n "."
                        timeout=$((timeout+1))
                done
        fi
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID
        [ $RETVAL -eq 0 ] && echo_success
        [ $RETVAL -ne 0 ] && echo_failure
        echo
        return $RETVAL
}
 
Old 12-06-2011, 05:45 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Look at the beginning of the init file in the part where the variables are defined.

Kind regards,

Eric
 
1 members found this post helpful.
Old 12-06-2011, 05:57 AM   #7
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by EricTRA View Post
Hi,

Look at the beginning of the init file in the part where the variables are defined.

Kind regards,

Eric
Code:
#!/bin/bash
# chkconfig: - 90 25
# pidfile: /var/run/squid.pid
# config: /etc/squid/squid.conf
#
### BEGIN INIT INFO
# Provides: squid
# Short-Description: starting and stopping Squid Internet Object Cache
# Description: Squid - Internet Object Cache. Internet object caching is \
#       a way to store requested Internet objects (i.e., data available \
#       via the HTTP, FTP, and gopher protocols) on a system closer to the \
#       requesting site than to the source. Web browsers can then use the \
#       local Squid cache as a proxy HTTP server, reducing access time as \
#       well as bandwidth consumption.
### END INIT INFO


PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

if [ -f /etc/sysconfig/squid ]; then
        . /etc/sysconfig/squid
fi

# don't raise an error if the config file is incomplete
# set defaults instead:
SQUID_OPTS=${SQUID_OPTS:-""}
SQUID_PIDFILE_TIMEOUT=${SQUID_PIDFILE_TIMEOUT:-20}
SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100}
SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}

# determine the name of the squid binary
[ -f /usr/sbin/squid ] && SQUID=squid

prog="$SQUID"

# determine which one is the cache_swap directory
CACHE_SWAP=`sed -e 's/#.*//g' $SQUID_CONF | \
        grep cache_dir | awk '{ print $3 }'`

RETVAL=0

probe() {
        # Check that networking is up.
        [ ${NETWORKING} = "no" ] && exit 1
 
Old 12-06-2011, 06:07 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

According to the init script you're using this file to start Squid:
Code:
/usr/sbin/squid
Check if it's a symlink to another file or the binary itself. If it's a symlink then delete it and create a new one with the same name pointing to the binary of your installation. If it's a binary, rename it or move it so you can still use it if you want.

Kind regards,

Eric
 
1 members found this post helpful.
Old 12-06-2011, 06:10 AM   #9
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by EricTRA View Post
Hi,

According to the init script you're using this file to start Squid:
Code:
/usr/sbin/squid
Check if it's a symlink to another file or the binary itself. If it's a symlink then delete it and create a new one with the same name pointing to the binary of your installation. If it's a binary, rename it or move it so you can still use it if you want.

Kind regards,

Eric
-rwxr-xr-x 1 root root 3041456 Nov 11 2010 squid

so I just copy the whole file to /etc/squid ?
 
Old 12-06-2011, 06:18 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

No! Copy that file to another location for backup purposes, for example to your home directory. Next copy the newly installed binary (in /etc/squid/bin I imagine) to /usr/sbin overwriting the one that you backed up. If you copy it to /etc/squid you'd overwrite the newly installed version. After that restart the service and check. If you compiled with prefix /etc/squid the new binary should be in that directory.

Kind regards,

Eric
 
1 members found this post helpful.
Old 12-06-2011, 06:20 AM   #11
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by EricTRA View Post
Hi,

No! Copy that file to another location for backup purposes, for example to your home directory. Next copy the newly installed binary (in /etc/squid/bin I imagine) to /usr/sbin overwriting the one that you backed up. If you copy it to /etc/squid you'd overwrite the newly installed version. After that restart the service and check. If you compiled with prefix /etc/squid the new binary should be in that directory.

Kind regards,

Eric
Could I just recompile and instead install into /usr/sbin/squid ?
So, ./configure --prefix=/usr/sbin/squid --enable-delay-pools --enable-useragent-log

I don't understand why the program goes into usr/sbin/squid when the files and everything else are in /etc/squid
 
Old 12-06-2011, 06:28 AM   #12
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

You really should check the FHS (Filesystem Hierarchy Standard). That indicates what goes where. Although Linux let's you be in control you should keep some standards. Installing binaries in /etc is a bad idea, you'll loose track of your installations. /etc is for configuration files only. So compiling with a prefix like /etc/squid will work but is against the FHS and will only complicate your life and ours if you encounter problems since your files will not be in the 'normal' location. You should instead compile without prefix if your version of Squid will be the only one. I'm not sure but normally you should get an idea if you run
Code:
./configure --help
to see what defaults are used if you don't indicate options, most likely if you don't provide --prefix the binary will be installed in /usr/sbin or /usr/bin.

So if you want to undo what you've done, clean up your /etc (remove the squid directory) and compile again, taking into account what I indicated above. Another thing: is there any reason why you are compiling from source instead of using version provided by your distro's repository? I'm guessing you use CentOS, RHEL, ... (RPM based).

Kind regards,

Eric
 
1 members found this post helpful.
Old 12-06-2011, 06:41 AM   #13
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by EricTRA View Post
Hello,

You really should check the FHS (Filesystem Hierarchy Standard). That indicates what goes where. Although Linux let's you be in control you should keep some standards. Installing binaries in /etc is a bad idea, you'll loose track of your installations. /etc is for configuration files only. So compiling with a prefix like /etc/squid will work but is against the FHS and will only complicate your life and ours if you encounter problems since your files will not be in the 'normal' location. You should instead compile without prefix if your version of Squid will be the only one. I'm not sure but normally you should get an idea if you run
Code:
./configure --help
to see what defaults are used if you don't indicate options, most likely if you don't provide --prefix the binary will be installed in /usr/sbin or /usr/bin.

So if you want to undo what you've done, clean up your /etc (remove the squid directory) and compile again, taking into account what I indicated above. Another thing: is there any reason why you are compiling from source instead of using version provided by your distro's repository? I'm guessing you use CentOS, RHEL, ... (RPM based).

Kind regards,

Eric
thanks

It's because my distro is only up to v 3.1.4 and squid are already on 3.1.18

I removed the /etc/squid folder then recreated it and put squid.conf in there.
I compiled into /usr/sbin

But now on starting squid I get this error:

Code:
[root@264219 myscripts]# service squid start
Starting squid:                                            [FAILED]
2011/12/06 07:42:15| Processing Configuration File: /etc/squid/squid.conf (depth 0)
2011/12/06 07:42:15| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
2011/12/06 07:42:15| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
2011/12/06 07:42:15| WARNING: For now we will assume you meant to write /32
2011/12/06 07:42:15| storeDirWriteCleanLogs: Starting...
2011/12/06 07:42:15|   Finished.  Wrote 0 entries.
2011/12/06 07:42:15|   Took 0.00 seconds (  0.00 entries/sec).
FATAL: MIME Config Table /etc/squid/mime.conf: (2) No such file or directory
Squid Cache (Version 3.1.4): Terminated abnormally.
CPU Usage: 0.015 seconds = 0.005 user + 0.010 sys
Maximum Resident Size: 19312 KB
Page faults with physical i/o: 0
[root@264219 myscripts]#
Presumably because there is nothing in /etc/squid apart from the conf file?
squid -v still says 3.1.4 also.

Last edited by qwertyjjj; 12-06-2011 at 06:45 AM.
 
Old 12-06-2011, 06:48 AM   #14
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Your system / Squid installation is probably messed up about now, so I'd suggest you to uninstall everything referring to Squid from your system. Backup your configuration file and delete any symlinks, binaries, directories to Squid you can find, then cleanup your build directory and start from scratch. That will be the easiest way I believe.

Kind regards,

Eric
 
1 members found this post helpful.
Old 12-06-2011, 06:57 AM   #15
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
I did a yum remove squid.
I have CentOS so did this:

RedHat, RHEL
The following ./configure options install Squid into the RedHat structure properly:
--prefix=/usr
--includedir=/usr/include
--datadir=/usr/share
--bindir=/usr/sbin
--libexecdir=/usr/lib/squid
--localstatedir=/var
--sysconfdir=/etc/squid


./configure --enable-delay-pools --enable-useragent-log --prefix=/usr --includedir=/usr/include --datadir=/usr/share --bindir=/usr/sbin --libexecdir=/usr/lib/squid --localstatedir=/var --sysconfdir=/etc/squid
the make, then make install

but now I cannot start squid:

[root@264219 squid]# service squid restart
squid: unrecognized service
[root@264219 squid]# squid -v
Squid Cache: Version 3.1.18 NOW UPDATED
configure options: '--enable-delay-pools' '--enable-useragent-log' '--prefix=/usr' '--includedir=/usr/include' '--datadir=/usr/share' '--bindir=/usr/sbin' '--libexecdir=/usr/lib/squid' '--localstatedir=/var' '--sysconfdir=/etc/squid' --with-squid=/usr/local/sbin/myscripts/squid-3.1.18 --enable-ltdl-convenience
[root@264219 squid]#

Last edited by qwertyjjj; 12-06-2011 at 07:06 AM.
 
  


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
Squid Redirect specific domain to an Secondary (External) Squid Proxy Zxarr Linux - Server 2 04-20-2010 12:50 PM
Will updating to Ubuntu 7.10 create problems for Squid 2.6 jonette20 Ubuntu 2 02-05-2009 07:51 AM
problem in updating squid neelendhar Linux - Software 2 12-27-2007 10:40 PM
Updating VMWare After Updating CentOS Linux31 Red Hat 2 09-18-2007 02:49 PM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard Niceman2005 Linux - Software 1 11-24-2004 02:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:08 AM.

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