Skip to content

Commit 0b6f4a2

Browse files
committed
unifi-controller: patchelf unifi's sdnotify
Fixes the following in server.log: <launcher> ERROR sdnotify - failed to load ubnt_sdnotify_jni java.lang.UnsatisfiedLinkError: /var/lib/unifi/lib/native/Linux/x86_64/libubnt_sdnotify_jni.so: libsystemd.so.0: cannot open shared object file: No such file or directory
1 parent 5cfe3df commit 0b6f4a2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkgs/by-name/un/unifi/package.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
dpkg,
55
fetchurl,
66
nixosTests,
7+
systemd,
78
}:
89

910
stdenv.mkDerivation rec {
@@ -28,6 +29,18 @@ stdenv.mkDerivation rec {
2829
runHook postInstall
2930
'';
3031

32+
postInstall =
33+
if stdenv.hostPlatform.system == "x86_64-linux" then
34+
''
35+
patchelf --add-needed "${systemd}/lib/libsystemd.so.0" "$out/lib/native/Linux/x86_64/libubnt_sdnotify_jni.so"
36+
''
37+
else if stdenv.hostPlatform.system == "aarch64-linux" then
38+
''
39+
patchelf --add-needed "${systemd}/lib/libsystemd.so.0" "$out/lib/native/Linux/aarch64/libubnt_sdnotify_jni.so"
40+
''
41+
else
42+
null;
43+
3144
passthru.tests = {
3245
unifi = nixosTests.unifi;
3346
};

0 commit comments

Comments
 (0)