Problems Re-Starting mountd

Jason Keltz jas at cse.yorku.ca
Wed Jan 9 18:36:44 UTC 2013


On 01/08/2013 08:19 PM, Rick Macklem wrote:
> You could test the attached patch, which I think makes mountd
> load new export entries from a file called /etc/exports.new
> without deleting the exports already in place, when sent a
> USR1 signal.
>
> After applying the patch to mountd.c, rebuilding and replacing
> it, you would:
> - put new entries for file systems not yet exported in both
>    /etc/exports and /etc/exports.new
> # kill -USR1 <mountd's pid>
> - delete /etc/exports.new
> Don't send HUP to mountd for this case.
>
> Very lightly tested, rick
> ps: Sometimes it's faster to just code this stuff instead of
>      discussing if/how it can be done;-)
> pss: This patch isn't ready for head. If it is useful, it might
>      make sense to add a new mountd option that specifies the
>      name of the file (/etc/exports.new or ...), so that this
>      capability isn't enabled by default.
Hi Rick,

Thanks very much for looking into this.

It's a pity (at least with current mountd) that there isn't maybe a more 
generic option for adding or removing an export on the fly. This way, a 
basic shell script could look at the original exports and the new 
exports, and then come up with the options to mountd to tell it what to do.

The only "problem" I see with the patch per se is that while this would 
enable adding new exports without the additional delay, what happens 
when I delete a user and now I need to "unexport" the filesystem.   Of 
course I have to revert to processing the whole exports file again.   
Right now, I don't have to think about when deletes happen becuase on my 
existing file server, where user home directories are stored on one of a 
few filesystems, if I delete a user, I only have to remove a directory.  
I don't have to do anything with a filesystem.  However, when using one 
ZFS filesystem per user, if I delete a user, I have to delete a 
filesystem.  Now, imagine the user has been logged into various systems, 
and their home directory is automounted everywhere.  Now, I delete it on 
the fileserver, need to re-export, introduce the delay, and in addition, 
leave a bunch of machines with stale NFS mounts.  yay.    :)

Jas.



More information about the freebsd-fs mailing list