leftover PIDs causing FreeBSD to autoreboot

We had a power loss at home not too long ago which caused my FreeBSD box to reboot endlessly despite running ‘fsck’

It turned out there were several existing PID files leftover in /var/run/ that were not deleted by the system after power came back. It was baffling because the system would go through the normal boot processes, startup services and when it was about to start SSHD, a crash dump or some sort of kernel panic is displayed. A few seconds later, the system would reboot and do it over again.

Booting into single-user mode and running “fsck” several times did not remove the leftover PID files. Once they were deleted, the system booted normally.