I have a rather simple yet baffling problem involving the creation/deletion
of volumes in AFS. I've written scripts to create/delete AFS home
directories for users and ran into a problem where if I create a user home,
delete it, then immediately re-create it, everything works fine. If,
however, the directory is used after creation, the deletion will succeed but
the recreation will fail. The scripts I'm using are:
-------------------------- Creation --------------------------
#!/bin/sh
cellname=$1
server=$2
username=$3
user_id=$4
pts createuser $username -id $user_id
vos create $server /vicepa home.$username -maxquota 0
fs mkmount /afs/.$cellname/home/$username home.$username -rw
vos release home
fs setacl -dir /afs/$cellname/home/$username -acl $username all
-------------------------- Deletion --------------------------
#!/bin/sh
cellname=$1
username=$2
fs rmmount /afs/.$cellname/home/$username
vos remove -id home.$username
pts delete $username
vos release home
A quick execution of the create script, followed by a delete, followed
by a create with the same user name works fine. In fact, several cycles work
fine. However, if I actually use the newly created volume, a subsequent
recreate will fail. For example, the following procedure fails every time:
1. run afs create script for 'test_user'
2. Log in as 'test_user', run command "echo foo > /afs/
tdomain.com/home/test_user/bar", log out
3. run afs delete script for 'test_user'
4. run afs create script for 'test_user'
In step 4, all commands except for the last appear to work normally. The
final command fails with the error message "fs: File '/afs/.
tdomain.com/home/test_user' doesn't exist" and attempting to run 'ls' on the
directory as root on the AFS server machine and with proper tokens yields
"ls: cannot access /afs/tdomain.com/home/test_user: Connection timed out"
It seems like a pretty simple operation that should work every time...
whether home directory has been used or not. Can anyone spot a flaw in the
commands I'm using that might explain this?
Tom
btw, this was done on a Gentoo Linux system. kernel 2.6.24 and OpenAFS
1.4.7