Squid3试图添加一个自定义的external_acl_type

我正在尝试为squid3创build一个外部acl帮助器(希望)从我的squid3服务器中删除一些configuration行,并且为它写了一个简单的python脚本:

#!/usr/bin/python import sys import logging import time logger = logging.getLogger( 'squid_auth' ) logger.setLevel( logging.DEBUG ) fh = logging.FileHandler( 'spam.log' ) fh.setLevel( logging.DEBUG ) formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) fh.setFormatter( formatter ) logger.addHandler( fh ) def grant (): sys.stdout.write( 'OK\n' ) sys.stdout.flush() def deny (): sys.stdout.write( 'ERR\n' ) sys.stdout.flush() while True: line = sys.stdin.readline().strip() if line: logger.info( line ) grant() else: time.sleep( 1 ) 

并将其添加到我的squid.conf中:

 external_acl_type custom_acl %SRC %LOGIN %DST /etc/changemyip/squid/config/acl.py acl CustomAcl external custom_acl http_access allow CustomAcl 

该脚本的path是正确的(我可以在shell中执行它),该程序具有执行权限和一切,但是当我重新加载鱿鱼我得到这个错误约5-6次,然后鱿鱼崩溃:

 Aug 17 14:08:52 server7 (squid): The custom_acl helpers are crashing too rapidly, need help! Aug 17 14:08:52 server7 squid[28233]: Squid Parent: child process 28290 exited with status 1 Aug 17 14:08:52 server7 squid[28233]: Exiting due to repeated, frequent failures 

正如你所看到的脚本只是打印OK\n的标准输出,以授予每个人。 我甚至还没有开始实施任何逻辑。

testing与鱿鱼版本: 3.1.19

我有一个类似的问题。 我设法通过将脚本的所有权更改为squid用户并将文件从我的主目录移动到根文件系统中的某个位置来修复它。