As I mentioned in a quick update to my old post; I got a report of DUN not auto starting reliably, if at all. I did some digging and the cause is that the /var/run/sdp socket created by bluetoothd and needed by sdptool is not present when bluetooth-dun runs.
I’ve now updated the script to wait until the socket appears before continuing. (And as upstart is asynchronous, only the DUN service is delayed by the wait).
Now, the mechanism I used for the wait is a crude ‘while-not-exist’ loop with a one second sleep. The dbus script does this so I felt it was morally acceptable. It’s crude and an inotifywait approach would be better but that utility isn’t installed by default. Finally, the delay should really be in the bluetoothd script so that it doesn’t signal readiness until it really is…
{ 2 } Comments