Hi Antonio,
as others already mentioned, if exec results in an error thrown, it is not a reliable indicator that the executed Program did not finish successful. I have the same problem with wget, when updating the product catalog images. Using it from within tcl exec always throws an error, even if the file was downloaded successful. After wget has finished I check if the tmp file exists, to determine if wget finished successful, see below. I would try to redirect the output of libreoffice to a file, like &>/tmp/libreoffice.log to hopefuly get more details about the actual error.
Out of curiosity, you say you executed the command in a shell and it worked, did you execute the command as the same user running Aolserver?
foreach cur_url $image_urls {
set temp_picture_name [lindex [split "$cur_url" "/"] end]
set temp_picture_file "/tmp/${temp_picture_name}"
if [catch {exec $wget --directory-prefix=/tmp/ "$cur_url"} errmsg] {
ns_write "wget faild : $errmsg"
}
ns_write "Check if Picture exists!"
if {[file exist $temp_picture_file]} {
ns_write "Picture exists!"
......
}
}