Writing the id file on startup