Don't know if this will help - exit code 5 is a file I/O access error, try and change the filemode