Not that a retarget is a common occurence in the case we're working with but, we're in the process of some infrastructure changes and it's fresh in my mind. We have a number of Windows DFS share mounted with CIFS through FSTAB on our linux web servers. These webservers host a collection of internal applications and the DFS mounts serve documents that our applications might direct users to at some point, not all the time, (A user could go days without ever being directed to a document on the DFS Mount). We do have an application that acts a file explorer for mobile users and it does allow for 2 way interaction.
We've experimented with;
- Changing targets while the share was mounted
- opening a file from the share with a text editor on our linux server
- Looked for open files on our share, we could see windows had picked up the change by the number of windows files open on the new target and only a temp file from the linux server open on the original target.
- we then unmounted and remounted the share on the linux server and we could see then see the temp file open on the new server.
Would it be acceptable in this case to script unmounting and remounting in cron? or is there a better more accepted way?
edit: Came up with this one-liner;
# Get a list of DFS mounts and remount them in case DFS targets changed
mount -v | grep //my[.]share[.]location[.]com/root/ | awk '{print "mount -o remount " $3}' | sh
It works but I'm still not sold if it's right.