# SELinux: why emerge says "SELinux module not found"?

## maverick6664

I insatlled SELinux and it works fine now.   But I have a minor concern; when emerge or revdep-rebuild is run, they say in red bold letters

```
!!! SELinux module not found. Please verify that it was installed.
```

but SELinux cannot be built as module (at least with kernel 2.6.16.16); it's built in the kernel.  Why do they give this error?  Or doesn't it mean kernel module?

It doesn't harm, but just wondering.

TIA!

----------

## nixnut

Is selinux actually enabled?

Is the selinux filesystem mounted?

Are all the userland bits installed?

----------

## nixnut

Is selinux actually enabled?

Is the selinux filesystem mounted?

Are all the userland bits installed?

----------

## maverick6664

Yes, it's enabled.

For example "ps axZ" shows

```

tetsuji:staff_r:staff_t           918 pts/8    S      0:00 su maverick

tetsuji:staff_r:staff_t           921 pts/8    S+     0:00 zsh

system_u:system_r:httpd_t        1081 ?        S      0:00 /usr/sbin/apache2 -D

system_u:system_r:httpd_t        1084 ?        S      0:00 /usr/sbin/apache2 -D

system_u:system_r:sshd_t         1140 ?        Ss     0:00 sshd: maverick system_u:system_r:sshd_t         1146 ?        S      0:00 sshd: maverick@pts/0

```

and "ls -laZ" shows

```
drwxr-x---  tetsuji  tetsuji  tetsuji:object_r:staff_home_dir_t .

drwxr-xr-x  root     root     system_u:object_r:home_root_t    ..

-rw-r-----  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .BOINC Manager

-rw-------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .ICEauthority

drwxr-x---  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .Scilab

-rw-------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .Xauthority

-rw-r-----  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .aumixrc

-rw-------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .bash_history

-rw-------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .cvspass

drwx------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .ed2k_gui

-rw-r-----  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .emacs

drwxr-x---  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .emacs.d

-rw-r-----  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .emacs~

-rw-------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .esd_auth

-rw-r-----  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .fonts.cache-1

drwxr-x---  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .fullcircle

drwx------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gconf

drwx------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gconfd

-rw-r-----  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gdbinit

drwxr-x---  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gimp-2.2

drwxr-x---  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gnome

drwx------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gnome2

drwx------  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gnome2_private

drwx------  tetsuji  tetsuji  tetsuji:object_r:staff_gpg_secret_t .gnupg

drwxr-x---  tetsuji  tetsuji  tetsuji:object_r:staff_home_t    .gstreamer-0.8

```

etc.etc.

And for example, as root

```
# su maverick -c "cat /etc/group"

root:x:0:root,tetsuji

bin:x:1:root,bin,daemon

daemon:x:2:root,bin,daemon

...snip...

```

while

```
gw tetsuji # su apache -c "cat /etc/group"

gw tetsuji #

```

because normal user can use cat command, while apache role cannot use "cat" command, which means SELinux prevents attackers from looking at files even if they find vulnerability in web apps if any. 

So SELinux works perfectly on my box and my apache is more secure than usual.

So "!!! SELinux module not found. Please verify that it was installed" means it thinks SELinux should be provided as a kernel module, I think.

EDIT: In short, I should have shown

```
% sestatus

SELinux status:         enabled

SELinuxfs mount:        /selinux

Current mode:           permissive

Policy version:         20
```

  :Surprised: 

----------

## c0r0

yes, i got same msg as yours and maybe it can help you, do  "USE=-selinux emerge python-selinux"

oh yes, this my first time get selinux on my gentoo box. now im stuck cause my selinux gentoo box disallow to execute /bin/sh which its a link of /bin/bash while running the emerge

 *Quote:*   

> 
> 
> localhost ~ # emerge libxml2
> 
> Calculating dependencies ...done!
> ...

 

----------

## c0r0

oh im already solve my probs ^_^, got information from http://www.archivesat.com/post1502717.htm

actually my /tmp is mounted with noexec attribute, 

 *Quote:*   

>  tmpfs           /tmp            tmpfs           nodev,nosuid,size=100M,mode=1777      0 0

 

----------

