Você não deve precisar reiniciar o NFS toda vez que fizer uma alteração em /etc/exports
. Tudo o que é necessário é emitir o comando apropriado depois de editar o arquivo /etc/exports
:
$ exportfs -ra
Trecho da documentação oficial da Red Hat intitulada: 21.7. O arquivo de configuração / etc / exports .
trecho
When issued manually, the /usr/sbin/exportfs command allows the root user to selectively export or unexport directories without restarting the NFS service. When given the proper options, the /usr/sbin/exportfs command writes the exported file systems to /var/lib/nfs/xtab. Since rpc.mountd refers to the xtab file when deciding access privileges to a file system, changes to the list of exported file systems take effect immediately.
Leia também a página exportfs
man para mais detalhes, especificamente a seção "DESCRIPTION" que explica tudo isso e muito mais.
DESCRIPTION An NFS server maintains a table of local physical file systems that are accessible to NFS clients. Each file system in this table is referred to as an exported file system, or export, for short.
The exportfs command maintains the current table of exports for the NFS server. The master export table is kept in a file named /var/lib/nfs/etab. This file is read by rpc.mountd when a client sends an NFS MOUNT request. Normally the master export table is initialized with the contents of /etc/exports and files under /etc/exports.d by invoking exportfs -a. However, a system administrator can choose to add or delete exports without modifying /etc/exports or files under /etc/exports.d by using the exportfs command.
Também tome nota das opções que estamos usando, -ra
:
-a Export or unexport all directories.
-r Reexport all directories, synchronizing /var/lib/nfs/etab with
/etc/exports and files under /etc/exports.d. This option
removes entries in /var/lib/nfs/etab which have been deleted
from /etc/exports or files under /etc/exports.d, and removes
any entries from the kernel export table which are no longer
valid.