On 21/08/2013, at 1:35 PM, Kevin <xing....@gmail.com> wrote: > Graham, > > Thanks for the quick response. > > WSGISocketPrefix "/var/tmp/apache/${USER}/wsgi" > > where $USER is the owner which starts the Apache server. We store access and > error log in the same directory. > > The owner of that directory and its parent are both $USER, and the > permissions are both "drwxrwxr-x". It should not be a permission issue as > this used to work on this host. I suspect .sock file was deleted somehow, I > will move it to another location if the problem still exists. > > Is it possible mod_wsgi delete it? I looked at mod_wsgi code, does > wsgi_cleanup_process() delete .sock file? and if so, is it only deleted from > parent httpd process which created wsgi daemons, what could possibly trigger > it being called?
The socket files are only deleted from the parent. Normally at Apache shutdown or reload/restart. It is also done on startup to clear out stale files, but that is only to protect against a stale file from a bad Apache shutdown. That shutdown would have had to have been quite some time earlier, as the socket files have the process ID of the Apache parent in them. So I can't see how mod_wsgi could remove them in error. That you have them in /var/tmp is a little worry. Normally /var/tmp isn't touched by anything. In contrast, on some systems stuff under /tmp can be cleared out for various reasons. After a bit of a Google search though I have found this comment: http://superuser.com/a/168127 All RHEL-based distros clean /var/tmp of files older than 30 days. I don't know about other distros. Look for a cron entry that invokes tmpwatch. On Fedora/RHEL it is /etc/cron.daily/tmpwatch. It has a line like /usr/sbin/tmpwatch "$flags" 30d /var/tmp or /usr/sbin/tmpwatch 720 /var/tmp. 720 hours = 30 days. So looks like it is possible that some systems clear out stuff from /var/tmp on a periodic basis. Graham > On Tuesday, August 20, 2013 10:00:38 PM UTC-4, Graham Dumpleton wrote: > Can you indicate what you haveWSGISocketPrefix set to? > > It is a bit odd to have them in a sub directory of /var/tmp as mod_wsgi will > not create directories and they would need to exist first. This implies your > would have had to create hat directory in /var/tmp yourself, and being in > /var/tmp, something might well remove the directory, although usually stuff > in /var/tmp isn't automatically purged. > > For that directory and it's parent, what are the permissions and owner? > > Have you tried a directory other than under /tmp or /var/tmp? As a rule I > would recommend against using tmp directories for these files. > > Graham > > On 21/08/2013, at 11:45 AM, Kevin <xing...@gmail.com> wrote: > >> I have read https://code.google.com/p/modwsgi/wiki/ConfigurationIssues >> regarding location of sockets, my problem looks a little bit different >> though. wsgi has been working fine for a week, and starting from today, it >> stopped working on one of the hosts, and I found that wsgi.x.x.sock file was >> missing in /var/tmp/apache/some_user/ on that host only. I had 4 wsgi >> daemons running on that host, none of them were bounced since the parent >> httpd process was bounced last time, all other child httpd process have been >> restarted though, probably due to it has exceeded a certain number of >> requests. >> >> I am not sure why .sock file was gone. btw, I noticed that pids file was >> also missing. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to modwsgi+u...@googlegroups.com. >> To post to this group, send email to mod...@googlegroups.com. >> Visit this group at http://groups.google.com/group/modwsgi. >> For more options, visit https://groups.google.com/groups/opt_out. > > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to modwsgi+unsubscr...@googlegroups.com. > To post to this group, send email to modwsgi@googlegroups.com. > Visit this group at http://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+unsubscr...@googlegroups.com. To post to this group, send email to modwsgi@googlegroups.com. Visit this group at http://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/groups/opt_out.