Sort out the pids directory.