Forum OpenACS Q&A: Response to Error: nsd.tcl: error reading output from command: interrupted system call

Thanks Jonathan, I will have to stick to my workaround for now though because I don't have proper access to the freebsd box in question. Just in case anyone else needs the workaround I have changed it so it doesn't need the database and trims the program's output which was causing problems.

proc dc_exec {prog_name args} {

# Generate a new unique filename for the output of this command
set tmpFName [ad_parameter PhotoDataRoot photodb]/dc-exec-[ns_thread getid]

# Run the command - note the eval here splits the args
set command "exec $prog_name $args > $tmpFName"
eval $command

# Read and return the output of the command - clean up file
set fId [open $tmpFName]
set return_string [read $fId]
close $fId
file delete $tmpFName
return [string trimright $return_string]
}
BTW - although I'm familiar enough with the aolserver tcl api - I wasn't aware of functions like ns_rand, ns_thread, ns_critsec, ns_sema, ns_sleep which are all missing from standard tcl.