October 01, 2014, 12:13:26 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: failed to make swap directory /cache---squid  (Read 14682 times)

Offline klakshman03

  • Tux Awared
  • **
  • Posts: 35
failed to make swap directory /cache---squid
« on: April 24, 2006, 08:46:58 PM »
hi linux grp...
       I tried to insatll    "squid-2.5.STABLE13"  in linux enterprises edition ...
     after configuration while i was execting command  " /usr/local/squid/sbin/squid -z
    it says some errors  like

[root@localhost ~]#  /usr/local/squid/sbin/squid -z
2006/04/25 02:08:00| Creating Swap Directories
FATAL: Failed to make swap directory /cache: (13) Permission denied
Squid Cache (Version 2.5.STABLE13): Terminated abnormally.
CPU Usage: 0.001 seconds = 0.001 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
can anyone help me... to resolve this issue .pls.....

thanking u
laxmaN

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
failed to make swap directory /cache---squid
« Reply #1 on: April 28, 2006, 11:16:45 AM »
Just check owner of /var/spool/squid directory

it must be squid

if not change the owner like this

#chown squid:squid /var/spool/squid

After that , Just run this command (Important Step)

#restorecon -R /var/spool/squid

Just restart the service of squid

#service squid restart

It will definitly run,If still u will face any problem,let me know

Cheers
Gaurav

Offline klakshman03

  • Tux Awared
  • **
  • Posts: 35
failed to make swap directory /cache---squid
« Reply #2 on: April 30, 2006, 09:37:47 PM »
Hi gaurav tq for u r reply...
   i have done what u suggested...it  doesnot give any error..
after that if  i run   "/usr/local/squid/sbin/squid -z " it gives same error ...and

 but i cudnot findout  "cache.log " file in  "/usr/local/squid/var/logs/" ....
what may be the problem...



    w8ing for u r reply
laxmaN

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
failed to make swap directory /cache---squid
« Reply #3 on: May 01, 2006, 01:16:26 PM »
its very common error,
goto /usr/local/squid/sbin/squid and delete every dir. and file under it then change the permission and ownership.

I assume that squid has a usergroup as squid and a user squid.

Code: [Select]
chown squid:squid /path/to/cache

chmod 770 /path/to/cache

Offline klakshman03

  • Tux Awared
  • **
  • Posts: 35
failed to make swap directory /cache---squid
« Reply #4 on: May 03, 2006, 04:43:45 AM »
hi ricky
ther is no directory named squid"  under  " cd /usr/local/squid/sbin/   ...it has a file named squid ....thus nothing is ther to remove ...
so i tried  the commands which are suggested by u......under the dirrectory /usr/local/squid/sbin/  ....then it says an error messages


[root@localhost sbin]# chown squid:squid /path/to/cache
chown: cannot access `/path/to/cache': No such file or directory

[root@localhost sbin]# chmod 770 /path/to/cache
chmod: cannot access `/path/to/cache': No such file or directory

thus how can i overcome this problem? ....
thanking u ...


** iam using redhat linux enterprise edition and squid version is "squid-2.5.STABLE13.tar.gz"

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
failed to make swap directory /cache---squid
« Reply #5 on: May 03, 2006, 10:49:51 AM »
well actually path/to/cache mean the directory where you want to store cache.
It is mentioned in your squid.conf under directive..
cache_dir <path/to/cache> .

There you look for your actual cache directory and then use -z command but before that you can also run chown and chmod I mentioned earlier.

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
failed to make swap directory /cache---squid
« Reply #6 on: May 04, 2006, 03:34:36 AM »
Hi

I think , cache_dir in squid .conf is /var/spool squid in RHEL...but to make sure just chk it again...., I also told u that check permissions and owner of squid dir..........,as Ricky already said



if still it dont work..then do these step by step:,i thk it should work..

#rm -rf /var/spool/squid

#mkdir /var/spool/squid

#chown squid:squid /var/spool/squid

#restorecon -R /var/spool/squid  (Don't use squid -z , if u r using this command)
#service squid start

Gaurav

Offline mochika54119

  • New Member
  • Posts: 1
Re: failed to make swap directory /cache---squid
« Reply #7 on: March 07, 2012, 07:27:40 PM »
oh....i can not start squid....failed...please, help me!!! :'( :'( :'(

Offline LS-Admin

  • Administrator
  • Linux Learner
  • *****
  • Posts: 104
Re: failed to make swap directory /cache---squid
« Reply #8 on: March 09, 2012, 05:08:14 PM »
Any thing like last few lines of error log of squid ?