commit f578f9d482455992e6cfbb903ced3a926ca740cb25e94a52bed730c276ec2504 from: Stefan Sperling date: Mon Jun 23 11:38:59 2025 UTC make sure gotsysd libexec helpers flush all pending messages before exiting commit - ce2dbf65aa1f2d3eda3a304b2a103f5fe7e290e443e3768e266140ef8f550e9c commit + f578f9d482455992e6cfbb903ced3a926ca740cb25e94a52bed730c276ec2504 blob - 12d4059f1b905ba189d096e95040189cd2cfde91335c3295773ef55d2c8fc72c blob + 47d42d64d53559efda67e77e76f95fe6afa30f0f4ca2b09dc7692e3a5873afd2 --- gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c +++ gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c @@ -200,7 +200,7 @@ dispatch_gotd(int fd, short event, void *arg) goto fatal; } - if (flush_and_exit) { + if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); event_loopexit(NULL); return; @@ -268,7 +268,7 @@ dispatch_gotsysd(int fd, short event, void *arg) goto fatal; } - if (flush_and_exit) { + if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); event_loopexit(NULL); return; blob - e1281d20712bb0b84fe37d551c1e2d959dc9c37eab427fb8f1f31583d998b009 blob + 888e3fe3c5198d74870aa3cda2fc43cdd519ca2c08e0c476afbb3607f8faf1b2 --- gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c +++ gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c @@ -494,7 +494,8 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (groupadd_state == GROUPADD_STATE_DONE) { + if (imsgbuf_queuelen(ibuf) == 0 && + groupadd_state == GROUPADD_STATE_DONE) { event_del(&iev->ev); event_loopexit(NULL); return; blob - 540e3e341f8ae92b91ce52d0a6fc9e08162b6a777f15480def563eba0b3d5dc8 blob + b450d63846b33eaced2364667915dbc1362a5f9db92d5d01fbdda13ec28c321b --- gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c +++ gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c @@ -110,7 +110,7 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (flush_and_exit) { + if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); event_loopexit(NULL); return; blob - 9c221635c5cc9d8753e67fdcf1b17c74298c3a837a1b7e0f88e9e6b36a04c352 blob + 645553c3a0ad9b171fc23078c1c5ec873da0fa1fc1caa5094e463e77af39679e --- gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c +++ gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c @@ -311,7 +311,7 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (flush_and_exit) { + if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); event_loopexit(NULL); return; blob - 3944b7e56f4b1352aa1a6393eb9970505cd4345c0324d6267743c5e3cfec535b blob + d096b04dc5cef1fd26924bfdfe3dd5d7c8dee7a84ab83482eadd3939727f5f2e --- gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c +++ gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c @@ -156,7 +156,8 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (rmkeys_state == RMKEYS_STATE_DONE) { + if (imsgbuf_queuelen(ibuf) == 0 && + rmkeys_state == RMKEYS_STATE_DONE) { event_del(&iev->ev); event_loopexit(NULL); return; blob - 8b1abe8a30757dc0f5f0526950f7ca67a823bcd2a28d070e3b510aca7808c16c blob + a9857640b2ffb94c07cf3a6d4d17fc6c593cc160a22ce91aece7e853a3afa8c9 --- gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c +++ gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c @@ -151,7 +151,7 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (flush_and_exit) { + if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); event_loopexit(NULL); return; blob - bf69a1de6b34c3557921f44f707293e3f712c4877e0bd58441b9bbf8b92dcc79 blob + e213b1a31c96579184508c3ff6413bf1be4521482a131a79808cd0357c5cf320 --- gotsysd/libexec/gotsys-useradd/gotsys-useradd.c +++ gotsysd/libexec/gotsys-useradd/gotsys-useradd.c @@ -748,7 +748,8 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (useradd_state == USERADD_STATE_DONE) { + if (imsgbuf_queuelen(ibuf) == 0 && + useradd_state == USERADD_STATE_DONE) { event_del(&iev->ev); event_loopexit(NULL); return; blob - e94ff6eb1c4edd1f60e2c102a47e29fee40acf0b8f306e833090ab55741a82c5 blob + 1ee5fa46f30cf4e407c9213881da38d918d9b729fe04fcb9bd30dbd4ae1fbab9 --- gotsysd/libexec/gotsys-userhome/gotsys-userhome.c +++ gotsysd/libexec/gotsys-userhome/gotsys-userhome.c @@ -222,7 +222,8 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (userhome_state == USERHOME_STATE_DONE) { + if (imsgbuf_queuelen(ibuf) == 0 && + userhome_state == USERHOME_STATE_DONE) { event_del(&iev->ev); event_loopexit(NULL); return; blob - 799b70adfb709d96e98cda3bde07a2867d3b421408b3cf4494393f8485e50448 blob + 93dc4879435a5dd6fa838f7b81875faba29209a3cc557adc9b88700deb38817d --- gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c +++ gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c @@ -156,7 +156,7 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (flush_and_exit) { + if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); event_loopexit(NULL); return; blob - 6902cd193593dd0dfdf1b7451657e78d59e459004d3da865de7f29b45521df81 blob + f3a9b7a0f6943faeba1de1041aaeaa759f2c32a7f200317d5bbcd21f86c274af --- gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c +++ gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c @@ -385,7 +385,7 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } - if (flush_and_exit) { + if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); event_loopexit(NULL); return;