Re: [PATCH 1/2] systemd: improve ordering between nfs-server and various mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 19, 2016 at 11:45:56AM +1000, NeilBrown wrote:
> Commit: 1e41488f428c ("systemd: Order NFS server before client")
> 
> added an ordering dependency between network mounts and nfs-server.
> This is good for loop-back NFS mounts as it ensures the server
> will remain until after the mountpoint is unmounted.
> 
> However is is bad for _net mounts (such as those via iSCSI) which
> are being NFS exported.
> 
> nfs-server needs to be start *after* exported filesystems are mounted,
> and *before* NFS filesystems are mounted.  systemd isn't able to make
> this distinction natively, so we need to help it.
> 
> This patch adds a systemd generator which creates a drop-in for
> nfs-server.services so that it is started "After" any "nfs" or "nfs4"

s/After/Before/ ?

The code's right:

> +	fstab = setmntent("/etc/fstab", "r");
> +	while ((mnt = getmntent(fstab)) != NULL) {
> +		if (strcmp(mnt->mnt_type, "nfs") != 0 &&
> +		    strcmp(mnt->mnt_type, "nfs4") != 0)
> +			continue;
> +		fprintf(f, "Before= ");
> +		systemd_escape(f, mnt->mnt_dir);
> +		fprintf(f, ".mount\n");

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux