forked-daapd ebuild re-animated

This commit is contained in:
Micha Glave
2015-07-23 15:58:51 +02:00
parent b415e58782
commit 47f23e7a6f
7 changed files with 148 additions and 84 deletions

View File

@@ -0,0 +1,47 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Based on mt-daapd init.d file created for gentoo
#
# You can run multiple copies of this service just symlinking them to
# forked-daapd.<name>, then it will load /etc/forked-daapd.d/<name>.conf as config
# file.
# Remember to give them different logs and cache directories.
#
# The main instance (with no <name>) uses /etc/forked-daapd.conf
# Check for OpenRC/Baselayout 2 -- see bug #230917
if [ -f /lib/librc.so -o -f /etc/init.d/sysfs -o -f /lib/rc/version ]; then
myservice=$RC_SVCNAME
fi
CONF="${myservice##*.}"
if [[ -n ${CONF} && ${myservice} != "forked-daapd" ]]; then
PIDFILE="/var/run/forked-daapd.${CONF}.pid"
CONFFILE="/etc/forked-daapd.d/${CONF}.conf"
LOGFILE="/var/log/forked-daapd.${CONF}.log"
else
PIDFILE="/var/run/forked-daapd.pid"
CONFFILE="/etc/forked-daapd.d/forked-daapd.conf"
LOGFILE="/var/log/forked-daapd.log"
fi
depend() {
need net avahi-daemon
}
start() {
ebegin "Starting forked-daapd DAAP server"
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--exec /usr/sbin/forked-daapd -- -P ${PIDFILE} -c ${CONFFILE}
eend $?
}
stop() {
ebegin "Stopping forked-daapd DAAP server"
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} --signal 2
eend $?
rm -f ${PIDFILE}
}

View File

@@ -0,0 +1,13 @@
/var/log/forked-daapd.log {
weekly
missingok
notifempty
rotate 3
create
compress
delaycompress
noolddir
postrotate
killall -q -HUP forked-daapd
endscript
}