unifi-controller: patchelf unifi's sdnotify, nixos/unifi: enable sd_notify, always restart service (#361945)

This commit is contained in:
Weijia Wang
2025-01-04 01:09:06 +01:00
committed by GitHub
2 changed files with 15 additions and 2 deletions
+2 -2
View File
@@ -143,10 +143,10 @@ in
restartTriggers = [ cfg.unifiPackage cfg.mongodbPackage ];
serviceConfig = {
Type = "simple";
Type = "notify";
ExecStart = "${cmd} start";
ExecStop = "${cmd} stop";
Restart = "on-failure";
Restart = "always";
TimeoutSec = "5min";
User = "unifi";
UMask = "0077";
+13
View File
@@ -4,6 +4,7 @@
dpkg,
fetchurl,
nixosTests,
systemd,
}:
stdenv.mkDerivation rec {
@@ -28,6 +29,18 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
postInstall =
if stdenv.hostPlatform.system == "x86_64-linux" then
''
patchelf --add-needed "${systemd}/lib/libsystemd.so.0" "$out/lib/native/Linux/x86_64/libubnt_sdnotify_jni.so"
''
else if stdenv.hostPlatform.system == "aarch64-linux" then
''
patchelf --add-needed "${systemd}/lib/libsystemd.so.0" "$out/lib/native/Linux/aarch64/libubnt_sdnotify_jni.so"
''
else
null;
passthru.tests = {
unifi = nixosTests.unifi;
};