
Instalé Unified Remote hoy con la esperanza de poder usarlo con mi adaptador bluetooth para controlar mi PC usando mi teléfono. Pero cuando instalé Unified Remote y cargué la interfaz web, recibí este error:
Bluetooth: no se pudo conectar a SDP
Google no tiene absolutamente nada útil sobre este error, por lo que esta es una de mis únicas oportunidades aquí.
algunas salidas:
noneatme@noneatme-desktop:/etc/bluetooth$ sudo sdptool browse local
Failed to connect to SDP server on FF:FF:FF:00:00:00: Connection refused
Ubuntu 16.04
noneatme@noneatme-desktop:/etc/bluetooth$ uname -a
Linux noneatme-desktop 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
noneatme@noneatme-desktop:/etc/bluetooth$ /usr/lib/bluetooth/bluetoothd -C
D-Bus setup failed: Connection ":1.129" is not allowed to own the service "org.bluez" due to security policies in the configuration file
(it works with sudo)
Iniciar Bluetoothd con el argumento --compat no solucionará el problema.
¿Qué puedo hacer?
/editar: Solucioné este problema iniciando el servidor remoto unificado como sudo. ¿Es esta realmente la única opción que tengo?
Respuesta1
Debe ejecutar el demonio bluetooth en modo de compatibilidad para proporcionar interfaces de línea de comandos obsoletas. Estás ejecutando Bluez5 y necesitas algunas funciones de Bluez4. Puedes hacer esto editando este archivo.
/etc/systemd/system/dbus-org.bluez.service
y cambiando esta línea
ExecStart=/usr/lib/bluetooth/bluetoothd
a esto
ExecStart=/usr/lib/bluetooth/bluetoothd --compat
y luego reiniciando bluetooth así
sudo systemctl daemon-reload
sudo systemctl restart bluetooth
y también tendrás que cambiar los permisos en/var/run/sdp
sudo chmod 777 /var/run/sdp
y finalmente reinicie el servidor remoto unificado
Respuesta2
Otra solución:
Edite /etc/systemd/system/dbus-org.bluez.service:
ExecStart=/usr/lib/bluetooth/bluetoothd --compat
ExecStartPost=/bin/chmod 777 /var/run/sdp
Porque los permisos de /var/run/sdp parecen restablecerse en cada reinicio.
Respuesta3
Logré hacerlo funcionar creando un nuevo systemd
servicio.
Cree un archivo de configuración llamado
/etc/systemd/system/urserver.service
con contenido de:[Unit] Description=Unified Remote Server After=syslog.target network.target [Service] Environment="HOME=/opt/urserver" Type=forking PIDFile=/opt/urserver/.urserver/urserver.pid ExecStartPre=/bin/chmod 777 /var/run/sdp ExecStart=/opt/urserver/urserver-start --no-manager --no-notify ExecStop=/opt/urserver/urserver-stop RemainAfterExit=no Restart=on-failure RestartSec=5s [Install] WantedBy=default.target
Establezca los permisos en el archivo:
sudo chmod a+x /etc/systemd/system/urserver.service
Recargar
systemd
demonio:sudo systemctl daemon-reload
Inicie el servicio real:
sudo systemctl start urserver
Debes desactivar "Iniciar automáticamente el servidor cuando se inicia el sistema operativo". desde Configuración remota unificada (interfaz web), porque systemd
iniciará el servicio automáticamente. systemd
También reiniciará el servicio si falla por algún motivo.
Editado: Entorno y PIDFile, gracias a Niklas
Respuesta4
Combiné las otras respuestas para que esto funcione y persista durante los reinicios. Aquí hay una guía paso a paso para que funcione:
Desmarca la casilla "Iniciar automáticamente el servidor cuando se inicia el sistema operativo". en la GUI de configuración remota unificada.
Detener nuestro servidor. Puedes hacer esto con:
user@machine:~$ sudo killall urserver
Siguiente comoleo pedrazadijo editar /etc/systemd/system/dbus-org.bluez.service y cambiar esta línea
ExecStart=/usr/lib/bluetooth/bluetoothd
a esto
ExecStart=/usr/lib/bluetooth/bluetoothd --compat
Entonces haz lo queEsa NikulainenyNiklassugirió y cree un nuevo servicio systemd así:
Cree un archivo de configuración llamado /etc/systemd/system/urserver.service con contenido de:
[Unit]
Description=Unified Remote Server
After=syslog.target network.target
[Service]
Environment="HOME=/opt/urserver"
Type=forking
PIDFile=/opt/urserver/.urserver/urserver.pid
ExecStartPre=/bin/chmod 777 /var/run/sdp
ExecStart=/opt/urserver/urserver-start --no-manager --no-notify
ExecStop=/opt/urserver/urserver-stop
RemainAfterExit=no
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=default.target
Recargar el demonio systemd:
user@machine:~$ sudo systemctl daemon-reload
Reinicie bluetooth así:
user@machine:~$ sudo systemctl restart bluetooth
Inicie el nuevo servicio:
user@machine:~$ sudo systemctl start urserver
Habilite el nuevo servicio para que se ejecute al inicio:
user@machine:~$ sudo systemctl enable urserver
GRACIASleo pedraza,Esa Nikulainen, yNiklas¡Por descubrir todas las piezas!