"System V" scripts not working properly sometimes
Hi guys,
I have strange problem. Some services when run on Centos 32bit, 5.2 via service command behave abnormally. For example - Nagios when run as root from command prompt works normally, when in daemon mode - not (exits). Samba when run from prompt - work wonderfully, when via service smb start - is not serving files. Had 2 guess: 1. when run via service command - wrong config file is read (Nagios especially has this I think) 2. or running via service command can be affected by SELinux or something? Googled this, but without any luck. Any thoughts? Robert |
Luckily you don't need to guess. If something goes awry stuff gets logged. Nagios even provides useful "preflight check" information. If there's SE Linux warnings but you don't run setroubleshootd (see sealert) look in /var/log/audit/ (unless you don't run Auditd as well, then AVC log lines end up in /var/log/messages).
|
Thank you for reply, you were right - audit.log was way to go.
Let's talk about Nagios in more detailed way. It's 3.0.6 on Centos 5.2 32bit. nagios --verify-config /etc/nagios/nagios.cfg 0 warnings, 0 errors. "Things look okay" but service nagios start Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration. So I checked /var/log/nagios/nagios.log - empty file. And tail /var/log/messages - absolutely nothing about Nagios. This is why I think Nagios has problem with config file. So I checked audit.log and found few avc: denied { read } so used audit2allow -a (to check what's blocked) guess what? There was smbd and nagios rules proposals then audit2allow -M myAdditionalRules < /var/log/audit/audit.log (rules producet to myAdditionalRules.pp file) semodule -i myAdditionalRules.pp Had to do this 3 times (script was going further every time, and rules was longer naturally). And Nagios started finally. I hope it can save somebody some time. Again thank you for help. Robert |
Good you managed to go for the logs. But the Nagios quickinstall docs do have hints wrt SE Linux. I mean, reading does pay off. Still it's good to see you got it working all by yourself.
|
All times are GMT -5. The time now is 10:40 PM. |