add mode to write average volume instead of max add pid file handle sighup for log rotation add daemon mode