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
This commit is contained in:
Dag-Erling Smørgrav committed 2026-11-02 13:30:42 +01:00
1 parent 18bce6e65c
commit 3f2f6bb8f7
1 file changed
+1
+1
View File
@@ -1173,6 +1173,7 @@ main_loop(void)
}
terminate_workers();
proto_close(cfg->hc_controlconn);
(void)pidfile_remove(pfh);
exit(EX_OK);
}