summaryrefslogtreecommitdiffstats
path: root/systemd
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-06-17 11:26:45 +0200
committerGravatar Tom Willemse2015-06-17 11:26:45 +0200
commite9f4e1297af6916fd338196d5083433b8c1d6247 (patch)
tree667952fbfdda55b424c073a4d953c2adf8fb4862 /systemd
parent472fc43adb3846aef1089ae31dccdbe5fe216af3 (diff)
downloaddotfiles-e9f4e1297af6916fd338196d5083433b8c1d6247.tar.gz
dotfiles-e9f4e1297af6916fd338196d5083433b8c1d6247.zip
Add MPD service file
Diffstat (limited to 'systemd')
-rw-r--r--systemd/.config/systemd/user/mpd.service24
1 files changed, 24 insertions, 0 deletions
diff --git a/systemd/.config/systemd/user/mpd.service b/systemd/.config/systemd/user/mpd.service
new file mode 100644
index 0000000..947f2fb
--- /dev/null
+++ b/systemd/.config/systemd/user/mpd.service
@@ -0,0 +1,24 @@
+[Unit]
+Description=Music Player Daemon
+After=network.target sound.target
+
+[Service]
+ExecStart=/usr/bin/mpd --no-daemon
+ExecStartPre=/usr/bin/mount /mnt/music
+ExecStopPost=/usr/bin/umount /mnt/music
+
+# allow MPD to use real-time priority 50
+LimitRTPRIO=50
+LimitRTTIME=-1
+
+# move MPD to a top-level cgroup, as real-time budget assignment fails
+# in cgroup /system/mpd.service, because /system has a zero real-time
+# budget; see
+# http://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime/
+ControlGroup=cpu:/mpd
+
+# assign a real-time budget
+ControlGroupAttribute=cpu.rt_runtime_us 500000
+
+[Install]
+WantedBy=default.target