snapcast icon indicating copy to clipboard operation
snapcast copied to clipboard

[Fedora] install failed, bad postinst command

Open marcpaulchand opened this issue 2 years ago • 4 comments

Describe the bug When i install snapserver or snapclient it fails. In fact some options aren't the same between debian and Fedora.

Steps to Reproduce

  1. git clone
  2. make
  3. sudo make installserver

Environment details

  • OS: Fedora 35
  • Snapcast version 0.25.0
  • self compiled, ...

Attach logfile if applicable

➜ snapcast (master) ✔ sudo make installserver
make install -C server
make[1]: Entering directory '/home/paul/logiciels/snapcast/server'
make adduser
make[2]: Entering directory '/home/paul/logiciels/snapcast/server'
sh ../debian/snapserver.postinst configure
adduser: unrecognized option '--quiet'

In a second point : At first time, snapclient daemon launched with alsa output fails like this :

2021-12-16 20-16-27.097 [Info] (Alsa) Using default buffer_time: 80 ms, default fragments: 4
ALSA lib conf.c:4096:(config_file_open) cannot access file /etc/alsa/conf.d/50-pipewire.conf
ALSA lib conf.c:4016:(snd_config_hooks_call) function snd_config_hook_load returned error: Permission denied
ALSA lib conf.c:4623:(snd_config_update_r) hooks failed, removing configuration
2021-12-16 20-16-27.098 [Error] (Alsa) Exception: Can't open default, error: Permission denied, code: -13
2021-12-16 20-16-27.099 [Fatal] (Snapclient) Exception: Can't open default, error: Permission denied
2021-12-16 20-16-27.099 [Notice] (Snapclient) Snapclient terminated.

I'm trying to find a workaround, i'll edit this post laster or create a new issue.

Fix:

debian/snapclient.postinst
-    adduser --system --quiet --group --home $HOMEDIR --no-create-home --force-badname $USERNAME
+    adduser --system --user-group --home $HOMEDIR --no-create-home --badname $USERNAME

debian/snapserver.postinst
-    adduser --system --quiet --group --home $HOMEDIR --no-create-home --force-badname $USERNAME
+    adduser --system --user-group --home $HOMEDIR --no-create-home --badname $USERNAME
-  adduser --quiet $USERNAME audio > /dev/null || true
+  usermod -aG pipewire $USERNAME > /dev/null || true

marcpaulchand avatar Dec 16 '21 19:12 marcpaulchand

Hi, honestly, I want to remove the Makefiles and switch completely to cmake. The only reason for existence of the makefiles is the lack for a proper make install target in the cmake build. The install target is there, but it will only copy files and will not install users or systemd or initd related files, because this is target OS specific. The only clean solution is to use packages. I've just moved the debian build scripts into the Snapos project, this would also be the place for RPM build scripts, any help is appreciated. I found some old PRM spec here: https://github.com/karafior/snapcast/blob/fedora/packaging/rpm/f27/snapcast.spec. This could be a good starting point.

Long story short: Regarding your bug, I'm planning to remove the Makefiles.

badaix avatar Dec 28 '21 11:12 badaix

Experimental Fedrora builds can be found in Snapos

badaix avatar Jan 13 '22 22:01 badaix

The artifacts from the build (the rpms themselves) have expired. I'm giving it a shot at trying to reproduce the rpmbuild method locally.

axelsimon avatar May 17 '22 22:05 axelsimon

did that work?

SteveGremory avatar May 25 '22 06:05 SteveGremory