Export PERPD_OPTS
Fix typo
Create log directory if it doesn't exist