lukasjapan / bt-speaker

A simple Bluetooth Speaker Daemon for the Raspberry Pi 3
GNU General Public License v3.0
495 stars 95 forks source link

install: useradd -m to create btspeaker home #68

Closed glensc closed 4 years ago

glensc commented 5 years ago

possible fix for

Oct 24 21:42:46 acai bt_speaker.py[26179]: Failed to create secure directory (/home/btspeaker/.config/pulse): No such file or directory
Oct 24 21:42:46 acai bt_speaker.py[26179]: Failed to create secure directory (/home/btspeaker/.config/pulse): No such file or directory
lukasjapan commented 4 years ago

Hmmmm, this should not be an issue on vanilla raspbian systems.

Creating an actual home directory for a system like user to fix an edge case bug seems a little bit harsh to me.

glensc commented 4 years ago

shouldn't != is not. without fix users need deep Unix knowledge to fix the underlying problem.

this is not an edge case, it's a bug report from an actual Debian system

here's reproducer:

[/tmp] ➔ docker run --rm -it debian bash
Unable to find image 'debian:latest' locally
latest: Pulling from library/debian
50e431f79093: Pull complete
Digest: sha256:a63d0b2ecbd723da612abf0a8bdb594ee78f18f691d7dc652ac305a490c9b71a
Status: Downloaded newer image for debian:latest
root@92cfd024c0be:/# useradd btspeaker
root@92cfd024c0be:/# ls -l ~btspeaker
ls: cannot access '/home/btspeaker': No such file or directory
root@92cfd024c0be:/#]
glensc commented 4 years ago

in any case, you must specify -m or -M to indicate if you want home dir to be created for new users:

lukasjapan commented 4 years ago

if you want home dir to be created

I don't want a home dir to be created for the btspeaker user.


The reason I see this as an edge case is that the error only occurs if aplay delegates to pulse audio which I advise against using together with bt-speaker. (Added to readme)

Setting up pulses bluetooth plugins and make those work seem like a better choice.

Or using pulse as it is intended to be (at least in my understanding), as the actively logged in user. E.g., finding a way to avoid the btspeaker user to fix the problem.

System users (like btspeaker) usually do not have a proper home directory but a solution I could live with is explicitly setting it to /opt/bt-speaker so maybe we should do this with -d. 🤔