尝试在 Centos 7.1 上启动 cntlmd
时出现奇怪的错误。
systemctl start cntlmd` 在日志中产生以下结果(是的,becomming 正是它在日志中的拼写方式:)):
systemd: Started SYSV: Cntlm is meant to be given your proxy address and becoming
奇怪的是:
- 它确实在安装后最初运行。
- 完全相同的配置在另一台计算机上完美运行(使用 Chef 进行配置,因此 100% 相同的配置)。
- 如果我在前台运行它,它可以工作,但通过 systemd 运行,则不行。
为了“修复”它,我必须手动删除并重新安装,然后它又可以工作了。
有人看到这个错误(Google 没有透露任何内容)并知道发生了什么吗?
最佳答案
我意识到/var/run/cntlm
每次启动后目录似乎都会被“删除”。结果是/var/run/cntlm
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
重新启动,鲍勃就是你的叔叔了。
关于centos7 - Cntlmd 在 Centos 7.1 上的 systemd 下无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35338394/