I installed mpd and mpd-runit. but there is no openrc service to start it.
How can I start mpd with openRC
Just write OpenRC script basing on runit one. You just need to put that commands in start function (without --no-daemon option) and add some depend function
Or get the script contributed here (https://forum.artixlinux.org/index.php/topic,276.0.html) and convert the systemd service.
Thank you guys.
first of I am still learning about these init script so please pardon advanced beginner questions
I found the script in a reddit post Here (https://www.reddit.com/r/linuxquestions/comments/348c0l/mpd_autostart_with_systemd/cqsf6sb)
with the systemd script
[Unit]
Description=Music Player Daemon
After=network.target sound.target
[Service]
User=mpd
ExecStart=/usr/bin/mpd --no-daemon
LimitRTPRIO=50
LimitRTTIME=-1
ControlGroup=cpu:/mpd
ControlGroupAttribute=cpu.rt_runtime_us 500000
[Install]
WantedBy=default.target
and the runit on
#!/bin/sh
MPDCONF=/etc/mpd.conf
exec mpd --stdout --no-daemon $MPDCONF
If I understand correctly it should look like.
#!/sbin/openrc-run
name=mpd
command="mpd --stdout /home/{user}/.config/mpd/mpd.conf"
or
#!/sbin/openrc-run
command=/usr/bin/mpd
pidfile=
name="mpdSysd"
description="Music Player Daemon"
is this correct and where does this file need to go? I believe it is supposed to go here
/etc/init.d
Actually, Gentoo already has its own mpd initscript (https://github.com/gentoo/gentoo/blob/master/media-sound/mpd/files/mpd-0.20.4.init), so you don't need to convert systemd/runit service files to OpenRC ones.