Forum OpenACS Q&A: Problems using exec

Collapse
Posted by Peter Breugel on
Hi, I'm trying to use the command "exec" from within .adp files and try to start "cvs" and "convert" from ImageMagick. Everytime the exec command files, in the case of "cvs" it says "abnormal child termination" and in case of "convert" it says "cannot open file /tmp//mdhfh38848" (some temp filename, not the two backslashes). I absolutely don't know why. I think it is a problem with environment settings? If I catch the error in the cvs case, the whole result is in the catched error message as one would usually expect as the result of exec cvs. Example code for the cvs case:

cd /www/servers/test/pages
set t [catch {
set t2 [exec /usr/bin/cvs -q up]
} e]
On another machine it is working fine! This is done on Linux. Any ideas? Thank you!
Collapse
Posted by Jonathan Ellis on
exec will throw out an "abnormal termination" whenever anything comes out on stderr, which may be what's happening with cvs.  I know tar has a habit of doing this for things I wouldn't consider erroneous.

For convert, all I know is I've used it successfully.  Is your tmp directory world writable?

Collapse
Posted by Yon Derek on
I don't know about exec but cvs does pollute stderr for no reason. If that fools exec, you might try [exec /usr/bin/cvs -q up 2>/dev/null] (i.e. redirect stderr to /dev/null)
Collapse
Posted by Peter Breugel on
Thanks for your answers!

What's also bad is that on a system with,e.g. 30 cvs managed files,
if cvs can't read only one file due to wrong permissions, it also
returns "1" to the shell (echo $?). So 29 "good" results are moved
to the catch-error-text-result. If I want to filter the result I
can't be shure if it's a big error or just a small thing like that
one file that couldn't be read.

So I think that packages like the version control packages have to
rely on 100% working cvs environment?

I hit the problem with convert in another way: If I don't overwrite
the original file with it (which I did when I used the "mogrify"
tool from I-Magick), but instead let the converted file be a new
one, it seemes not to try to create a tmp-file.

Btw: Has anyone encountered this nice feature: I just uploaded a
file with the Opera-Browser (linux) to a test-system with one
registered filter.
The logfile says: "invalid return code from filter proc 'Error
writing content: resource temporarily unavailable': must be
filter_ok, filter_return, or filter_break"
OR: "Error: tclop: invalid ... (same): 'Error writing content:
inappropriate device for ioctl'"

If I upload it with Netscape or Konqueror, it works.
Strange?

Thanks,
Peter.

Collapse
5: File upload problem (response to 1)
Posted by David Walker on
Btw: Has anyone encountered this nice feature: I just uploaded a file with the Opera-Browser (linux) to a test-system with one registered filter.
The logfile says: "invalid return code from filter proc 'Error writing content: resource temporarily unavailable': must be filter_ok, filter_return, or filter_break"


I ran into this problem in a different area, using netscape. I was uploading to the homepage module. I confirmed that the temp file was created and I was unable to determine why the "resource" was considered unavailable. I'll keep looking into it but it isn't very high on my priority list at the moment.