sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
408 stars 148 forks source link

Rocky8: permission error on /var/log/thruk/thruk.log #1335

Closed garadar closed 9 months ago

garadar commented 9 months ago

Describe the bug

I need to migrate my centos 7 monitoring server to Rocky8 at least. But I get an error when I tried to access to thruk web page

I Follow the OMD procedure and install the repository for CentOS/RedHat/Rocky 8

Thruk Version

[root@test-thruk yum.repos.d]# yum info thruk
Last metadata expiration check: 0:16:05 ago on Tue 30 Jan 2024 03:50:27 PM CET.
Installed Packages
Name         : thruk
Version      : 3.12
Release      : 12878.1
Architecture : x86_64
Size         : 0.0  
Source       : thruk-3.12-12878.1.src.rpm
Repository   : @System
From repo    : labs_consol_stable
Summary      : Monitoring Webinterface for Nagios/Naemon/Icinga and Shinken
URL          : http://thruk.org
License      : GPL-2.0-or-later
Description  : Thruk is a multibackend monitoring webinterface which currently
             : supports Naemon, Nagios, Icinga and Shinken as backend using the Livestatus
             : API. It is designed to be a 'dropin' replacement and covers almost
             : all of the original features plus adds additional enhancements for
             : large installations.

### **To Reproduce**
On a fresh deployed VM on rocky8 I tried to install thruk
[root@test-thruk yum.repos.d]# dnf install epel-release -y
[root@test-thruk yum.repos.d]# rpm -Uvh "https://labs.consol.de/repo/stable/rhel8/i386/labs-consol-stable.rhel8.noarch.rpm"
[root@test-thruk yum.repos.d]# dnf install thruk

However I get the following error message when I tried to connect on http://localhost/thruk I check the permission on /var/log/thruk/ for user apache and everything is good,


Can't open /var/log/thruk/thruk.log (Permission denied) at /usr/lib64/thruk/perl5/Log/Log4perl/Appender/File.pm line 151.
[Tue Jan 30 16:04:17.499951 2024] [fcgid:warn] [pid 14627:tid 140667382466304] (104)Connection reset by peer: [client 10.40.126.9:61304] mod_fcgid: error reading data from FastCGI server
[Tue Jan 30 16:04:17.500009 2024] [core:error] [pid 14627:tid 140667382466304] [client X.X.X.X:61304] End of script output before headers: fcgid_env.sh

I have quite the same on my centos7 server (same permission, same owner). I tried to write with user apache ans it works:

[root@test-monitor-el8 ~]# sudo -u apache bash
bash-4.4$ id
uid=48(apache) gid=48(apache) groups=48(apache) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
bash-4.4$ echo 1 >> /var/log/thruk/thruk.log 
bash-4.4$ tail !$
tail /var/log/thruk/thruk.log
[2024/01/30 12:20:09][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 12:50:09][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 13:20:02][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 13:50:10][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 14:20:08][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 14:50:08][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 15:20:02][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 15:50:02][test-monitor-el8][INFO] [cron] maintenance complete
[2024/01/30 16:20:10][test-monitor-el8][INFO] [cron] maintenance complete
1

I did not understand what is going wrong, any idea ?

Thank

sni commented 9 months ago

weird permission issues are often related to SELinux, especially on rhel based systems.

garadar commented 9 months ago

Well Well Well, such a shame !

I was sure to disabled them 🙊

Thank you !