Chinaunix

标题: squid -z 没权限建立 swap directory ? [打印本页]

作者: seayou_wey    时间: 2006-07-14 10:13
标题: squid -z 没权限建立 swap directory ?
安装的是suse10.1自带的 Squid Cache: Version 2.5.STABLE12

运行 squid -z 提示出错,但cache目录权限已经设置全权开放。


erp:~ # ls  /var/spool/  -ls
总计 40
4 drwx------  2 at     at      4096 2006-07-05 14:27 atjobs
4 drwx------  2 at     at      4096 2006-05-02 15:47 atspool
4 drwsrwsrwt  2 nobody nogroup 4096 2006-07-12 14:15 cache

..................................

erp:~ # squid -z
2006/07/12 16:30:09| Creating Swap Directories
FATAL: Failed to make swap directory /var/spool/cache/00: (13) Permission deniedSquid Cache (Version 2.5.STABLE12): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
erp:~ #


Squid的配置文件如下:在FC5中可以正确运行。


#squid.conf - a very basic config file for squid
#Turn logging to it's lowest level
debug_options ALL,1
#defines a group (or Access Control List) that includes all IP addresses
acl all src 0.0.0.0/0.0.0.0
#define RAM used
cache_mem 32 MB
#defines the cache size
cache_dir ufs /var/spool/cache 100 16 256
#allow all sites to use connect to us via HTTP
http_access allow all
#allow all sites to use us as a sibling
icp_access allow all
#http_port 3128
http_port 3128
#test the following sites to check that we are connected
#dns_testnames internic.net usc.edu cs.colorado.edu mit.edu yale.edu
#run as the squid user
cache_effective_user nobody nogroup
#visible_hostname
visible_hostname squid2

[/COLOR]

[ 本帖最后由 seayou_wey 于 2006-7-14 10:18 编辑 ]
作者: npudream    时间: 2006-07-14 15:12
chmod -R 777 /var/spool/cache
作者: seayou_wey    时间: 2006-07-18 15:21
其实已经使用过这前的命令了。。。再次测试。。还是不行。。

erp:~ # chmod -R 777 /var/spool/cache
erp:~ # squid -z
2006/07/18 15:18:03| Creating Swap Directories
FATAL: Failed to make swap directory /var/spool/cache/00: (13) Permission deniedSquid Cache (Version 2.5.STABLE12): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0

erp:~ # ls /var/spool  -ls
总计 40
4 drwx------  2 at     at      4096 2006-07-05 14:27 atjobs
4 drwx------  2 at     at      4096 2006-05-02 15:47 atspool
4 drwxrwxrwx  2 nobody nogroup 4096 2006-07-12 14:15 cache
作者: kenduest    时间: 2006-07-18 17:39
原帖由 seayou_wey 于 2006-7-14 10:13 发表
安装的是suse10.1自带的 Squid Cache: Version 2.5.STABLE12
运行 squid -z 提示出错,但cache目录权限已经设置全权开放。
2006/07/18 15:18:03| Creating Swap Directories
FATAL: Failed to make swap directory /var/spool/cache/00: (13) Permission deniedSquid Cache (Version 2.5.STABLE12): Terminated abnormally.


基本上 suse linux 有启用 AppArmor,也就是类似 RHEL 的 selinux 的功能。

suse 10.1 的 squid 预设 proxy 的目录不是 /var/spool/cache,而你自行改到其他位置,所以导致被 AppArmor 设定阻挡无法存取。再者预设身分一般也都用 squid/squid 就好,为何还要使用以前旧有的 nobody/nogroup 这类身分配置呢?

你要解决该问题的话,你的选择有:

1. 用 yast 跑一下 AppArmor 设定精灵,修改 squid 配置,或者是移除 squid 规则设定不监控等。

2. 关闭 AppArmor 功能 (不建议)。

==




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2