commit 50f1d7bec5bdd5acea20392af171a75c41deef1a from: Stefan Sperling date: Mon Jun 23 13:22:58 2025 UTC avoid event_loopexit() in gotsysd libexec event handlers when flushing It seems flushing our final message can fail if we forcefully exit the event loop here. This would leave gotsysd's sysconf process stuck in a state where it was waiting for a message which never arrived. commit - c5e96df445562a55ab4860771be8f33067b8e74f commit + 50f1d7bec5bdd5acea20392af171a75c41deef1a blob - a64bd572c43a0f7cbbd9512d5e44332515d27164 blob + 600e2c02a45902c21891d50646205887049d4dbc --- gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c +++ gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c @@ -199,7 +199,6 @@ dispatch_gotd(int fd, short event, void *arg) goto fatal; } else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); - event_loopexit(NULL); return; } } @@ -267,7 +266,6 @@ dispatch_gotsysd(int fd, short event, void *arg) if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - 5ad3f11f5e1c3703357d07a810461d0edd4338cd blob + 8e3e40da1a48c9d2f58e00a85d3e7a794444d023 --- gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c +++ gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c @@ -494,7 +494,6 @@ dispatch_event(int fd, short event, void *arg) } else if (imsgbuf_queuelen(ibuf) == 0 && groupadd_state == GROUPADD_STATE_DONE) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - b44b7d433b08727fea3c50ffd0d2a044463d775d blob + 44ee2119c6a0b8e920787724490fd709ede7dc17 --- gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c +++ gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c @@ -109,7 +109,6 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - 27e73fdda9725787a48b1dc27c6b7199ea88e7e5 blob + 108f6cc7b0d24fd077c34f5968ef71d639e11322 --- gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c +++ gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c @@ -310,7 +310,6 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - 06cd0a8b6e99fa0a70e3f77c25f06dd45f74e542 blob + 92da3e9ed49ecbf470550609078515eca6349180 --- gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c +++ gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c @@ -156,7 +156,6 @@ dispatch_event(int fd, short event, void *arg) } else if (imsgbuf_queuelen(ibuf) == 0 && rmkeys_state == RMKEYS_STATE_DONE) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - 8a0ff30a244348cbe60c6d401f852572ae86d04e blob + bf83573c240a3f71b09cbf1d56845a5ddc743cd8 --- gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c +++ gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c @@ -150,7 +150,6 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - aebb0290f632e8d3ca1b392ea97c9ac34354fdfa blob + 8c2238b281ee524d944079247a1c70606b88362f --- gotsysd/libexec/gotsys-useradd/gotsys-useradd.c +++ gotsysd/libexec/gotsys-useradd/gotsys-useradd.c @@ -748,7 +748,6 @@ dispatch_event(int fd, short event, void *arg) } else if (imsgbuf_queuelen(ibuf) == 0 && useradd_state == USERADD_STATE_DONE) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - 67d66efcc5b2a413319624cb83ba50a31d6583f2 blob + 683b0947c22e1c2ddc25ebe17483cafb03847799 --- gotsysd/libexec/gotsys-userhome/gotsys-userhome.c +++ gotsysd/libexec/gotsys-userhome/gotsys-userhome.c @@ -222,7 +222,6 @@ dispatch_event(int fd, short event, void *arg) } else if (imsgbuf_queuelen(ibuf) == 0 && userhome_state == USERHOME_STATE_DONE) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - 7edea2411607e0e48f19eef23eaeb963035288dd blob + 0fcc5a687a031594482c0015d28b257fe642e9a2 --- gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c +++ gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c @@ -155,7 +155,6 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); - event_loopexit(NULL); return; } } blob - 7af2e2c8c1f8fc768f8b6b89978e40b5d796ab6e blob + fbc17257cbb8ceb3f87916183d64f1660a16d0f7 --- gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c +++ gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c @@ -384,7 +384,6 @@ dispatch_event(int fd, short event, void *arg) goto fatal; } else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) { event_del(&iev->ev); - event_loopexit(NULL); return; } }