免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4472 | 回复: 3
打印 上一主题 下一主题

squid -z 没权限建立 swap directory ? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-14 10:13 |只看该作者 |倒序浏览
安装的是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 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-07-14 15:12 |只看该作者
chmod -R 777 /var/spool/cache

论坛徽章:
0
3 [报告]
发表于 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

论坛徽章:
0
4 [报告]
发表于 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 功能 (不建议)。

==
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP