Enabling Snapclient

Raspberry Pi related support

Enabling Snapclient

Postby ReefSmacker » 01 Nov 2018, 10:48

Hi,

I've been playing around with using snapclient on my Pi's (version 3) with snapserver running on either Ubuntu via MPD or on our main Kodi libreelec system. I'm using RuneAudio version 0.5 (build: janui-20180903)

As far as compiling snapclient and listening to synced music/tv this has been very successful.
This was achieved by connecting to the Pi via SSH and manually starting the service using systemctl start snapclient

My issue is in trying to make it usable for the Mrs :)
Trying to keep it as simple as possible, I have added an on/off button to the features section of the settings display.
In settings_ctl.php, it either tries to start or stop the service but it is failing.
The runeui log shows me the following output:
PHP message: ### sysCmd($str) ### systemctl start snapclient
PHP message: ### sysCmd() output: ### $data type = array
PHP message: ### sysCmd() output: ### ['0'] => Failed to start snapclient.service: Interactive authentication required.
PHP message: ### sysCmd() output: ### ['1'] => See system logs and 'systemctl status snapclient.service' for details.


By running systemctl status snapclient.service I get:
Apr 14 07:14:47 pergola-pi systemd[1]: Starting Snapcast client...
Apr 14 07:14:47 pergola-pi snapclient[20698]: daemon started
Apr 14 07:14:47 pergola-pi systemd[1]: Started Snapcast client.
Apr 14 07:15:22 pergola-pi snapclient[20698]: Received SIGTERM signal.
Apr 14 07:15:22 pergola-pi systemd[1]: Stopping Snapcast client...
Apr 14 07:15:27 pergola-pi snapclient[20698]: daemon terminated.
Apr 14 07:15:27 pergola-pi systemd[1]: Stopped Snapcast client.


This is not hugely helpful.
It would appear the PHP is not running as root and thus is being denied access to starting the service.

Can anybody point out how I should be starting the service ?
I have tried changing /etc/default/snapclient to run as a different user (snapclient) but that is not allowing the service to start either.
When configured to use the user snapclient, it doesn't throw an error in the log...

Cheers
Matt

PS: Not sure if this is related but i needed to update the version of glibc to 2.28 to allow snapclient to run. This does not appear to affect RuneAudio. At least not in the way i have been using it.
ReefSmacker
 
Posts: 6
Joined: 10 Oct 2017, 00:21

Re: Enabling Snapclient

Postby janui » 01 Nov 2018, 11:43

User avatar
janui
 
Posts: 714
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Enabling Snapclient

Postby ReefSmacker » 02 Nov 2018, 04:15

ReefSmacker
 
Posts: 6
Joined: 10 Oct 2017, 00:21

Re: Enabling Snapclient

Postby ReefSmacker » 02 Nov 2018, 06:32

ReefSmacker
 
Posts: 6
Joined: 10 Oct 2017, 00:21

Re: Enabling Snapclient

Postby ReefSmacker » 02 Nov 2018, 08:27

Persistence has paid off :)

I changed a couple of small things

I was using redis->hSet and redis-hGet when it should be redis->set and redis-get.
My code was originally copied from the airplay section.

I am also now using sysCmdAsync rather than sysCmd.

the service is controlling and the redis is being updated. Nice.

thanks for your help. If anybody would like a package of snapclient for the Pi 3, let me know.
ReefSmacker
 
Posts: 6
Joined: 10 Oct 2017, 00:21

Re: Enabling Snapclient

Postby janui » 02 Nov 2018, 10:16

User avatar
janui
 
Posts: 714
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Enabling Snapclient

Postby ReefSmacker » 02 Nov 2018, 21:52

Thanks Janui,

That will certainly help.
ReefSmacker
 
Posts: 6
Joined: 10 Oct 2017, 00:21

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 21 guests
cron