Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm setting up Nagios core on CentOS with SELINUX=enforcing.

I try to run

chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/

as suggested in the manual, but I get this error messages:

chcon: can't apply partial context to unlabeled file `cmd.cgi'
chcon: can't apply partial context to unlabeled file `trends.cgi'
chcon: can't apply partial context to unlabeled file `histogram.cgi'
chcon: can't apply partial context to unlabeled file `avail.cgi'
chcon: can't apply partial context to unlabeled file `history.cgi'
chcon: can't apply partial context to unlabeled file `status.cgi'
chcon: can't apply partial context to unlabeled file `tac.cgi'
chcon: can't apply partial context to unlabeled file `showlog.cgi'
chcon: can't apply partial context to unlabeled file `notifications.cgi'
chcon: can't apply partial context to unlabeled file `extinfo.cgi'
chcon: can't apply partial context to unlabeled file `statuswml.cgi'
chcon: can't apply partial context to unlabeled file `outages.cgi'
chcon: can't apply partial context to unlabeled file `statuswrl.cgi'
chcon: can't apply partial context to unlabeled file `statusmap.cgi'
chcon: can't apply partial context to unlabeled file `config.cgi'
chcon: can't apply partial context to unlabeled file `summary.cgi'

Any ideas how to avoid these errors?

share|improve this question

migrated from stackoverflow.com Oct 30 '11 at 12:21

This question came from our site for professional and enthusiast programmers.

    
Label the files? i.e. add a user and role label, aside from the type label. –  ninjalj Oct 29 '11 at 20:50

1 Answer 1

You need to relabel the files with the right selinux type:

semanage fcontext -a -s system_u -t httpd_sys_script_exec_t /usr/local/nagios/sbin/*
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.