LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-15-2009, 09:34 PM   #1
tr3s
Member
 
Registered: Aug 2003
Location: Philippines
Posts: 35

Rep: Reputation: 15
squid proxy server cache_dir in different partition problem


hi! i managed to install and can successfully start squid when it's using the default cache_dir (/var/spool/squid). but when i changed the cache_dir to a separate partition (/cache/squid), then a permission denied error is encountered in creating cache files when i restart squid.

i'm running fedora 11 64bit. the /cache/squid directory is already owned by the squid user and has 710 permission, just like the permission of /var/cache/squid. both the /var/ and /cache partitions are members of a LVM group and has ext4 as its filesystem.

what else could be the problem?

many thanks
 
Old 10-15-2009, 09:37 PM   #2
WorldIsNotFair
Member
 
Registered: Jun 2008
Location: Jakarta
Distribution: CentOS 5
Posts: 89

Rep: Reputation: 17
selinux maybe ?

what the audit.log and messages says ?
 
Old 10-15-2009, 09:38 PM   #3
Febi881
Member
 
Registered: Jun 2009
Location: India
Distribution: Fedora,Redhat
Posts: 111
Blog Entries: 1

Rep: Reputation: 17
Quote:
Originally Posted by tr3s View Post
hi! i managed to install and can successfully start squid when it's using the default cache_dir (/var/spool/squid). but when i what else could be the problem?

many thanks

Might be ext4 filesystem causes the problem.
 
Old 10-15-2009, 10:05 PM   #4
tr3s
Member
 
Registered: Aug 2003
Location: Philippines
Posts: 35

Original Poster
Rep: Reputation: 15
i dont think its an ext4 problem since /var partition is also formatted as ext4.

here's something from dmesg:

Code:
type=1400 audit(1255661133.086:13927): avc:  denied  { search } for  pid=2427 comm="squid" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:squid_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=dir
type=1400 audit(1255661133.086:13928): avc:  denied  { search } for  pid=2427 comm="squid" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:squid_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=dir
here's from /var/log/messages:

Code:
Oct 16 10:46:48 kalabaw squid[2483]: Squid Parent: child process 2504 started
Oct 16 10:46:48 kalabaw kernel: type=1400 audit(1255661208.426:13939): avc:  denied  { search } for  pid=2504 comm="squid" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:squid_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=dir
Oct 16 10:46:48 kalabaw (squid): #011Failed to verify one of the swap directories, Check cache.log#012#011for details.  Run 'squid -z' to create swap directories#012#011if needed, or if running Squid for the first time.
Oct 16 10:46:48 kalabaw squid[2483]: Squid Parent: child process 2504 exited with status 1
there's nothing written in audit.log that pertains to squid
 
Old 10-15-2009, 10:21 PM   #5
WorldIsNotFair
Member
 
Registered: Jun 2008
Location: Jakarta
Distribution: CentOS 5
Posts: 89

Rep: Reputation: 17
can u list the security context of your /cache/squid directory and put it here.

use #ls -lZd /cache/squid

should be something like squid_cache_t
 
Old 10-15-2009, 10:27 PM   #6
tr3s
Member
 
Registered: Aug 2003
Location: Philippines
Posts: 35

Original Poster
Rep: Reputation: 15
Code:
#ls -lZd /cache/squid
drwxr-x---. squid squid unconfined_u:object_r:etc_runtime_t:s0 /cache/squid
 
Old 10-15-2009, 10:27 PM   #7
Febi881
Member
 
Registered: Jun 2009
Location: India
Distribution: Fedora,Redhat
Posts: 111
Blog Entries: 1

Rep: Reputation: 17
It seems to be a selinux problem. Edit /etc/seliux/config file and put SELINUX=disabled and SELINUXTYPE=disabled..and try..

Last edited by Febi881; 10-15-2009 at 10:32 PM.
 
Old 10-15-2009, 10:39 PM   #8
tr3s
Member
 
Registered: Aug 2003
Location: Philippines
Posts: 35

Original Poster
Rep: Reputation: 15
disabling SELinux solved the problem. thanks a bunch. but should i really permanently disable SELinux? or is there any other workaround?
 
Old 10-16-2009, 12:43 AM   #9
WorldIsNotFair
Member
 
Registered: Jun 2008
Location: Jakarta
Distribution: CentOS 5
Posts: 89

Rep: Reputation: 17
i don't use fedora but
you can try to disabled selinux boolean for squid only.

get the boolean first
#getsebool -a | grep squid

u should see like squid_disable_trans, if the value is off then u should make it on.

#setsebool -P squid_disable_trans=on

reconfig the selinux to enforcing, reboot it.
 
  


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
Restriction of website through squid proxy server problem 124vikas.dange@gmail.com Linux - Server 1 09-25-2009 11:47 AM
problem with cache_dir in squid sohailkmu Linux - Newbie 25 10-22-2008 11:10 PM
squid server(proxy)problem pankajkarde Linux - Server 1 03-30-2007 08:28 AM
squid (proxy)server problem pankajkarde Linux - Server 1 03-14-2007 01:13 AM
squid (proxy)server problem pankajkarde Linux - Server 5 03-11-2007 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:28 PM.

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