use realpath of root.
fix chdir problem in console.