hastd: Remove pidfile on exit

Make hastd remove its pidfile before exit after catching a signal or a
stop control message, not just on failure to start.

MFC after:	1 week
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D60192

(cherry picked from commit 3f2f6bb8f7)
This commit is contained in:
Dag-Erling Smørgrav committed 2026-11-05 15:44:52 +00:00
1 parent 4478c54362
commit 8b63260549
1 file changed
+1
+1
View File
@@ -1174,6 +1174,7 @@ main_loop(void)
}
terminate_workers();
proto_close(cfg->hc_controlconn);
(void)pidfile_remove(pfh);
exit(EX_OK);
}