chcon: can't apply partial context to unlabeled file while installing nagios with SELinux

26,805

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:
26,805

Related videos on Youtube

Mohammed Shannaq
Author by

Mohammed Shannaq

Updated on September 18, 2022

Comments

  • Mohammed Shannaq
    Mohammed Shannaq over 1 year

    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?

    • ninjalj
      ninjalj over 12 years
      Label the files? i.e. add a user and role label, aside from the type label.
  • Admin
    Admin almost 2 years
    This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review