logo
Published on john.parnefjord.se (http://john.parnefjord.se)

Turning off SELinux

By johnp
Created 2007-01-29 12:34

Debian Etch ships with SELinux turned on in permissive mode. This may interfere with custom installation paths. For example if you install Postgresql and want to place data on a special share using the tablespace directive, for example

CREATE TABLESPACE dataspace LOCATION '/data/myproject';

You may end up having permission errors using this command, even if you have created the directory in question and set the appropriate permissions for the postgres user. With the default policy SELinux doesn't permit postgresql to operate outside it's default installation paths. To turn off SELinux you can either install the selinux-utils package and run setenforce 0:

apt-get install selinuxsetenforce 0

To change this so that it is turned off after next reboot edit /etc/selinux/config and change the SELINUX variable from:

SELINUX=enforce

or

SELINUX=permissive

to

SELINUX=disabled

This is of course a quick way of dealing with the problem. If one wants to run SELinux then change the policy and relabel the directories affected.


Source URL:
http://john.parnefjord.se/node/9