• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

The Squid Service in Failed State with Error: “Failed to make swap directory /var/spool/squid/00: (13) Permission denied”

by admin

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

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to prevent disabled repositories from being downloaded into the yum cache
  2. ascii: command not found
  3. How to Configure Network Interface Teaming in CentOS/RHEL 7 and 8
  4. How to Run SCP Without Password Prompt Interruption in Linux
  5. CentOS / RHEL : How to find kernel parameters used while booting
  6. atop: command not found
  7. deluser Command Examples in Linux
  8. lvdisplay error: “Failed to create directory /var/lock/lvm. File-based locking initilisation failed.”
  9. exec: command not found
  10. hcitool Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright