chdir to data directory
Name the pidfile on error