#6527 SELinux is enabled but /usr/sbin/restorecon does not exist (Ubuntu)
Closed: fixed by cheimes. Opened by zhenglei.

ipa-server-install command failed when selinux is enabled on Ubuntu.

The ipaserver-install.log is:
2016-12-01T10:36:27Z DEBUG The ipa-server-install command failed, exception: RuntimeError: SELinux is enabled but /usr/sbin/restorecon does not exist.
Install the policycoreutils package and start the installation again.
2016-12-01T10:36:27Z ERROR SELinux is enabled but /usr/sbin/restorecon does not exist.
Install the policycoreutils package and start the installation again.
2016-12-01T10:36:27Z ERROR The ipa-server-install command failed. See /var/log/ipaserver-install.log for more information


The reason is that /usr/sbin/restorecon does not exist and only /sbin/restorecon exists. I modified the /usr/lib/python2.7/dist-packages/ipaplatform/redhat/tasks.py file to solve the problem, the changes is as follows:
def check_selinux_status(self, restorecon=paths.RESTORECON):
change to
def check_selinux_status(self, restorecon=paths.SBIN_RESTORECON):

What build of FreeIPA do you use? Are you using builds for Debian/Ubuntu?

In general, on Debian redhat platform should not be used.

Replying to [comment:2 pvoborni]:

What build of FreeIPA do you use? Are you using builds for Debian/Ubuntu?

In general, on Debian redhat platform should not be used.

Yes, I use builds for Debian/Ubuntu, and my freeipa version is 4.3.1. In the source code, debian/tasks.py is pointed to redhat/tasks.py. Part of code is as follows:

from ipaplatform.redhat.tasks import RedHatTaskNamespace

BaseTask = BaseTaskNamespace()

class DebianTaskNamespace(RedHatTaskNamespace):

Timo, please have a look. It sounds like a bug in your Debian/Ubuntu port.

Moving to 4.5 backlog for now.

Metadata Update from @zhenglei:
- Issue set to the milestone: FreeIPA 4.5 backlog

Metadata Update from @rcritten:
- Issue close_status updated to: None
- Issue tagged with: integration

Issue has been fixed a while ago. IPA uses /sbin/restorecon.

Metadata Update from @cheimes:
- Issue close_status updated to: fixed
- Issue set to the milestone: None (was: FreeIPA 4.5 backlog)
- Issue status updated to: Closed (was: Open)

Metadata