[systemd-devel] nfs-server.service starts before _netdev iscsi mount completes (required)... how can I fix this?

Lennart Poettering lennart at poettering.net
Fri Nov 4 20:47:36 UTC 2016


On Fri, 04.11.16 11:12, ccox at endlessnow.com (ccox at endlessnow.com) wrote:

> 
> >On Thu, Nov 03, 2016 at 04:01:15PM -0700, ccox at endlessnow.com wrote:
>  >> so.... I'm using CentOS 7, and we're mounting a disk from our
> iSCSI
>  >> SAN and then we want to export that via NFS.  But on a fresh boot
> the
>  >> nfs-server service fails because the filesytem isn't there yet. 
> Any
>  >> ideas on how to fix this?
> >
> >Add RequiresMountsFor=/your/export/path to nfs-server.service
> 
> (first, apologize for the formatting using a very limted web based
> i/f)
> 
> I tried creating a nfs-server.service.d directory with a
> required-mounts.conf with that line in it and it did not work. 
> However adding the line directly to the nfs-server.service file did
> work.  Can't we add this using a nfs-server.service.d directory and
> conf file?

mkdir -p /etc/systemd/system/nfs-server.service.d/
echo "[Unit]" > /etc/systemd/system/nfs-server.service.d/50-myorder.conf
echo "RequiresMountsFor=/foo/bar/baz" >> /etc/systemd/system/nfs-server.service.d/50-myorder.conf
systemctl daemon-reload

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list