add log rotation, support for debugging and wait for sub-processes