At Thu, 26 Feb 2009 20:42:36 +0100
kba wrote:

> hi
> 
> after reloading awesome's config several times (via Mod4+Ctrl+R), it
> won't reload anymore with the error message "cannot open
> $XDG_CONFIG_HOME/awesome/rc.lua: Too many open files". I start awesome
> manually via startx and $HOME/.xinit, so I guessed this might be the
> shell limiting the number of open files. On the other hand 'ulimit -a'
> shows that 1024 open file descriptors are allowed, which seems to me to
> be quite a lot.
> 
> Why are there so many files open? I do query 'amixer' every second but
> that's all, no other external files/processes. Is it because I have
> three hooks that fire every second, do I need to combine them into one or
> vary the update time, something like that? 
> 
> Any hints are appreciated
> kba
> 

If you io.popen() amixer, you have to close the file handle after using it. I
usually use stuff like
 local fh = io.popen("foo")
 if not fh then return
 local bar = fh:read("*all")
 fh:close()
to solve that problem. To see a list of all open file handles, you can use
 ls /proc/$(pidof awesome/fd
if that lists more than a handful, you should check for open file handles in
your config.

-- 
GCS/IT/M d- s+:- a--- C++ UL+++ US UB++ P+++ L+++ E--- W+ N+ o--
K- w--- O M-- V PS+ PE- Y+ PGP+++ t+ 5 X+ R tv+ b++ DI+++ D+++ G+
e- h! r y+

    Gregor Best

Attachment: signature.asc
Description: PGP signature

Reply via email to