System Administration Guide, Volume 3

How to Enable NFS Server Logging

  1. Become superuser.

  2. Optional: Change file system configuration settings.

    In /etc/nfs/nfslog.conf, you can either edit the default settings for all file systems by changing the data associated with the global tag or you can add a new tag for this file system. If these changes are not needed you do not need to change this file. The format of /etc/nfs/nfslog.conf is described in nfslog.conf(1).

  3. Add entries for each file system to be shared using NFS server logging.

    Edit /etc/dfs/dfstab and add one entry to the file for the file system that you want to have NFS server logging enabled on. The tag used with the log=tag option must be entered in /etc/nfs/nfslog.conf. This example uses the default settings in the global tag.


    share -F nfs -o ro,log=global /export/ftp

    See the share_nfs(1M) man page for a complete list of options.

  4. Check that the NFS service is running on the server.

    If this is the first share command or set of share commands that you have initiated, it is likely that the NFS daemons are not running. The following commands kill and restart the daemons.


    # /etc/init.d/nfs.server stop
    # /etc/init.d/nfs.server start
    
  5. Share the file system.

    After the entry is in /etc/dfs/dfstab, the file system can be shared by either rebooting the system or by using the shareall command. If the NFS daemons were restarted earlier, this command does not need to be run because the script runs the command.


    # shareall
    
  6. Verify that the information is correct.

    Run the share command to check that the correct options are listed:


    # share
    -        /export/share/man   ro   ""
    -        /usr/src     rw=eng   ""
    -        /export/ftp    ro,log=global  ""
  7. Start the NFS log daemon, nfslogd, if it is not running already.

    Restarting the NFS daemons using the nfs.server script will start the daemon if the nfslog.conf file exists. Otherwise the command needs to be run once by hand to create the files so that the command will automatically restart when the server is rebooted.


    # /usr/lib/nfs/nfslogd