Friday, September 29, 2017

lock/nolock option for NFS mount option

lock/nolock option for NFS Share

I have explored internet for detailed information on nolock NFS mount option, there are very limited details are available. I have tried to consolidate all the details in this single page as below.

This option to enable whether to use NLM sideband protocol to lock files on the server. If neither option is specified(or if lock is specified), NLM locking is used for this mount point. When using nolock option, application can lock files, but such locks provide exclusion against other applications running on the same client. Remote applications are not affected by these locks. In other words when nolock option is used. This prevents the exchange of lock information between the NFS server and this client. The server is not aware of file locks on the client, and vice versa.

The failure to maintain proper locking between a write operation on one host and a read operation on another host may reader to get incomplete or inconsistent date.

Mount option for any share can be updated without really impacting the application. However, for this option, as this is going to change the behavior of locking mechanism for a mount and at the same if the mount is being  used as an application file system(such as weblogic domain) which is usually are  actively used, its always recommended to do it with a proper downtime, means bring down the application and perform the activity.  





Sunday, January 26, 2014

Install Source RMP on Centos/Redhat

1. Prepare the build environment and get the dependencies. Do those following command under your root home directory :
2. Put the source rpm file at the root of your home directory and then run this command to rebuild the rpm under your system :
(*replace  including ‘< >’ with your package name. you can put the source package under /rpmbuild/SOURCES as well to archive it.)
3. Install the RPM :

Shell
1
2
cd /rpmbuild/RPMS
rpm -i <package-0.0-0.x86_64.rpm>

Friday, January 24, 2014

Restore file and directory permission to default vaule

As we know umask value controls which permission are set for  files and directories  when they are created.

By default root has umask value of 022 and all ordinary users has umask value of 002.

So for ordinary user file permission would be 664 and directory permission would be 775 and for root users it would be 644 and 744 respectively.

So we know the default permission of files and directories when are created which can be restored using the following commands.

find . -type d \! -user root  -print -exec chmod 775 {} \; - for all files owned by ordinary users excluding root

find . -type f \! -user root  -print -exec chmod 644 {} \; - for all directory owned by ordinary users excluding root

find . -type f  -user root  -print -exec chmod 644 {} \; - For all files owned by root

find . -type d  -user root  -print -exec chmod 744 {} \; - For all directory owned by root

If you have any user which has different umask value other than the defualt one then change the command accordingly. The above procedure is used to restore the permission only to default value.