[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Several problems while trying to make screen automatically start ano
From: |
Kresimir Cosic |
Subject: |
Re: Several problems while trying to make screen automatically start another program. |
Date: |
Wed, 26 Apr 2006 22:14:48 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.6 (Windows/20050716) |
Thanks for answers. I still didn't solve the problem, but it gave me
an idea.
Adam Lazur wrote:
> This isn't a screen problem, it's a dynamic linking problem.
>
> I bet the executable can't find the shared library when it starts up.
> Does your shell have an LD_LIBRARY_PATH environment variable set?
What
> happens if you run: screen /bin/sh -c fooint.exe
Seems like a plausible explanation, but I don't quite understand how
linux finds shared libraries, and, most important, why it can't find
shared libraries only when using 'screen ./fooint2.exe'. It seems
that I have LD_LIBRARY_PATH set in my .bashrc:
LD_LIBRARY_PATH=/home/kreso/prog/mysql/lib/mysql/
export LD_LIBRARY_PATH
I still get [screen is terminating] if I run
screen /bin/sh -c fooint2.exe
I also tried
screen /bin/sh -c /home/kreso/prog/fooint2.exe
but doesn't work.
>>Problem 2.
> Quoting problems?
I also thought of that, so I changed that program so that it doesn't
execute commands, but prints them instead. Then I copy-pasted the
lines that program printed, and it worked fine.
> It's not worth debugging a c program that only calls
> system()... write a #!/bin/sh script to do this instead (system() is
> using the shell anyway).
Thanks for sugestion, but this actually won't help because
eventually I have to call screen from a complex program that can't
be substituted with a script.
But... maybe if I write a script, and then call that script with
system(), maybe that would work. Well, I will certainly try.