All of lore.kernel.org
 help / color / mirror / Atom feed
* autofs changes process's current working directory
@ 2009-09-07 11:36 Antonio Messina
  2009-10-09  5:58 ` Ian Kent
  0 siblings, 1 reply; 7+ messages in thread
From: Antonio Messina @ 2009-09-07 11:36 UTC (permalink / raw)
  To: autofs


[-- Attachment #1.1: Type: text/plain, Size: 3341 bytes --]

Hi all,

I'm experiencing a problem with autofs. It seems that when a process
is inside an automounted nfs filesystem, if I restart the automount
daemon the current working directory of the process is changed and a
few leading directory are removed leading to a non-existent cwd.

I have to say, however, that the process will continue to see the
current directory: for instance, if we are running a shell, a "ls"
will gives you the correct answer, I can edit files (but vi
complains about not finding the file when saving) and the "pwd"
command returns the right directory.

In order to reproduce the problem I've wrote a very simple program:

#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>

int main(){
  /* check if the current directory is right */
  char lpath[1024];
  int res;
  getcwd(lpath, 1024);
  res = access(lpath,F_OK);
  if(0 != res)
      printf("Error! My CWD is %s but it doens't exists!\n", lpath);
  else
      printf("My CWD is %s and it exists\n", lpath);
  return res;
}


a simple session follows:

[root@pc-amessina ~]# cd /home/RAID3-D3/vmware
[root@pc-amessina vmware]# ~/cwdcheck
My CWD is /home/RAID3-D3/vmware and it exists
[root@pc-amessina vmware]# service autofs restart
Stopping autofs:                                                [  OK  ]
Starting autofs:                                                [  OK  ]
[root@pc-amessina vmware]# ~/cwdcheck
Error! My CWD is /vmware but it doens't exists!


My auto.master is:

/home /etc/auto.home  -rw,soft,intr,rsize=8192,wsize=8192,sync

my auto.home is very long but the relevant line is:

RAID3-D3 climaserv3:/RAID3/D3

(we mount a few different filesystems from the climaserv3 machine,
but they are exported separately by the server)

My system is:

[root@pc-amessina ~]# uname -a
Linux pc-amessina.ictp.it 2.6.24.7-desktop-2mnb #1 SMP Thu Oct 30
18:03:14 EDT 2008 i686 Intel(R) Core(TM)2 Duo CPU     E8400  @
3.00GHz GNU/Linux

[root@pc-amessina ~]# cat /etc/redhat-release
Mandriva Linux release 2008.1 (Official) for i586

[root@pc-amessina ~]# rpm -q autofs
autofs-5.0.4-7mdv2008.1


Logs from automount follows:

Sep  3 12:55:33 localhost automount[11856]: Starting automounter
version 5.0.4, master map auto.master
Sep  3 12:55:33 localhost automount[11856]: using kernel protocol
version 5.00
Sep  3 12:55:33 localhost automount[11856]: mounted indirect on
/home with timeout 900, freq 225 seconds
Sep  3 12:55:53 localhost automount[11856]: attempting to mount
entry /home/RAID3-D3
Sep  3 12:55:53 localhost automount[11856]: mount(nfs): mounted
climaserv3:/RAID3/D3 on /home/RAID3-D3
Sep  3 12:55:53 localhost automount[11856]: mounted /home/RAID3-D3
Sep  3 12:55:59 localhost automount[11856]: 1 remaining in /home
Sep  3 12:55:59 localhost automount[11856]: filesystem /home still busy
Sep  3 12:56:04 localhost automount[11915]: Starting automounter
version 5.0.4, master map auto.master
Sep  3 12:56:04 localhost automount[11915]: using kernel protocol
version 5.00
Sep  3 12:56:04 localhost automount[11915]: mounted indirect on
/home with timeout 900, freq 225 seconds
Sep  3 12:56:09 localhost automount[11915]: attempting to mount
entry /home/RAID3-D3
Sep  3 12:56:09 localhost automount[11915]: mount(nfs): mounted
climaserv3:/RAID3/D3 on /home/RAID3-D3
Sep  3 12:56:09 localhost automount[11915]: mounted /home/RAID3-D3

[-- Attachment #1.2: Type: text/html, Size: 3784 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-12-15  1:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-07 11:36 autofs changes process's current working directory Antonio Messina
2009-10-09  5:58 ` Ian Kent
2009-12-14 17:28   ` Leonardo Chiquitto
2009-12-14 18:14     ` Ian Kent
2009-12-14 19:22       ` Leonardo Chiquitto
2009-12-14 22:07       ` michael
2009-12-15  1:18         ` Ian Kent

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.