From ba7c1528612acad8fcdd13576c037278b886fd6e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Dec 2026 14:14:30 +0000 Subject: [PATCH] Distro: do not install MediaMTX; disable a mediamtx service left by an older package after.php no longer installs /srv/mediamtx into /opt and the systemd unit; la_mojo serves the live view and the recording itself. If a mediamtx service exists, it is stopped and disabled (it would hold the WebRTC port). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16 --- Distro/tmp/after.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Distro/tmp/after.php b/Distro/tmp/after.php index 39ffaeb8..dda3f30a 100644 --- a/Distro/tmp/after.php +++ b/Distro/tmp/after.php @@ -12,14 +12,17 @@ $CMD = `chown -R www-data:www-data /srv/www/module/lib/controller/data/uploads`; $CMD = `chmod -R 0775 /srv/www/module/lib/controller/data/reports`; - //Setup MediaMTX - - $CMD = `systemctl stop mediamtx.service`; // just to be sure - $CMD = `rm -f -R /opt/mediamtx`; - $CMD = `mv -f /srv/mediamtx /opt`; - $CMD = `mv -f /opt/mediamtx/mediamtx.service /etc/systemd/system/mediamtx.service`; + //MediaMTX is not installed any more: la_mojo serves the live view (WebRTC) and the recording itself. + //A mediamtx service left by an older package would hold the WebRTC port: stop and disable it. + $OUT = array(); + $RC = 1; + exec( 'systemctl list-unit-files --no-legend mediamtx.service 2>/dev/null', $OUT, $RC ); + if( ( $RC == 0 && count( $OUT ) > 0 ) || file_exists( '/etc/systemd/system/mediamtx.service' ) ){ + echo "MediaMTX service found: stopping and disabling it\n"; + $CMD = `systemctl stop mediamtx.service 2>&1`; + $CMD = `systemctl disable mediamtx.service 2>&1`; + }; $CMD = `systemctl daemon-reload`; - $CMD = `systemctl enable mediamtx.service`; $CMD = `systemctl enable argus_nginx`; //Restore Settings function restore_whole_line( $A, $B , $C ){