Please enable JavaScript to view this site.

CloudLinux Documentation


Navigation: CageFS > Configuration

PostgreSQL support

CloudLinux 7:


CageFS works with any PostgreSQL version installed from CloudLinux or CentOS repositories. PostgreSQL packages fo CloudLinux 7 come from upstream (CentOS) unmodified. PostgreSQL’s socket is located in /var/run/postgresql directory. This directory is mounted to CageFS by default (in cagefs-5.5-6.34 or later).


When PostgreSQL has been installed after CageFS install, please add line:



tо /etc/cagefs/ file and then execute:

cagefsctl --remount-all


The steps above are enough to configure CageFS to work with PostgreSQL.


CloudLinux 6:


CageFS provides separate /tmp directory for each end user. Yet, PostgreSQL keeps its Unix domain socket inside server's main /tmp directory. In addition to that -- the location is hard coded inside PostgreSQL libraries.


To resolve the issue, CloudLinux provides version of PostgreSQL with modified start up script that can store PostgreSQL's socket in /var/run/postgres. The script automatically creates link from /tmp to that socket to prevent PostgreSQL dependent applications from breaking.


In addition to that, CageFS knows how to correctly link this socket inside end user's /tmp directory.


To enable PostgreSQL support in CageFS:


1.        Make sure you have updated to latest version of PostgreSQL.


2.        Edit file /etc/sysconfig/postgres, and uncomment SOCK_DIR line.


3. Update CageFS configuration by running:

cagefsctl  --reconfigure-cagefs


4. Restart PostgreSQL by running:

$ service postgresql restart


If you are using cPanel, you would also need to modify file: /etc/cron.daily/tmpwatch


And update line:






to prevent symlink from being removed.