6
1
I'm writing a systemd's .service file for minidlnad (DLNA server) under CentOS 7. Since my media file collection is hosted on a RAID array, I need that array to be mounted BEFORE the minidlnad server is started. Both the RAID array and minidlnad should be started on boot. Is there a way to do this in systemd?
Is this enough to be sure that the raid device is also mounted (as specified in /etc/fstab) and not just assembled? – Marcello – 2015-06-22T12:09:39.863
edited to be sure that
local-fs.target
is already activated – maxxvw – 2015-06-22T12:26:39.310Apparently I don't have a mdadm.service file in /usr/lib/systemd/system, just mdadm-last-resort@.service, mdadm-grow-continue@.service and mdadm-last-resort@.timer. Should I still put the mdadm.service entry in requires and after? – Marcello – 2015-06-22T12:52:52.870
Sorry don't have a centos installed to try, but it seems that you may have a
/usr/lib/systemd/system/mdmonitor.service
which is the one you should use, i'll edit my answer – maxxvw – 2015-06-22T13:07:16.510Yes, I have mdmonitor.service and it does execute that command. Thank you very much! – Marcello – 2015-06-22T13:43:12.450
It should be noted that although this is the selected answer, this is not the preferred
– Run CMD – 2016-05-01T09:11:30.933systemd
way of achieving the objective. For an easier and more robust solution, see my answer.