git.iko.soy/typeable/nixpkgs
on master help sign in
redis: handle changes to systemd support

The 6.0 changelog notes that systemd support was rewritten. The effects of that seem to be twofold: * Redis will silently fail to sd_notify if not built with libsystemd, breaking our unit configuration. * It also appears to misbehave if told to daemonize when running under systemd -- note that upstream's sample unit configuration does not daemonize: https://github.com/antirez/redis/blob/unstable/utils/systemd-redis_server.service

commit8cdc8687bffd411f6f5b5e458071f18b4c9dd109 authorJamie McClymont <jamie@kwiius.com> dateSun 17 May 2020, 20:11 (7 years ago) parent6c19556
2 files changed+5−5
nixos/modules/services/databases/redis.nix+1−2 pkgs/servers/nosql/redis/default.nix+4−3
nixos/modules/services/databases/redis.nix+1−2
@@ -11,12 +11,11 @@ let
1111 port ${toString cfg.port}
1212 ${condOption "bind" cfg.bind}
1313 ${condOption "unixsocket" cfg.unixSocket}
14− daemonize yes
14+ daemonize no
1515 supervised systemd
1616 loglevel ${cfg.logLevel}
1717 logfile ${cfg.logfile}
1818 syslog-enabled ${redisBool cfg.syslog}
19− pidfile /run/redis/redis.pid
2019 databases ${toString cfg.databases}
2120 ${concatMapStrings (d: "save ${toString (builtins.elemAt d 0)} ${toString (builtins.elemAt d 1)}\n") cfg.save}
2221 dbfilename dump.rdb
pkgs/servers/nosql/redis/default.nix+4−3
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, lua, jemalloc, nixosTests }:
1+{ stdenv, fetchurl, lua, pkgconfig, systemd, jemalloc, nixosTests }:
22
33stdenv.mkDerivation rec {
44 version = "6.0.1";
@@ -18,13 +18,14 @@ stdenv.mkDerivation rec {
1818 ''}
1919 '';
2020
21− buildInputs = [ lua ];
21+ buildInputs = [ lua pkgconfig ] ++ stdenv.lib.optional (stdenv.isLinux) systemd;
2222 # More cross-compiling fixes.
2323 # Note: this enables libc malloc as a temporary fix for cross-compiling.
2424 # Due to hardcoded configure flags in jemalloc, we can't cross-compile vendored jemalloc properly, and so we're forced to use libc allocator.
2525 # It's weird that the build isn't failing because of failure to compile dependencies, it's from failure to link them!
2626 makeFlags = [ "PREFIX=$(out)" ]
27− ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" "MALLOC=libc" ];
27+ ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" "MALLOC=libc" ]
28+ ++ stdenv.lib.optional (stdenv.isLinux) ["USE_SYSTEMD=yes"];
2829
2930 enableParallelBuilding = true;
3031