nfs

Is there a good way to detect a stale NFS mount

I have a procedure I want to initiate only if several tests complete successfully. One test I need is that all of my NFS mounts are alive and well. Can I do better than the brute force approach: mount | sed -n "s/^.* on \(.*\) type nfs .*$/\1/p" | while read mount_point ; do timeout 10 ls $mount_point >& /dev/null || echo "stale...

Recovering Apache from a mounted, unavailable NFS Mount

Hello - I have several web applications in production that utilize NFS mounts to share resources (usually static asset files) among web heads. In the event that an NFS mount becomes unavailable, Apache will hang requesting files that cannot be accessed, the kernel will log: Nov 2 14:21:20 server2 kernel: nfs: server server1 not resp...

Java I/O over an NFS mount

I have a bit of Java code that outputs an XML file to a NFS mounted filesystem. On another server that has the filesytem mounted as a Samba share, there is a process running that polls for new XML files every 30 seconds. If a new file is found, it is processed and then renamed as a backup file. 99% of the time, the files are written wi...

file lock leases via NFS v4 in C

does anybody know how to use the fancy file locking features of NFS v4? (described in e.g. About the NFS protocol (scroll down)). supposedly NFS v4 supports file lock leasing with a 45 second lifetime. I would like to believe that the linux kernel (I'm using gentoo 2.6.30) happily takes care of these details, and I can use fcntl() and it...

NFS or SMB on Windows Share

If I were to create a Windows shared folder, put a database file in that folder to be shared among multiple users of our client app, is that an NFS or SMB shared folder? ...

Access NFS share from Java program

I'd like to read some data from an NFS share from my Java program. I'd need the program to authenticate to the NFS server first, then do the I/O. (Requiring the NFS share to be previously mounted is not acceptable.) So, I'd like the functionality that's provided by this library: http://jcifs.samba.org/ , except for NFS instead of CIFS....

Reopening TextMate projects sourced on NFS mount

Every time I eject my NFS mount, my TextMate project(s) sourced on said mount go red. But if I reconnect, there doesn't seem to be a way to re-source them. Any ideas? ...

File r/w locking and unlink

Hello, I have following problem. I want to create a file system based session storage where each session data is stored in simple file named with session ids. I want following API: write(sid,data,timeout), read(sid,data,timeout), remove(sid) where sid==file name, Also I want to have some kind of GC that may remove all timed-out session...

When running a shell script, how can you protect it from overwriting or truncating files?

If while an application is running one of the shared libraries it uses is written to or truncated, then the application will crash. Moving the file or removing it wholesale with 'rm' will not cause a crash, because the OS (Solaris in this case but I assume this is true on Linux and other *nix as well) is smart enough to not delete the in...

NFS Client library

Hello. I'm looking for some stand alone library to access NFS shares. I am not looking for mounting the shares, just browsing and accessing the files for reading. Preferable something with a simple simple API similar to regular POSIX operations of opendir, scandir, read and etc. Thanks in advance! ...

nfs (netapp) question: how to map the device shown in sar -d to the data volume?

Using sar I can see device nfss24 is very busy, but how to know which data volume (file system) the device is for? sar -d 1 10|egrep "busy|nfs" SunOS phxdbnfs11 5.10 Generic_141414-07 sun4v 04/14/2010 19:03:27 device %busy avque r+w/s blks/s avwait avserv 19:03:28 nfs23 0 0.0 0 0 0.0...

what's "sure kill" when talking about NFS mount option?

In the following link http://www.faqs.org/docs/Linux-HOWTO/NFS-HOWTO.html It said a process is not killable except by a "sure kill", but what's sure kill? hard (NFS client mount option) The program accessing a file on a NFS mounted file system will hang when the server crashes. The process cannot be interrupted or kille...

Redirecting multiple stdouts to single file

I have a program running on multiple machines with NFS and I'd like to log all their outputs into a single file. Can I just run ./my_program >> filename on every machine or is there an issue with concurrency I should be aware of? Since I'm only appending, I don't think there would be a problem, but I'm just trying to make sure. ...

Slow Speeds when unzipping with PHP onto a NFS, how can I speed it up?

Hi, I'm trying to figure out how to boost my NFS speed and php uploads. File is uploaded to the webserver's local tmp dir With PHP I copy the file userxxx.zip to the NFS With PHP I extract the userxxx.zip on the NFS to another dir on the NFS. What I'm finding is the file is in Step 3, the file is being read through the NFS by the web...

sqlite use in tcl script over nfs (or.. how to make standalone sqlite3 which can be run over nfs)

I want to use an embed an sqlite database into an existing tcl application (migrated from flat-file). Currently; our tcl interpreter is run from a network location; <nfs share>/bin/tclsh8.3 I do have an nfs $PATH for executables set for all users already; I am assuming I can place a standalone sqlite3 executible there; though I have b...

Sharing properties file from a single location.

We have Java Enterprise applications deployed on to multiple servers. There are replicated servers running same application to load-balance(let's call them J2EE servers).Note that this is not clustered. There is a common server (let's call it props server) which hosts all properties files relevant to all applications. The folder contain...

NIS password mapping question

I have NIS server with user "techsupport", which has uid/gid = 517 I've configured NIS and NFS on that server, as well as NFS/NIS client on the remote web server. Now I need to techsupport user to be able to login to web server using techsupport username, but HAVE root privileges. I need this, so I can easily track, which support agen...

Java file delete on NFS drive

Hey guys. I am trying to delete a file on a NFS drive. I have had other problems manipulating files on remote drives such as moving a file - however i got around it by not using the conventional method i.e renameFile but instead properly using input and output streams. However using the File.delete() returns false , and I have heard s...

Check if NFS share is mounted in python script

I wrote a python script that depends on a certain NFS share to be available. If the NFS share is not mounted it will happily copy the files to the local path where it should be mounted, but fail later when it tries to copy some files back that were created on the NFS server. I'd like to catch this error specifically so I can print a us...

Java map / nio / NFS issue causing a VM fault: "a fault occurred in a recent unsafe memory access operation in compiled Java code"

I have written a parser class for a particular binary format (nfdump if anyone is interested) which uses java.nio's MappedByteBuffer to read through files of a few GB each. The binary format is just a series of headers and mostly fixed-size binary records, which are fed out to the called by calling nextRecord(), which pushes on the stat...