Thursday, March 22, 2012

Linux - cannot restore segment prot after reloc: Permission denied

I encounter this during my installation of Postgres to CentOS 5.8 - cannot restore segment prot after reloc: Permission denied

This error could happen on any package installation.

SELinux (Security Enchance Linux) provide access control security feature in Linux. See http://en.wikipedia.org/wiki/Security-Enhanced_Linux

Disabling it actually is bad. However, it provides a quick fix to my issues.

You can temporarily or permanent disable SELinux

Temporarily Disable

To disable

/usr/sbin/setenforce 0

To enable

/usr/sbin/setenforce 1

This is temporary SELinux turn off, thus, you do not need to reboot the system.


Permanent Disable

Edit /etc/selinux/config

vi /etc/selinux/config

You will see the following

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=enforcing


Change enforcing to disable

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled


Then, reboot the system.

shutdown -r now



5 comments:

  1. Hi, thanks for the tip! Useful when I faced a problem while installing Oracle using Oratoolkit in CentOS 5.8.

    ReplyDelete
  2. many thanks,
    now every things is working fine.

    ReplyDelete