当我尝试运行时systemctl start squid.service
,收到以下错误消息:
Job for squid.service failed because the control process exited with error code. See "systemctl status squid.service" and "journalctl -xe" for details.
journalctl
返回有关 Squid 服务的信息:
Mar 30 06:02:25 localhost systemd: Starting Squid caching proxy...
Mar 30 06:02:25 localhost squid: squid: ERROR: Could not read pid file
Mar 30 06:02:25 localhost squid: /var/run/squid.pid: (13) Permission denied
Mar 30 06:02:25 localhost systemd: squid.service: control process exited, code=exited status=1
Mar 30 06:02:25 localhost systemd: Failed to start Squid caching proxy.
Mar 30 06:02:25 localhost systemd: Unit squid.service entered failed state.
Mar 30 06:02:25 localhost systemd: squid.service failed.
Mar 30 06:03:01 localhost systemd: Started Session 175 of user root.
Mar 30 06:03:01 localhost systemd: Starting Session 175 of user root.
如何在我的系统上运行 Squid?
答案1
有一个预先存在的 PID 文件导致 Squid 感到烦恼。简而言之,运行以下命令删除 PID 文件:
sudo rm /var/run/squid.pid
然后,通过运行以下命令或重新启动计算机来终止所有当前正在运行的 Squid 版本:
sudo killall -9 squid
最后,正常启动 Squid 服务。它应该立即启动。