one little trip up in squid instructions

Place to discuss Fedora and/or Red Hat

one little trip up in squid instructions

Postby Calum » Sat Nov 27, 2004 1:36 pm

hi,
i've a quick question about the squid adzapper instructions on this site, i've followed the instructions, until the point, where you can see below, and just wondering what your thoughts are...
Code: Select all
[root@harvey root]# rpm -q squid
package squid is not installed
[root@harvey root]# apt-get install squid
..... <snip, snip>
   1:squid                  ########################################### [100%]
Done.
[root@harvey root]# rpm -q squid
squid-2.5.STABLE1-3.9
[root@harvey root]# chkconfig squid on
[root@harvey root]# service squid start
init_cache_dir /var/spool/squid... /etc/init.d/squid: line 162:  8741 Aborted   
              $SQUID -z -F -D 2>/dev/null
Starting squid: /etc/init.d/squid: line 162:  8742 Aborted                 $SQUI
D $SQUID_OPTS 2>/dev/null
                                                           [FAILED]


here are lines 154 to 165 of /etc/init.d/squid for your perusal, but i don't know what's relevant here to be honest:
*)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
exit 1
esac

exit $?
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Void Main » Sun Nov 28, 2004 5:57 pm

Could be that you don't have a fully qualified domain name set for your machine in your /etc/hosts file. If you type "squid -z" as root does it give you any more clue as to why it is aborting? The init script (/etc/init.d/squid) redirects stderr to /dev/null (for some unknown reason) so you probably aren't seeing the real error message so running "squid -z" on the command line should show the error message. Also if that doesn't give the message look at the last few lines in the logs in /var/log/squid.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Calum » Tue Nov 30, 2004 5:36 pm

[root@harvey root]# squid -z
FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'

Squid Cache (Version 2.5.STABLE1): Terminated abnormally.
CPU Usage: 0.020 seconds = 0.010 user + 0.010 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 413
Aborted

void main, you are on the money! and the reason this is the case is because i used some red hat gui tool to change the hostname from localhost to harvey.

i am a bit dim here, so what do i do to fix it? fix up the /etc/hosts file? is that the only one i need to fix up? the message above suggests setting visible_hostname, do i set this somewhere in /etc/init.d/squid do you reckon, or do i set it as some env variable (grasping at concepts here, sorry, it is late and have been on my feet all day)?
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Void Main » Tue Nov 30, 2004 7:14 pm

Normally if you had a static IP address you would set your /etc/hosts file like this:

Code: Select all
127.0.0.1               localhost.localdomain localhost
192.168.0.100        calumshost.calumnsdomain.home calumshost


where "calumshost" is the hostname of your squid server and 192.168.0.100 is it's IP address. You want the 127.0.0.1 line in there as shown. I assume since you are using this maching as a squid server then you are using a static address and can set it as listed above. If you are using DHCP then your machine's hostname is usually set to 127.0.0.1 and your /etc/hosts file would look like this:

Code: Select all
127.0.0.1               localhost.localdomain localhost calumshost


What you probably need to do in this case is set your "visible_hostname" variable in the /etc/squid/squid.conf. You should see it described in the comments of the file. Under that section add this line:

Code: Select all
visible_hostname calumshost.calumsdomain.home


I don't believe it actually has to be fully qualified. Then try and start your service.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Calum » Wed Dec 01, 2004 3:49 pm

thank you!
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron