improved logging and daemon startup script for --nodaemon