projects/aports·blob master · refs

28 lines · 750 B

1#!/sbin/openrc-run
2
3name="Music Player Daemon"
4description="A daemon for playing music"
5
6# M_USER and M_GROUP is for backward compatibility (Alpine <3.17)
7: ${command_user:="${M_USER:-mpd}:${M_GROUP:-audio}"}
8
9command=/usr/bin/mpd
10# MPD_OPTS is for backward compatibility (Alpine <3.17)
11command_args="${command_args:-$MPD_OPTS}"
12command_args_foreground="--no-daemon"
13
14# Allow mpd to configure real-time scheduling.
15# See https://www.musicpd.org/doc/html/user.html#real-time-scheduling.
16# (This is supported since OpenRC 0.45)
17capabilities="^cap_sys_nice"
18
19depend() {
20 need localmount
21 use net netmount nfsmount esound pulseaudio
22 after firewall
23}
24
25start_pre() {
26 checkpath --directory --quiet \
27 --owner "${command_user%:*}" --mode 0775 /run/mpd
28}