Shairport-sync: Can not start shairport-sync as service

Created on 26 Oct 2019  ·  14Comments  ·  Source: mikebrady/shairport-sync

On a fresh Raspbian installation (Raspbian GNU/Linux 10 (buster)), I can not start shairport-sync as a service. Direct start works.

service shairport-sync restart
Job for shairport-sync.service failed because a fatal signal was delivered to the control process. See "systemctl status shairport-sync.service" and "journalctl -xe" for details.

-- The job identifier is 4267 and the job result is done.
Okt 26 16:31:12 rapi-sound02 systemd[1]: Starting ShairportSync AirTunes receiver...
-- Subject: A start job for unit shairport-sync.service has begun execution
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- A start job for unit shairport-sync.service has begun execution.

-- The job identifier is 4267.
Okt 26 16:31:12 rapi-sound02 shairport-sync[3783]: free(): double free detected in tcache 2
Okt 26 16:31:12 rapi-sound02 systemd[1]: shairport-sync.service: Control process exited, code=killed, status=6/ABRT
-- Subject: Unit process exited
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- An ExecStart= process belonging to unit shairport-sync.service has exited.

-- The process' exit code is 'killed' and its exit status is 6.
Okt 26 16:31:12 rapi-sound02 systemd[1]: shairport-sync.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- The unit shairport-sync.service has entered the 'failed' state with result 'signal'.
Okt 26 16:31:12 rapi-sound02 systemd[1]: Failed to start ShairportSync AirTunes receiver.
-- Subject: A start job for unit shairport-sync.service has failed
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- A start job for unit shairport-sync.service has finished with a failure.

-- The job identifier is 4267 and the job result is failed.
Okt 26 16:31:12 rapi-sound02 systemd[1]: shairport-sync.service: Service RestartSec=100ms expired, scheduling restart.
Okt 26 16:31:12 rapi-sound02 systemd[1]: shairport-sync.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- Automatic restarting of the unit shairport-sync.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Okt 26 16:31:12 rapi-sound02 systemd[1]: Stopped ShairportSync AirTunes receiver.
-- Subject: A stop job for unit shairport-sync.service has finished
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- A stop job for unit shairport-sync.service has finished.

-- The job identifier is 4326 and the job result is done.
Okt 26 16:31:12 rapi-sound02 systemd[1]: shairport-sync.service: Start request repeated too quickly.
Okt 26 16:31:12 rapi-sound02 systemd[1]: shairport-sync.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- The unit shairport-sync.service has entered the 'failed' state with result 'signal'.
Okt 26 16:31:12 rapi-sound02 systemd[1]: Failed to start ShairportSync AirTunes receiver.
-- Subject: A start job for unit shairport-sync.service has failed
-- Defined-By: systemd

-- Support: https://www.debian.org/support

-- A start job for unit shairport-sync.service has finished with a failure.

-- The job identifier is 4326 and the job result is failed.

bug fixed

Most helpful comment

I've fixed this by changing the type from forking to simple and removing -d from the ExecStart in the /lib/systemd/system/shairport-sync.service:

[Unit]
Description=ShairportSync AirTunes receiver
Documentation=man:shairport-sync(7)
Documentation=file:///usr/share/doc/shairport-sync/README.md.gz
Documentation=https://github.com/mikebrady/shairport-sync
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service

[Service]
Type=simple
Restart=on-failure
EnvironmentFile=-/etc/default/shairport-sync
ExecStart=/usr/bin/shairport-sync $DAEMON_ARGS
User=shairport-sync
Group=shairport-sync
PIDFile=/run/shairport-sync/shairport-sync.pid

[Install]
WantedBy=multi-user.target

After sudo systemctl daemon-reload a sudo systemctl start shairport-sync.service works as expected

All 14 comments

Thanks for the post. Can you post the result of entering

$ shairport-sync -V

please? (That’s an uppercase “V”.)

Sure... here ist the output of $ shairport-sync -V
3.2.2-OpenSSL-Avahi-ALSA-pa-dummy-stdout-pipe-soxr-convolution-metadata-sysconfdir:/etc

Thanks. Unfortunately, this is due to an error in Shairport Sync that only came to light when that particular style of startup was selected. It has been fixed in subsequent versions of Shairport Sync, but has not yet made its way to the repository.

The most satisfactory way to deal with the problem, IMHO, is to build and install the latest release from source, using this guide. You should pay particular attention to removing existing installations and existing startup scripts. There is no need to remove the configuration file at /etc/shairport-sync.conf. Apologies for the inconvenience.

I'd like to stay in the apt-get upgrade path of RASPBIAN. So, I will start shairport-sync directly using /etc/rc.local in the meanwhile, as a workaround and go back to system service when your fix is in the repository.
Thanks for your answer and your great work, Mike!

Okay, thanks.

Can you please tell me the release version in which the defect is fixed?
Thx

It was fixed in 3.3.5, which is the current release. It is also is now in Debian backports, thanks to the work of Chris Boot.

I can confirm that with version shairport-sync 3.3.5-1~bpo10+1 from debian buster-backports, this issue is fixed. I can start shairport-sync as a service now. Defect can be closed from my side.
Thanks for your work!

Great, thanks.

sudo systemctl restart shairport-sync
Job for shairport-sync.service failed because a fatal signal was delivered to the control process.
See "systemctl status shairport-sync.service" and "journalctl -xe" for details.

shairport-sync -V
3.3.5-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc

still the same problem...
installed as in: https://github.com/mikebrady/shairport-sync/blob/master/INSTALL.md

Thanks for the post. AFAIK the problem referred to the the OP has been fixed in 3.3.5. However, there may be some other problem with your installation, e.g. an incorrect setting somewhere, and it would be a good idea to do some troubleshooting. So, if you could, from the command line, enter:

$ shairport-sync -vu

and post the results here, it would be a good start.

I've fixed this by changing the type from forking to simple and removing -d from the ExecStart in the /lib/systemd/system/shairport-sync.service:

[Unit]
Description=ShairportSync AirTunes receiver
Documentation=man:shairport-sync(7)
Documentation=file:///usr/share/doc/shairport-sync/README.md.gz
Documentation=https://github.com/mikebrady/shairport-sync
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service

[Service]
Type=simple
Restart=on-failure
EnvironmentFile=-/etc/default/shairport-sync
ExecStart=/usr/bin/shairport-sync $DAEMON_ARGS
User=shairport-sync
Group=shairport-sync
PIDFile=/run/shairport-sync/shairport-sync.pid

[Install]
WantedBy=multi-user.target

After sudo systemctl daemon-reload a sudo systemctl start shairport-sync.service works as expected

Works like a charm, thanks for this workaround!

Danke.

To add buster-backports to Raspbian:

  1. Add this line to /etc/apt/sources.list
deb http://deb.debian.org/debian/ buster-backports main
  1. gpg --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
  2. gpg --armor --export 04EE7237B7D453EC | apt-key add -
  3. gpg --armor --export 648ACFD622F3D138 | apt-key add -
  4. apt-get update
  5. apt-get install shairport-sync/buster-backports

And you're done!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corentoulf picture corentoulf  ·  7Comments

ContraVarus picture ContraVarus  ·  7Comments

mc002b picture mc002b  ·  7Comments

purefan picture purefan  ·  5Comments

rockrabbit picture rockrabbit  ·  6Comments