guix-mirrors/nix
Ludovic Courtès dd94798552
daemon: Catch SIGINT, SIGTERM, and SIGHUP for proper termination.
Previously the daemon would not install handlers for these signals.  It
would thus terminate abruptly when receiving them, without properly
closing the SQLite database.

Consequently, the database’s WAL file, which is normally deleted by the
last client closing the database (via ‘sqlite3_close’), would not be
deleted when the guix-daemon process is terminated; instead, it would
persist and possibly keep growing beyond reason.

This patch fixes that.

* nix/nix-daemon/nix-daemon.cc (handleSignal, setTerminationSignalHandler):
New functions.
(processConnection): Call it.

Reported-by: Christopher Baines <mail@cbaines.net>
Change-Id: I07e510a1242e92b6a629d60eb840e029c0f921be
2025-04-14 17:33:11 +02:00
..
boost nix: Tweak .gitignore files. 2020-06-24 19:55:22 +01:00
libstore daemon: Do not make chroot root directory read-only. 2025-04-11 12:18:01 +02:00
libutil daemon: Close the read end of the logging pipe. 2025-03-26 17:57:43 +01:00
nix-daemon daemon: Catch SIGINT, SIGTERM, and SIGHUP for proper termination. 2025-04-14 17:33:11 +02:00
.gitignore
AUTHORS
COPYING
local.mk nix: Install guix-gc systemd timer. 2025-03-02 14:21:59 +02:00