![CNTLM 无法在 CentOS 7 上运行](https://linux22.com/image/1506042/CNTLM%20%E6%97%A0%E6%B3%95%E5%9C%A8%20CentOS%207%20%E4%B8%8A%E8%BF%90%E8%A1%8C.png)
CNTLM RPM 已正确安装。服务已配置并运行良好:
[user@centos~]$ sudo service cntlmd status
Checking for CNTLM Authentication Proxy: ● cntlmd.service - LSB: start/stop the cntlm proxy
Loaded: loaded (/etc/rc.d/init.d/cntlmd)
Active: active (running) since Wed 2016-09-07 13:14:45 BST; 2min 53s ago
但是我没有任何网络连接:yum 和 curl 都失败并显示相同的消息:
Failed connect to localhost:3128; Connection refused
更多信息请参阅journalctl
:
Sep 07 13:09:47 centos cntlm[6283]: Starting cntlm version 0.92.3 for LITTLE endian
Sep 07 13:09:47 centos cntlm[6283]: Proxy listening on 0.0.0.0:3128
Sep 07 13:09:47 centos cntlm[6283]: Workstation name used: centos
Sep 07 13:09:47 centos cntlm[6283]: Using following NTLM hashes: NTLMv2(1) NT(0) LM(0)
Sep 07 13:09:47 centos cntlm[6284]: Daemon ready
Sep 07 13:09:47 centos cntlm[6284]: Changing uid:gid to 987:982 - Success
Sep 07 13:09:47 centos cntlm[6284]: Error creating a new PID file
Sep 07 13:09:47 centos cntlmd[6275]: Starting CNTLM Authentication Proxy: [ OK ]
所以显然 cntlm 无法创建其 pid 文件...我该怎么办?
答案1
这centos.org 的帖子救了我。解决方案很简单,就是允许 cntlm 创建其 pid 文件:
$ mkdir /var/run/cntlm
$ chgrp cntlm /var/run/cntlm/
$ chmod g+w /var/run/cntlm/
$ service cntlmd restart