diff options
Diffstat (limited to 'community/mpd/mpd.initd')
-rw-r--r-- | community/mpd/mpd.initd | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/community/mpd/mpd.initd b/community/mpd/mpd.initd index 817583ca0ae..2ba56a9cb27 100644 --- a/community/mpd/mpd.initd +++ b/community/mpd/mpd.initd @@ -1,17 +1,20 @@ #!/sbin/openrc-run -# init.d file for music player daemon - -supervisor=supervise-daemon - name="Music Player Daemon" description="A daemon for playing music" +# M_USER and M_GROUP is for backward compatibility (Alpine <3.17) +: ${command_user:="${M_USER:-mpd}:${M_GROUP:-audio}"} + command=/usr/bin/mpd -command_args="$MPD_OPTS" +# MPD_OPTS is for backward compatibility (Alpine <3.17) +command_args="${command_args:-$MPD_OPTS}" command_args_foreground="--no-daemon" -command_user="${M_USER:-mpd}:${M_GROUP:-audio}" +# Allow mpd to configure real-time scheduling. +# See https://www.musicpd.org/doc/html/user.html#real-time-scheduling. +# (This is supported since OpenRC 0.45) +capabilities="^cap_sys_nice" depend() { need localmount @@ -21,5 +24,5 @@ depend() { start_pre() { checkpath --directory --quiet \ - --owner "${M_USER:-mpd}" --mode 0775 /var/run/mpd + --owner "${command_user%:*}" --mode 0775 /run/mpd } |