Repository: badaix/snapcast

Issue #863: snapclient.service refuse to start after shutdown/reboot of rpi 3b+
Created: 2021-05-01T11:07:12Z
I used command sudo shutdown now and changed wallwart from non original to orignal.
and after that snapcast client wont start.
It worked before I shutdown the rpi and have been running in a couple of month
This has happend before, and i solved it to reinstall snapclient again, but I have three client in my network
and I afraid of I have to install snapclient allover again if I shut them down.
Steps to Reproduce
1.shutdown rpi change walwart
2.
3.
Environment details

Dietpi 7.01
Snapcastclient 0.24-.0
Installed from a package,
Hardware: Rpi 3b+

Attach logfile if applicable
Here is log from systemd
# `snapclient.service - Snapcast client                                                                               │
                                                          │    Loaded: loaded (/lib/systemd/system/snapclient.service; enabled; vendor preset: enabled)                          │
                                                          │   Drop-In: /etc/systemd/system/snapclient.service.d                                                                  │
                                                          │            └─dietpi-services_edit.conf                                                                               │
                                                          │    Active: failed (Result: exit-code) since Sat 2021-05-01 12:31:09 CEST; 11min ago                                  │
                                                          │      Docs: man:snapclient(1)                                                                                         │
                                                          │   Process: 1179 ExecStart=/usr/bin/snapclient --logsink=system $SNAPCLIENT_OPTS (code=exited, status=1/FAILURE)      │
                                                          │  Main PID: 1179 (code=exited, status=1/FAILURE)                                                                      │
                                                          │                                                                                                                      │
                                                          │ May 01 12:31:09 DietPi systemd[1]: snapclient.service: Service RestartSec=100ms expired, scheduling restart.         │
                                                          │ May 01 12:31:09 DietPi systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 5.               │
                                                          │ May 01 12:31:09 DietPi systemd[1]: Stopped Snapcast client.                                                          │
                                                          │ May 01 12:31:09 DietPi systemd[1]: snapclient.service: Start request repeated too quickly.                           │
                                                          │ May 01 12:31:09 DietPi systemd[1]: snapclient.service: Failed with result 'exit-code'.                               │
                                                          │ May 01 12:31:09 DietPi systemd[1]: Failed to start Snapcast client. `

Here is info from snapclient.service.d/dietpi-services_edit.conf 

`[Unit]
#Description=Snapcast client
#Documentation=man:snapclient(1)
#Wants=avahi-daemon.service
#After=network-online.target time-sync.target sound.target avahi-daemon.service

[Service]
#EnvironmentFile=-/etc/default/snapclient
#ExecStart=/usr/bin/snapclient --logsink=system $SNAPCLIENT_OPTS
#User=snapclient
#Group=snapclient
#Restart=on-failure

[Install]
#WantedBy=multi-user.target
`

Duplicate issue #888: Snapserver fails to start on dietpi installation "Exception: failed to open file "/var/lib/snapserver/server.json", permission denied (error 13)"
Created: 2021-06-09T23:21:39Z
Snapserver fails to start automatically with systemd or dietpi-services. No problems when started manually through CLI.
Fixing the permissions manually with chmod 777 /var/lib/snapserver/server.json fixes the problem.
Steps to Reproduce

Install snapserver from installation pages
Allow process to be started on boot by either systemd or dietpi-services

Environment details

OS: DietPi v7.2.3
Snapcast version v0.25.0
Installed from package on releases page

Running "journalctl -u snapserver.service" gives:
……
Jun 10 00:05:36 DietPi systemd[1]: Started Snapcast server.
Jun 10 00:05:36 DietPi snapserver[737]: Version 0.25.0, revision 2af5292f
Jun 10 00:05:36 DietPi snapserver[737]: Adding source: pipe:///tmp/snapfifo?name=default
Jun 10 00:05:36 DietPi snapserver[737]: Settings file: "/var/lib/snapserver/server.json"
Jun 10 00:05:36 DietPi snapserver[737]: Exception: failed to open file "/var/lib/snapserver/server.json", permission denied (error 13)
Jun 10 00:05:36 DietPi snapserver[737]: Snapserver terminated.
Jun 10 00:05:36 DietPi systemd[1]: snapserver.service: Main process exited, code=exited, status=1/FAILURE
……

Closing comment (2021-06-10T06:17:14Z): Possible duplicate of #863
You can

try to manually fix the permission problems or
vote for Snapcast integration into DietPi
change the server.json location or user/group in snapserver.conf:

# General server settings #####################################################
#
[server]
# Number of additional worker threads to use
# - For values < 0 the number of threads will be 2 (on single and dual cores)
#   or 4 (for quad and more cores)
# - 0 will utilize just the processes main thread and might cause audio drops 
#   in case there are a couple of longer running tasks, such as encoding 
#   multiple audio streams
#threads = -1

# the pid file when running as daemon
#pidfile = /var/run/snapserver/pid

# the user to run as when daemonized
#user = snapserver
# the group to run as when daemonized
#group = snapserver

# directory where persistent data is stored (server.json)
# if empty, data dir will be
#  - "/var/lib/snapserver/" when running as daemon
#  - "$HOME/.config/snapserver/" when not running as daemon
#datadir = 

#
###############################################################################