Jump to content

SELinux error_log problems


gmmo1971

Recommended Posts

any one has any clue about the problem described below?

 

I restart my apache server and centos gives me an error about a permission regarding writing a error_log file on /

 

anyway, I deleted the file, but the error continues. Here are the steps:

 

[root@localhost /]# ls

bin dev etc lib media mnt opt root selinux sys usr

boot error_log home lost+found misc net proc sbin srv tmp var

[root@localhost /]# rm error_log

rm: remove regular empty file `error_log'? y

[root@localhost /]# /usr/sbin/apachectl restart

[root@localhost /]#

 

after that I get the start on the top right corner and this message:

 

"SELinux is preventing /usr/sbin/httpd (httpd_t) "append" to error_log (root_t). The SELinux type %TARGET_TYPE, is a generic type for all files in the directory and very few processes (SELinux Domains) are allowed to write to this SELinux type. This type of denial usual indicates a mislabeled file. By default a file created in a directory has the gets the context of the parent directory, but SELinux policy has rules about the creation of directories, that say if a process running in one SELinux Domain (D1) creates a file in a directory with a particular SELinux File Context (F1) the file gets a different File Context (F2). The policy usually allows the SELinux Domain (D1) the ability to write or append on (F2). But if for some reason a file (error_log) was created with the wrong context, this domain will be denied. The usual solution to this problem is to reset the file context on the target file, restorecon -v error_log. If the file context does not change from root_t, then this is probably a bug in policy. Please file a bug report against the selinux-policy package. If it does change, you can try your application again to see if it works. The file context could have been mislabeled by editing the file or moving the file from a different directory, if the file keeps getting mislabeled, check the init scripts to see if they are doing something to mislabel the file."

 

I do what they say to do which is:

 

"ou can attempt to fix file context by executing restorecon -v error_logThe following command will allow this access:restorecon error_log"

 

but nothing happens. Every time I restart apache is the same problem.

 

thx for the help.

 

tchau,

Gustavo.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.