snapcast
snapcast copied to clipboard
Ownership for "/var/lib/snapclient" gets not changed by APT installer when updating from older Debian version which uses a different service user
I had the snapclient 0.26 from the Debian 12 (Bookworm) repository installed on a Raspberry PI Zero 2 W which was working fine.
After that I downloaded the latest snapclient_0.28.0-1_arm64-bullseye.deb from Github and did install it via
apt install ./snapclient_0.28.0-1_arm64-bullseye.deb
Then I noticed that the service did not start anymore, with the following errors in the log:
Jun 30 14:04:42 mmc1 snapclient[2610]: Home directory not accessible: Permission denied
Jun 30 14:04:42 mmc1 snapclient[2610]: Home directory not accessible: Permission denied
Jun 30 14:04:42 mmc1 snapclient[2610]: Version 0.28.0, revision 000ea4f3
Jun 30 14:04:42 mmc1 snapclient[2610]: Resolving host IP for: 192.168.91.13
Jun 30 14:04:42 mmc1 snapclient[2610]: Connecting to 192.168.91.13:1704
Jun 30 14:04:42 mmc1 snapclient[2610]: Connected to 192.168.91.13
Jun 30 14:04:42 mmc1 snapclient[2610]: My MAC: "2c:cf:67:2a:96:0c", socket: 9
Jun 30 14:04:42 mmc1 snapclient[2610]: ServerSettings - buffer: 1000, latency: 0, volume: 22, muted: 0
Jun 30 14:04:42 mmc1 snapclient[2610]: Codec: flac, sampleformat: 44100:16:2
Jun 30 14:04:42 mmc1 snapclient[2610]: Resampling from 44100:16:2 to 48000:16:2
Jun 30 14:04:42 mmc1 snapclient[2610]: Player name: alsa, device: equal, description: <none>, idx: 14, sharing mode: unspecified, parameters: <none>
Jun 30 14:04:42 mmc1 snapclient[2610]: Mixer mode: software, parameters: <none>
Jun 30 14:04:42 mmc1 snapclient[2610]: Sampleformat: 48000:16:0, stream: 48000:16:2
Jun 30 14:04:42 mmc1 snapclient[2610]: Using default buffer_time: 80 ms, default fragments: 4
Jun 30 14:04:42 mmc1 snapclient[2610]: Exception: Can't open equal, error: Operation not permitted, code: -1
Jun 30 14:04:42 mmc1 snapclient[2610]: Exception: Can't open equal, error: Operation not permitted
Jun 30 14:04:42 mmc1 snapclient[2610]: Snapclient terminated.
Jun 30 14:04:42 mmc1 systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE
Jun 30 14:04:42 mmc1 systemd[1]: snapclient.service: Failed with result 'exit-code'.
Jun 30 14:04:43 mmc1 systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 1.
Jun 30 14:04:43 mmc1 systemd[1]: Stopped snapclient.service - Snapcast client.
Jun 30 14:04:43 mmc1 systemd[1]: Started snapclient.service - Snapcast client.
After some investigations I found out, that directory /var/lib/snapclient
and all its files were owend by the user _snapclient
, which was used by the Debian package for some reason, but the snapclient_0.28.0-1_arm64-bullseye.deb
package uses the user snapclient
and for this reason it had no access to it.
root@mmc1:/var/lib/snapclient# ls -la
total 12
drwxr-x--- 3 _snapclient _snapclient 4096 Jun 30 14:18 .
drwxr-xr-x 47 root root 4096 Jun 28 18:26 ..
drwx------ 3 _snapclient _snapclient 4096 Jun 28 18:26 .config
I did run
chown snapclient:snapclient /var/lib/snapclient -R
to change the ownership of that directory and after that the service was able to start without problems.
I think the .deb installer should take care about that to prevent that other users run into the same problem.