rc.subr starts daemon(8) as snmp_exporter_user, which is nobody by
default. When the exporter exits, daemon(8) cannot unlink its pidfile
from the root-owned /var/run, so "service snmp_exporter stop" left
/var/run/snmp_exporter.pid behind.
Remove the pidfile in stop_postcmd, which runs as root after the
exporter has exited. The path stays the same, so the rc script still
finds an exporter that an earlier version of the script started.
This also helps "service snmp_exporter restart". The old daemon(8)
supervisor outlives the exporter briefly and holds a lock on the
pidfile until it exits. A new daemon(8) that found the file still
locked refused to start. It now creates a new pidfile instead.
PR: 294396
MFH: 2026Q4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>