Skip to content
This repository

Nimbus user tools can fail when var/ and services/ are on different partitions #65

Closed
labisso opened this Issue July 05, 2011 · 0 comments

2 participants

David LaBissoniere John Bresnahan
David LaBissoniere
Collaborator

One known instance of this is in nimbus-edit-user when the gridmap file is edited. It first creates a modified copy of the gridmap in a tempfile (in $NIMBUS_HOME/var/) then deletes the existing file and uses os.rename() to move the new one in place. This fails if the source and destination are not on the same partition:

WARNING! user not found in /O=Auto/OU=FermiCloudNimbus/CN=yocum@fnal.gov
Traceback (most recent call last):
 File "/opt/nimbus/libexec/nimbus_edit_user.py", line 251, in <module>
   rc = main()
 File "/opt/nimbus/libexec/nimbus_edit_user.py", line 242, in main
   edit_user(o, db)
 File "/opt/nimbus/libexec/nimbus_edit_user.py", line 219, in edit_user
   remove_gridmap(old_dn)
 File "/opt/nimbus/libexec/nimbus_edit_user.py", line 144, in remove_gridmap
   os.rename(new_name, gmf)
OSError: [Errno 18] Invalid cross-device link

More importantly, this failure leaves the installation without a gridmap. Because there could be other failures, we should avoid deleting the gridmap and instead move the modified copy over top of it. I think shutil.move() will accomplish this (as well as allow cross-partition move).

I expect the same bug is in the other user tools as they also edit a gridmap. We should also check the group-authz file writing for this bug.

John Bresnahan buzztroll referenced this issue from a commit July 12, 2011
John Bresnahan patch for GH-65 374bb2e
John Bresnahan buzztroll closed this July 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.