git: e3eaff9307f8 - stable/15 - hastd: Remove pidfile on exit
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 05 Nov 2026 15:44:44 UTC
The branch stable/15 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=e3eaff9307f8d35930007d3526e992e3a1cd1438
commit e3eaff9307f8d35930007d3526e992e3a1cd1438
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:30 +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 5d90ddc8aff9..1569dc9f8697 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -1173,6 +1173,7 @@ main_loop(void)
}
terminate_workers();
proto_close(cfg->hc_controlconn);
+ (void)pidfile_remove(pfh);
exit(EX_OK);
}