#!/usr/bin/execlineb -P
# mpd in foreground (--no-daemon), matching debian/sv/mpd.
# Config path from /etc/default/mpd (MPDCONF) or /etc/mpd.conf.

envfile -I /etc/default/mpd
importas -uD "/etc/mpd.conf" MPDCONF MPDCONF
envfile -I /etc/s6-rc/config/mpd.conf
importas -sCuD "--no-daemon --stderr" Args Args

foreground { install -m 755 -o mpd -g audio -d /run/mpd }

fdmove -c 2 1
exec /usr/bin/mpd ${Args} ${MPDCONF}
