LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-01-2008, 11:27 AM   #1
vtbludgeon
Member
 
Registered: Sep 2002
Distribution: Ubuntu 12.04
Posts: 55

Rep: Reputation: 16
application log file suddenly unwriteable by Apache


I am running a PHP/Mysql Zend Framework 1.5.2 application on CentOS.

When php/apache tries to open the application's log file for appending, the logging component Zend_Log throws an exception '"/var/log/webapp/interp_requests.test.log" cannot be opened with mode "a"'

Here's what's odd: The file, and its ownership, and its permissions, AFAIK are today exactly the same as what they were yesterday and it was working just fine. I.e.:

Code:
[david@interps2 webapp]$ ls -ld /var/log/webapp
drwxr-xr-x 2 apache apache 4096 Aug  1 09:12 /var/log/webapp
[david@interps2 webapp]$ ls -ld /var/log/webapp/*
-rw-r--r-- 1 apache apache 46759 Jul 31 17:45 /var/log/webapp/interp_requests.test.log
and I did not touch anything in the interim. My yum.log tells me some things were updated yesterday, maybe that's related to my issue. I have had problems in the past with selinux doing its job against my will, but

Code:
sudo grep -i selinux /var/log/messages
does not say anything about apache or httpd except this, from several days ago:
Code:
Jul 27 04:02:20 interps2 setroubleshoot: SELinux is preventing the /usr/sbin/httpd from using 
potentially mislabeled files socket:[390995] (rpm_var_lib_t).
For complete SELinux messages. run sealert -l 6012850a-b9b1-4db6-a5b2-ee689f96dbfc
and I don't know whether that is relevant. Nonetheless, when I go

Code:
[root@interps2 log]# /usr/bin/sealert -l 6012850a-b9b1-4db6-a5b2-ee689f96dbfc
I get
Code:
failed to connect to server: 'NoneType' object has no attribute 'format'
So.... any ideas?

Gratefully,

Last edited by vtbludgeon; 08-01-2008 at 11:44 AM.
 
Old 08-02-2008, 12:18 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,306
Blog Entries: 54

Rep: Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857Reputation: 2857
Quote:
Originally Posted by vtbludgeon View Post
cannot be opened with mode "a"'
Dunno. "mode a" sounds like "append"?


Quote:
Originally Posted by vtbludgeon View Post
My yum.log tells me some things were updated yesterday, maybe that's related to my issue.
Please check. You can 'rpm --last|head -30' if you know it was thirty or less upgrades, else check your yum.log.


Quote:
Originally Posted by vtbludgeon View Post
I have had problems in the past with selinux doing its job against my will
No, you definately wanted it but you didn't *know* you wanted it :-]


Quote:
Originally Posted by vtbludgeon View Post
failed to connect to server: 'NoneType' object has no attribute 'format'
Have a look if restarting the (nscd, auditd and) setroubleshootd daemon helps you get access again. If any of those won't come up again check the logs. First thing comes to mind would be a Python issue.
 
Old 09-02-2008, 10:20 AM   #3
vtbludgeon
Member
 
Registered: Sep 2002
Distribution: Ubuntu 12.04
Posts: 55

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by unSpawn View Post
Dunno. "mode a" sounds like "append"?
Yeah, that's just PHP-speak for opening a file for appending.

Quote:
Originally Posted by unSpawn View Post
Have a look if restarting the (nscd, auditd and) setroubleshootd daemon helps you get access again. If any of those won't come up again check the logs. First thing comes to mind would be a Python issue.
You're the man! '/etc/init.d/nscd restart' reported that it wasn't running in the first place. This is pretty much black magic to me but I rebooted all the daemons you said and then I was able to reproduce the error, grep the logs, run the selinux stuff, restorecon on the file in question, and get back on the road again.

Thank you!

Last edited by vtbludgeon; 09-02-2008 at 10:21 AM.
 
  


Reply

Tags
apache2, file, logging, permission, selinux


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
Relevant Log File for Apache 2 Crashing icarusfall Linux - Server 1 06-25-2007 03:59 PM
Apache log file - logging entries late kirtimaan_bkn Linux - Newbie 1 12-10-2006 05:28 PM
Apache Access Log File Problem kirtimaan_bkn Linux - Server 2 10-23-2006 11:27 PM
Apache Log file question. GarroteYou Linux - Security 8 10-24-2004 05:51 AM
Question about Apache Log File ? jerryjerryjerry Red Hat 0 04-18-2004 05:44 PM


All times are GMT -5. The time now is 09:31 AM.

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