# Odd SELinux messages

## xathin

Hello,

I have been running SELinux on one of my computers for some time, and for the last while I have seen the "SELinux module not found!!! Please verify that it was installed." every time emerge, or anything using python is running that uses SELinux. When I use sestatus, it shows that SELinux is enabled, and appears to be operating, avc's are generated through dmesg. I followed the SELinux install guide when installing, and had no problems with the module loading previously.

Any one know why this is happening, or how to correct it?

----------

## Hu

As documented in Gentoo Linux Documentation - SELinux FAQ - Portage error messages, this typically means that dev-python/python-selinux is missing or damaged.  You need to reinstall it, and then relabel every package which was merged while it was unavailable.

----------

## xathin

Which I've done already. Performed emerge python-selinux, then rlpkg -a -r. Still getting the message.

----------

## xathin

Does anyone else have any ideas why this would be happening? I am still getting the message with every emerge.

----------

## xathin

Still nobody with an answer to this? Am I the only person that is receiving these messages on a constant basis?

-- edit: I recently did a 'rlpkg -r' on all installed packages after re-emerging dev-python/python-selinux. It still displays the SELinux module not loaded message.

----------

## ali3nx

you might have a chance of finding one of the hardened dev's on freenode in #gentoo-hardened

----------

## KutuluMike

The problem is with portage 2.2, and it's merely annoying.  I'm heading over to file a bug report, but basically:

There's some sort of legacy compatibility layer on top of what used to be global variables in portgage 2.1, but are now handled via proxy classes in 2.2 (presumably in preparation for getting rid of them completely.)  Any time any of these variables is read, the entire set of legacy globals is initialized, one of which is "selinux_isenabled".  Trying to read the value of this global forces a check to see if the selinux module is loaded, which in many cases, it is not.  So you get the warning message that portage is configured to use selinux, but the selinux module isn't loaded yet.

Portage will correctly load the module before it actually needs to use it -- you'll see that your files still get labeled and modules still get installed into the policy.  So for now you can safely ignore the message.

----------

## stvbckr

I'm getting the "!!! SELinux module not found. Please verify that it was installed."  error too while running portage-2.1.4.4.

This started after doing some Python updates.

I tried re-emerging python-selinux but the error still occurs.

I also get the "ImportError: No module named selinux" when running rlpkg -a -r.

Any other ideas of things to try to correct this?

----------

## JoKo

Running /usr/sbin/python-updater as root could also help. At least for my case, that did the trick and vanish the "!!! SELinux module not found. Please verify that it was installed." messages.

----------

## stvbckr

I thought I'd ran python-updater before but apparently not (or at least not successfully).

That did the trick, thanks!!

----------

