fix dereg non-exist script
let the script inherit the parent's stdout and stdin, create log file if not exist