Move PacketID and Chunk logging to a dedicated file.
Add signal handling so we can cleanly shutdown.
Reset SIGTERM after catching it, otherwise we loop forever.