mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-12-19 08:29:37 +00:00
This introduces yajl as a new USE flag, controlling whether the program should link against dev-libs/yajl. This is needed for two different features, hence the new REQUIRED_USE. Closes: https://bugs.gentoo.org/922980 Closes: https://bugs.gentoo.org/934927 Closes: https://bugs.gentoo.org/937264 Signed-off-by: Adrian Schollmeyer <nex+b-g-o@nexadn.de> Signed-off-by: Sam James <sam@gentoo.org>
61 lines
1.4 KiB
Text
61 lines
1.4 KiB
Text
#!/sbin/openrc-run
|
|
# Copyright 1999-2024 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
: CFGFILE=${CFGFILE:=/etc/mpd.conf}
|
|
|
|
depend() {
|
|
need localmount
|
|
use net netmount alsasound esound pulseaudio
|
|
config ${CFGFILE}
|
|
}
|
|
|
|
get_config() {
|
|
x=$1
|
|
test -e ${CFGFILE} || return 1
|
|
sed -n \
|
|
-e '/^[ \t]*'${x}'/{s:^[ \t]*'${x}'[ \t]\+"\?\([^#"]\+\)[^"]*"\?$:\1: ; p }' \
|
|
${CFGFILE}
|
|
}
|
|
|
|
extra_started_commands='reload'
|
|
# Required by io_uring
|
|
rc_ulimit="-l 65535"
|
|
command=/usr/bin/mpd
|
|
command_args=${CFGFILE}
|
|
mpd_user="$(get_config user)"
|
|
mpd_group="$(get_config group)"
|
|
required_files=${CFGFILE}
|
|
pidfile=$(get_config pid_file)
|
|
description="Music Player Daemon"
|
|
|
|
check_config() {
|
|
if [ -z "$(get_config pid_file)" ]; then
|
|
die "pid_file must be set in ${CFGFILE}!"
|
|
fi
|
|
if [ -z "$(get_config user)" ]; then
|
|
die "user must be set in ${CFGFILE}!"
|
|
fi
|
|
if [ -z "$(get_config group)" ]; then
|
|
die "group must be set in ${CFGFILE}!"
|
|
fi
|
|
}
|
|
|
|
start_pre() {
|
|
check_config
|
|
|
|
local pid_dir="$(dirname "${pidfile}")"
|
|
checkpath -d -m 700 -o "${mpd_user}:${mpd_group}" "${pid_dir}"
|
|
|
|
local log_file="$(get_config log_file)"
|
|
if [ -n "${log_file}" ] && [ "${log_file}" != "syslog" ]; then
|
|
local log_dir="$(dirname "${log_file}")"
|
|
checkpath -d -m 755 -o "${mpd_user}:${mpd_group}" "${log_dir}"
|
|
fi
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading ${RC_SVCNAME}"
|
|
start-stop-daemon --pidfile ${pidfile} --signal HUP
|
|
eend $?
|
|
}
|