The Problem
The squid service in failed state with below error:
# systemctl status squid.service ● squid.service - Squid caching proxy Loaded: loaded (/usr/lib/systemd/system/squid.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2019-05-01 16:34:19 GMT; 2min 50s ago Process: 2022 ExecStartPre=/usr/libexec/squid/cache_swap.sh (code=exited, status=1/FAILURE) May 01 16:34:19 [hostname] systemd[1]: Starting Squid caching proxy... May 01 16:34:19 [hostname] squid[2027]: Failed to make swap directory /var/spool/squid/00: (13) Permission denied >> May 01 16:34:19 [hostname] cache_swap.sh[2022]: init_cache_dir /var/spool/squid... May 01 16:34:19 [hostname] systemd[1]: squid.service: control process exited, code=exited status=1 May 01 16:34:19 [hostname] systemd[1]: Failed to start Squid caching proxy. May 01 16:34:19 [hostname] systemd[1]: Unit squid.service entered failed state. May 01 16:34:19 [hostname] systemd[1]: squid.service failed.
The Solution
The permission of /var/spool/squid/ was incorrect.
# ls -ld /var/spool/squid drwxr-xr-x 2 root root 6 Apr 26 20:29 /var/spool/squid
1. Modify the ownership of the directory from root to squid with below command:
# chown squid:squid /var/spool/squid
2. Verify the permission of the directory with below command:
# ls -ld /var/spool/squid drwxr-xr-x 2 squid squid 6 Apr 26 20:29 /var/spool/squid
3. Start the squid service with below command:
# systemctl start squid
4. Verify the status of the squid service with below command:
# systemctl status squid