Cntlmd 无法在 Centos 7.1 的 systemd 下启动

Cntlmd not starting under systemd on Centos 7.1

尝试在 Centos 7.1 上启动 cntlmd 时出现奇怪的错误。

systemctl start cntlmd` 在日志中产生以下结果(是的,becomming 正是它在日志中的拼写方式:)):

systemd: Started SYSV: Cntlm is meant to be given your proxy address and becoming

奇怪的是:

为了“修复”它,我不得不手动删除并重新安装,于是它再次工作了。

有人看到这个错误(Google 什么也没显示)并且知道发生了什么事吗?

我发现/var/run/cntlm目录好像每次开机后都是"removed"。原来 systemd-tmpfiles 在启动时从未 创建 目录(感谢 this SO answer),然后导致:

Feb 29 06:13:04 node01 cntlm: Using following NTLM hashes: NTLMv2(1) NT(0) LM(0)
Feb 29 06:13:04 node01 cntlm[10540]: Daemon ready
Feb 29 06:13:04 node01 cntlm[10540]: Changing uid:gid to 996:995 - Success
Feb 29 06:13:04 node01 cntlm[10540]: Error creating a new PID file

因为 cntlm 无法写入它的 pid 文件,因为 /var/run/cntlm 不存在。

因此,要让 systemd-tmpfiles 在启动时创建 /var/run/cntlm 目录,您需要在 /usr/lib/tmpfiles.d/cntlm.conf 中添加以下文件:

d /run/cntlm   700 cntlm cntlm

重新启动,Bob 就是你的叔叔了。