Commit b8722d30 authored by Jakub Jirutka's avatar Jakub Jirutka

testing/shairport-sync: don't start with --daemon

parent b47a17bd
...@@ -12,7 +12,8 @@ makedepends="autoconf automake libtool alsa-lib-dev libdaemon-dev popt-dev ...@@ -12,7 +12,8 @@ makedepends="autoconf automake libtool alsa-lib-dev libdaemon-dev popt-dev
libressl-dev soxr-dev avahi-dev libconfig-dev" libressl-dev soxr-dev avahi-dev libconfig-dev"
subpackages="$pkgname-doc" subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mikebrady/$pkgname/archive/$pkgver.tar.gz source="$pkgname-$pkgver.tar.gz::https://github.com/mikebrady/$pkgname/archive/$pkgver.tar.gz
$pkgname.initd" $pkgname.initd
dont-check-pidfile-when-not-daemonised.patch"
builddir="$srcdir/$pkgname-$pkgver" builddir="$srcdir/$pkgname-$pkgver"
prepare() { prepare() {
...@@ -31,6 +32,7 @@ build() { ...@@ -31,6 +32,7 @@ build() {
--mandir=/usr/share/man \ --mandir=/usr/share/man \
--infodir=/usr/share/info \ --infodir=/usr/share/info \
--localstatedir=/var \ --localstatedir=/var \
--with-piddir=/run \
--with-alsa \ --with-alsa \
--with-avahi \ --with-avahi \
--with-ssl=openssl \ --with-ssl=openssl \
...@@ -46,4 +48,5 @@ package() { ...@@ -46,4 +48,5 @@ package() {
} }
sha512sums="071593cd264848209031469469d182a428ec132cb646a402eb30ae51e5d2eb78c436d6c4567d2e0583cf10788a5a5221e35cf81c95fab628d7da9bc0f3ff0328 shairport-sync-3.0.2.tar.gz sha512sums="071593cd264848209031469469d182a428ec132cb646a402eb30ae51e5d2eb78c436d6c4567d2e0583cf10788a5a5221e35cf81c95fab628d7da9bc0f3ff0328 shairport-sync-3.0.2.tar.gz
4fc22ddaa566c23b02d5cbd5cecf5374ea264e864d735170e6194e4b2c940f57515875a28e5c0886982ab32c75fa0eee0d33a0ed60438420da2478bc0d441b21 shairport-sync.initd" aeead51ef0f17d360bb1e2d2ae897974ef507ef56db84e6aeb79d8ec522c3bb9336f01ff4150e70fecfebf9808dd7190cb2839e287cf0ef6e1886504c1f1edc6 shairport-sync.initd
32a63cd86e8eb81e66c0ed39053f57ff3dfdfc3396c4a683368fb3222ad08e1c330f33b548f094e6f64ffb5129bfa1d4ce1794190651f9e6f77228a2f3336cd6 dont-check-pidfile-when-not-daemonised.patch"
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Tue, 11 Apr 2017 12:24:00 +0200
Subject: [PATCH] Don't check pidfile when not --daemon
shairport reads pidfile to check if it's not already running even when
started without -d / --daemon. Thus it cannot be properly started by
init system without enabling --daemon (that's a bad practice).
This patch fixes this behaviour.
--- a/shairport.c
+++ b/shairport.c
@@ -87,7 +87,9 @@
shairport_shutdown();
// daemon_log(LOG_NOTICE, "exit...");
daemon_retval_send(255);
- daemon_pid_file_remove();
+ if (config.daemonise) {
+ daemon_pid_file_remove();
+ }
exit(0);
}
@@ -997,7 +999,7 @@
}
/* Check that the daemon is not running twice at the same time */
- if ((pid = daemon_pid_file_is_running()) >= 0) {
+ if (config.daemonise && (pid = daemon_pid_file_is_running()) >= 0) {
daemon_log(LOG_ERR, "Daemon already running on PID file %u", pid);
return 1;
}
@@ -1257,6 +1259,8 @@
finish:
daemon_log(LOG_NOTICE, "Unexpected exit...");
daemon_retval_send(255);
- daemon_pid_file_remove();
+ if (config.daemonise) {
+ daemon_pid_file_remove();
+ }
return 1;
}
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
description="Implements a synchronous (multi-room-capable) AirPlay receiver" description="Implements a synchronous (multi-room-capable) AirPlay receiver"
command="/usr/bin/shairport-sync" command="/usr/bin/shairport-sync"
command_args="-d" command_background="yes"
pidfile="/run/$RC_SVCNAME.pid" pidfile="/run/$RC_SVCNAME.pid"
start_stop_daemon_args="
--stdout /var/log/$RC_SVCNAME.log
--stderr /var/log/$RC_SVCNAME.log"
depend() { depend() {
need net localmount avahi-daemon need net localmount avahi-daemon
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment