#!/bin/bash # 修复 systemd 服务无法导入 RGA buffer 的问题 set -e cat > /etc/systemd/system/rtsp_multi_view.service << 'UNIT' [Unit] Description=RTSP Multi-View Display After=network.target [Service] Type=simple WorkingDirectory=/opt/rtsp_multi_view ExecStart=/usr/local/bin/rtsp_multi_view -c /etc/rtsp_multi_view/channels.conf Restart=always RestartSec=3 Nice=-10 SupplementaryGroups=video Environment=LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:/usr/local/lib DeviceAllow=/dev/dri rw DeviceAllow=/dev/mpp_service rw DeviceAllow=/dev/dma_heap rw [Install] WantedBy=multi-user.target UNIT systemctl daemon-reload systemctl restart rtsp_multi_view sleep 2 systemctl status rtsp_multi_view --no-pager | head -5