Thursday, March 19, 2015

Solaris 10/11: How to enable/disable automount debugging

If you are having problems with an automounter directory, you should always try and mount the partition by hand, to verify that the problem is related to automounter, and not NFS in general. If this manual mount operation fails then the problems is with NFS. But if this mount works fine, the problem is with automounter.
Automounter also has built in debugging, which can be used to examine exactly what the automounter is doing. It is best to kill automount and restart it with the debug flags, so that you can see everything from the start. Below procedure can be used to enable or disable automount debugging.

Solaris 10 
Enable Solaris 10 automount debug output
1. Uncomment the following lines in the /etc/default/autofs file:
# Verbose mode.  Notifies of autofs mounts, unmounts, or other
# non-essential events.  This equivalent to the "-v" argument.
AUTOMOUNT_VERBOSE=TRUE
# Verbose.  Log status messagess to the console.
# This is equivalent to the "-v" argument.
AUTOMOUNTD_VERBOSE=TRUE
# Trace.  Expand each RPC call and display it on standard output.
# This is equivalent to the "-T" argument.
AUTOMOUNTD_TRACE=3

DISABLE Solaris 10 automount debug output

2. Revert /etc/default/autofs entries back to default to shut off logging:
#AUTOMOUNT_VERBOSE=FALSE
#AUTOMOUNTD_VERBOSE=FALSE
#AUTOMOUNTD_TRACE=0

Refer the file /etc/default/autofs


Solaris 11
Enable Solaris 11 automount debug output 
1.  Alter the autofs debugging properties with sharectl:
root@my-nfs-server# sharectl get autofs
timeout=600
automount_verbose=false
automountd_verbose=false
nobrowse=false
trace=0
environment=


root@my-nfs-server# sharectl set -p automount_verbose=true autofs
root@my-nfs-server# sharectl set -p automountd_verbose=true autofs
root@my-nfs-server# sharectl set -p trace=3 autofs
root@my-nfs-server# sharectl get autofs
timeout=600
automount_verbose=true
automountd_verbose=true
nobrowse=false
trace=3
environment=
  
2. Tail the autofs log: 
root@my-nfs-server# tail -f /var/svc/log/system-filesystem-autofs:default.log
[ Jan 23 09:48:36 Stopping because service restarting. ]
[ Jan 23 09:48:36 Executing stop method ("/lib/svc/method/svc-autofs stop 76″) ]
[ Jan 23 09:48:42 Method "stop" exited with status 0 ]
[ Jan 23 09:48:42 Executing start method ("/lib/svc/method/svc-autofs start") ]
[ Jan 23 09:48:42 Method "start" exited with status 0 ]
[ Jan 23 09:49:48 Stopping because service restarting. ]
[ Jan 23 09:49:48 Executing stop method ("/lib/svc/method/svc-autofs stop 8276539″) ]
[ Jan 23 09:49:53 Method "stop" exited with status 0 ]
[ Jan 23 09:49:53 Executing start method ("/lib/svc/method/svc-autofs start") ]
[ Jan 23 09:49:53 Method "start" exited with status 0 ]

3. Restart the autofs service:

# svcadm restart autofs

4. Examine output from the tail -f command to ensure the logging is now enabled:
[ Jan 23 09:56:18 Stopping because service restarting. ]
[ Jan 23 09:56:18 Executing stop method ("/lib/svc/method/svc-autofs stop 8276563″) ]
[ Jan 23 09:56:23 Method "stop" exited with status 0 ]
[ Jan 23 09:56:23 Executing start method ("/lib/svc/method/svc-autofs start") ]
t1      init_ldap: setting up for version 2
automount: /net mounted
automount: /home mounted
automount: no unmounts
[ Jan 23 09:56:23 Method "start" exited with status 0 ]

Reproduce or await the automount activity that triggers the failure, as appropriate.  Attach or provide the /var/svc/log/system-filesystem-autofs:default.log.

DISABLE Solaris 11 automount debug output
1. Restore the original values to the autofs debug properties:
root@my-nfs-server# sharectl set -p automount_verbose=false autofs
root@my-nfs-server# sharectl set -p automountd_verbose=false autofs
root@my-nfs-server# sharectl set -p trace=0 autofs
root@my-nfs-server# sharectl get autofs
timeout=600
automount_verbose=false
automountd_verbose=false
nobrowse=false
trace=0
environment=

2. Restart autofs service:
# svcadm restart autofs

No comments:

Post a Comment