nixos/dictd: treat SIGTERM exit status as success

dictd doesn't handle SIGTERM and terminates with code 143 (128 + 15
(SIGTERM) instead of 0. This results in systemd marking the service as
failed when a user stops it (with `systemctl stop dictd`). Fix it by
treating code 143 as success.
This commit is contained in:
Bjørn Forsman 2024-06-27 23:42:27 +02:00
parent 70846faf16
commit 7db3dc0fa4

View File

@ -62,6 +62,9 @@ in
description = "DICT.org Dictionary Server";
wantedBy = [ "multi-user.target" ];
environment = { LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; };
# Work around the fact that dictd doesn't handle SIGTERM; it terminates
# with code 143 instead of exiting with code 0.
serviceConfig.SuccessExitStatus = [ 143 ];
serviceConfig.Type = "forking";
script = "${pkgs.dict}/sbin/dictd -s -c ${dictdb}/share/dictd/dictd.conf --locale en_US.UTF-8";
};