Open andi4000 opened 3 years ago
I would belive you don't have write permission on the /tmp/snapfifo for the user you are trying to start snapserver as Are you starting the snapserver as correct user? Try changing the permissions on /tmp/snapfifo
I would belive you don't have write permission on the /tmp/snapfifo for the user you are trying to start snapserver as Are you starting the snapserver as correct user? Try changing the permissions on /tmp/snapfifo
Interesting, changing owner of the named pipe into my username works..
As you can see on the first post, the permissions for the /tmp/snapfifo
are rw-rw-rw-
and it's owned by snapserver
user. Process also runs as snapserver
user. Despite that, even root can't pipe there. I tried chmod 777
, still permission denied.
This happens on Ubuntu (20.04 Server and Desktop). On Raspberry OS it works fine.
I'm planning to run a music player server (Mopidy or Volumio) on the same VM running snapserver. I am assuming this is a common use case for snapserver, how would you think the cleaner way to make this work? Hacky hack solution would be to chmod
the /tmp/snapfifo
persistently to music's player username.
I can reproduce it on my recently updated Mint 20 Laptop, and googled for you... :wink:
It's a security feature for fifo files in sticky directories (such as /tmp/
) as described here and in the kernel commit message
You can check if fifo protection is activated with
sudo sysctl -n fs.protected_fifos
and disable/enable it with
sudo sysctl fs.protected_fifos=0/1
I recommend to use a different (non-sticky) directory for the fifo file. So this is +1 for issue #486
It really would be better to finally move the default pipe location to /run
. It's absolutely where it belongs.
@badaix that works, thanks! Learned something new today :)
For future reader: run following commands to make this setting permanent
echo "fs.protected_fifos = 0" | sudo tee /etc/sysctl.d/snapcast-unprotect-fifo.conf
and reload sysctl with sudo service procps force-reload
or reboot. sudo sysctl fs.protected_fifos
should now output 0
@ariandyy reopened because it's not really solved, but the problem is identified
@djmattyg007 as described by @tgurr in #486 /run
seems to be the appropriate location, but needs some more systemd configuration. I'm afraid that if I change the default from /tmp
to /run
I will receive the next shitstorm from non-systemd users. Providing packages is not in the focus of this project (debian packages are built automatically, because I'm using debian based distros and thus it's convenient for me to have them).
Unfortunately there are many user reacting with thumbs up to #486, but no one is providing a patch that will solve the issue in a reliable way.
For the moment I will just reopen the issue, maybe it will help other users or someone even takes it on and provides a patch.
Usage of /run
shouldn't have any dependency on systemd. If someone's using such an old distribution that they don't have /run
, it's trivial for them to change it to /var/run
(which has been around for much longer).
If you are using systemd (which is likely the case for most people), it would be much easier if the default configuration just worked rather than requiring changes to sysctls that lessen the overall safety of the system.
The Arch package comes with a systemd-tmpfiles config file that automatically creates the folder /run/snapserver
when snapserver.service
is created:
https://aur.archlinux.org/cgit/aur.git/tree/snapcast.tmpfiles?h=snapcast
Other init systems will likely have ways of handling this automatically, or if nothing else ensuring that the folder exists as part of an init script.
I'm seeing this issue just now. Isn't this just a duplicate of #486, where we were already discussing potential new locations for the fifo?
Edit: whoops, sorry, just noticed the many references to #486 above...
Not working for me...
@Paytrix This is an old thread and you probably have already overcome this, but have in mind that you're executing that as a normal user and it's meant to be run as root... preceed your command with sudo as other users have already specified.
On Ubuntu 20.04, I got around the permission problem like so:
Create /etc/tmpfiles.d/snapserver.conf
with this line:
d /run/snapserver 0775 snapserver audio
Edit /etc/snapserver.conf
to use this dir to create its fifo:
source = pipe:///run/snapserver/snapfifo?name=default
If you are using mpd, edit /etc/mpd.conf
as well:
path "/run/snapserver/snapfifo"
Describe the bug I can't get the
snapserver
to run on my laptop or vm (Ubuntu 20.04 desktop and server). For some reason I gotPermission denied
error on piping/dev/urandom
or any wav file into the default pipe/tmp/snapfifo
even on minimal setup described below.But running snapserver on a Raspberry Pi works just fine.
Steps to Reproduce Setup server:
sudo dpkg -i snapserver_0.22.0-1_amd64.deb
sudo service snapserver start
Setup client:
sudo dpkg -i snapclient*_armhf.deb
/etc/default/snapclient
withSNAPCLIENT_OPTS="--host laptop.local"
, and restart withsudo service snapclient restart
Snapserver log on laptop (
sudo journalctl -xu snapserver -f
) shows that client connected successfullyTesting:
Both gives:
Output of
ls -lha /tmp/snapfifo
:Environment details
Possible Relevant Log Entries
There's an
Exception: end of file
the first time snapserver is started:Any clue? Did I miss anything on the setup?