Closed fnoop closed 2 years ago
Builds but can't find libwebsockets at runtime:
Sep 17 12:19:12 maverick-raspberry systemd[1]: Started WebRTC Janus Gateway.
Sep 17 12:19:12 maverick-raspberry janus[1154]: /srv/maverick/software/janus-gateway/bin/janus: error while loading shared libraries: libwebsockets.so.18: cannot open shared object file: No such file or directory
Sep 17 12:19:12 maverick-raspberry systemd[1]: maverick-webrtc.service: Main process exited, code=exited, status=127/n/a
Sep 17 12:19:12 maverick-raspberry systemd[1]: maverick-webrtc.service: Failed with result 'exit-code'.
Resolves on the command line:
[dev] [mav@maverick-raspberry /etc/systemd/system]$ ldd /srv/maverick/software/janus-gateway/bin/janus
linux-vdso.so.1 (0xbeea5000)
/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6f50000)
libwebsockets.so.18 => /srv/maverick/software/libwebsockets/lib/libwebsockets.so.18 (0xb6ef5000)
This is probably because we set LD_LIBRARY_PATH in /etc/profile.d/41-maverick-libwebsockets-ldlibrarypath.sh but this isn't used in systemd. Either we should compile the rpath in, or set the runtime path in the systemd manifest.
Aargh, we need to add libnice build to ensure we get a supported version of libnice. This uses meson and stupidly installs to an architecture dependent libdir by default, so we can't find pkg-config.
https://github.com/mesonbuild/meson/issues/1972
Answer is to set libdir in the meson step, then we can set PKG_CONFIG_PATH reliably across different platforms.
janus not finding new libnice libraries at startup:
Sep 18 12:30:46 maverick-raspberry systemd[1]: Started WebRTC Janus Gateway.
Sep 18 12:30:46 maverick-raspberry janus[27636]: /srv/maverick/software/janus-gateway/bin/janus: error while loading shared libraries: libnice.so.10: cannot open shared object file: No such file or directory
Sep 18 12:30:46 maverick-raspberry systemd[1]: maverick-webrtc.service: Main process exited, code=exited, status=127/n/a
Sep 18 12:30:46 maverick-raspberry systemd[1]: maverick-webrtc.service: Failed with result 'exit-code'.
It does resolve them on the command line:
[dev] [mav@maverick-raspberry ~/var/build]$ ldd /srv/maverick/software/janus-gateway/bin/janus
linux-vdso.so.1 (0xbee4b000)
/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6ee1000)
libwebsockets.so.18 => /srv/maverick/software/libwebsockets/lib/libwebsockets.so.18 (0xb6e86000)
libconfig.so.9 => /lib/arm-linux-gnueabihf/libconfig.so.9 (0xb6e44000)
libnice.so.10 => /srv/maverick/software/libnice/lib/libnice.so.10 (0xb6df1000)
So rpath must not be baked into the binary correctly.
[dev] [mav@maverick-raspberry ~/var/build]$ readelf -d /srv/maverick/software/janus-gateway/bin/janus |grep runpath
0x0000001d (RUNPATH) Library runpath: [/srv/maverick/software/libwebsockets/lib]
Hmm, it is being set at compile time:
"LDFLAGS=-L/srv/maverick/software/libwebsockets/lib -lwebsockets -L/srv/maverick/software/libnice/lib -lnice -Wl,-rpath=/srv/maverick/software/libwebsockets/lib,-rpath=/srv/maverick/software/libnice/lib",
Fixed:
0x0000001d (RUNPATH) Library runpath: [/srv/maverick/software/libnice/lib:/srv/maverick/software/libwebsockets/lib]
Looks like Janus is trying to use websocket callback that doesn't exist in the version libwebsockets installed in Raspbian buster (2.0.3). lws api changes quite a bit and Janus requires fairly specific versions, so probably the easiest thing to do is compile lws separately into ~/software and use that.