git: 8b63260549a8 - stable/14 - hastd: Remove pidfile on exit

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Thu, 05 Nov 2026 15:45:03 UTC
The branch stable/14 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b63260549a86813654913bf7a0969e73172621b

commit 8b63260549a86813654913bf7a0969e73172621b
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-11-02 12:30:42 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-11-05 15:44:52 +0000

    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 3f2f6bb8f7b562276bffd04a9ae4c05a351b4435)
---
 sbin/hastd/hastd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c
index aa8328c0b041..d6c2b54cedf5 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -1174,6 +1174,7 @@ main_loop(void)
 	}
 	terminate_workers();
 	proto_close(cfg->hc_controlconn);
+	(void)pidfile_remove(pfh);
 	exit(EX_OK);
 }