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 Sat, Aug 20 2016, J. Bruce Fields wrote:

> 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/ ?

Yes.  I suspect this was caused by the fact that my goal was for
nfs-server to stop After nfs mounts.  The concepts start to blur.
It is a bit like doing a git-bisect to find out where some bug was
fixed.  good==bad, bad==good

>
> The code's right:

I remember fixing the code....

Steve: if there are no other revisions, would you still like me to
resend to fix this, or will you just correct it when you eventually
commit it?

Thanks,
NeilBrown


>
>> +	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.

Attachment: signature.asc
Description: PGP signature


[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