1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-09 23:50:47 +02:00
guix/nix/nix-daemon
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
..
guix-daemon.cc
nix-daemon.cc daemon: Catch SIGINT, SIGTERM, and SIGHUP for proper termination. 2025-04-14 17:33:11 +02:00
shared.hh