LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-14-2009, 05:58 PM   #1
rbauhaus
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Rep: Reputation: 0
"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
 
Old 03-14-2009, 09:04 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,991
Blog Entries: 54

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
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).
 
Old 03-15-2009, 03:23 AM   #3
rbauhaus
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Original Poster
Rep: Reputation: 0
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

Last edited by rbauhaus; 03-15-2009 at 04:20 AM.
 
Old 03-15-2009, 08:39 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,991
Blog Entries: 54

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"su" commands not working properly htetnaing Linux - Newbie 4 08-15-2008 10:30 AM
Seeking for "Synchronise" and "patients" projects/scripts of Visual Basic LAN-Dominator.nl Programming 2 07-05-2008 07:21 PM
my Fedora Box not working properly with the message " INPUT NOT SUPPORTED" siri.siri143 Linux - Newbie 3 04-15-2008 10:16 PM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
"w" command not working properly blizunt7 Linux - General 3 12-17-2005 04:07 PM


All times are GMT -5. The time now is 02:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration