srv, ibus: remove the endpoints on a signal too

A stopped daemon left its socket and IBus address file behind, since
plan9port ends a process on SIGTERM without running exit handlers. Both
files now go on a note as well as on exit, and only while they are still
the ones this daemon made, so a successor is never robbed of its own.
This commit is contained in:
2026-08-16 21:40:42 +09:00
parent 48d3e165c3
commit bab6077c75
3 changed files with 47 additions and 5 deletions

View File

@@ -334,6 +334,9 @@ main(int argc, char **argv)
showerrors(&daemon);
if(!stopdaemon(&daemon))
ok = 0;
/* SIGTERM must leave no socket behind. */
if(access(live.socket, F_OK) == 0)
ok = fail("socket %s survived the daemon", live.socket);
if(!closeerrors(&daemon))
ok = 0;
if(!liveclean(&live))