I did investigated the issue a bit further and figured out it has also
nothing to do with file streams for stdin, stdout and stderr.
Following simple code placed in rc.lua configuration script hangs its
execution forever:
os.execute('xrandr -q') -- hangs in rc.lua, does work anywhere else
Any idea why ??
xrandr process can be normally seen by ps output and rc.lua does not
continua and waits for something ...
Thx for any advice
David
On Sat, Oct 2, 2010 at 1:41 AM, David Unric <[email protected]> wrote:
> Hello,
>
> it starts to drive me a bit mad because I cann't understand what's going
> wrong with the following code:
>
> prg_out = io.popen('/usr/bin/xkb-switch'):read('*a')
>
> When run in a separate script or from Lua interpreter it works as expected,
> ie. it stores program output in prg_out variable. But run from rc.lua it
> hangs forever. Function io.popen() successfully returns file handle but any
> attempt to call read() or close() at this handle results in script stall :(
> The same behavior when trying to catch output of other programs like
> xrandr, xmodmap.
>
> However what makes it uneasy, catching output of programs amixer, mpc,
> uname like
>
> prg_out = io.popen('/bin/uname -r'):read('*a')
>
> does work, ie. rc.lua script doesn't hang and output is stored.
>
> I cann't find the source of problem. All mentioned programs are Linux ELF
> executables, single or multiline output makes no difference, setting locales
> to default (LANG=C LC_ALL=C) also makes no difference. And as already
> stated, the issue manifests only when run from within rc.lua script.
>
> Any idea what I may have omitted ?
>
>
> David
>
>