unifi-controller: patchelf unifi's sdnotify, nixos/unifi: enable sd_notify, always restart service (#361945)
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user