Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #366489
    scrawford
    Participant

    Has anyone found a way to unlock files that appear to be in use by an AFP client? This seems to happen most often with Quark files on our Panther Xserve. lsof does not appear to list files opened by clients accessing them via AFP over the network. Of course, restarting AFP is not an option. We typically have to restore the file in this scenario. I have found other posts related to this issue but no replies. Strange that this solution is so hard to come by…

    If unlocking the file is not possible, does anyone know how to identify which user last opened the file?

    Keywords: locked open files afp unlock lsof

    #366684
    ptone
    Participant

    Try this

    [code]chflags -R nouchg /path[/code]

    That will recurse for a folder, remove the -R and just give it a filepath for a single file

    #366811
    macguru42
    Participant

    We are seeing this with Word files and it is very bad. It is also littering the server with
    Word Work Files.

    We are also seeing issues with “Delete .DS_Store” -5000 0 0″ logged millions
    of times!!!

    There is something wrong with 10.4.7 AFP.

    Any temp fixed greatly received.

    #366909
    Anonymous
    Guest

    I have a similiar problem in my workplace. A user will be working on a layout in Indesign when their computer crashes. After a few minutes, AFP switches their status to disabled/asleep. However, it keeps all files they had open locked. In my workplace the main headache this leaves is the lock files (*.idlk) that Indesign creates; their existence is what keeps another a user from opening the actual Indeisgn layout file (*.indd). There are two manual interventions I know of to fix this

    1) Delete the lock file from the file server. Chflags isn’t necessary for this, as the OS has no idea that local file is locked by AFP (that is why losf doesn’t work). Sending it to the trash through the Finder or using the rm command in a terminal both work. This lets users open the file again, but it almsot certainly leaves other files locked by AFP.

    2) The better solution is to user Server Admin to disconnect from AFP the user whose computer crashed and then do #1. In my environment this is easy. If someone comes and tells me their computer crashed I can ask them what files they were working on, then disconect them and delete the appropriate lock files. If someone reports that they can’t open a file because it’s locked and we’re sure no one else has it open, I’ll check Server Admin to see what users are listed as "disabled/asleep" Since our computers are set to never sleep this status means thet they must have crashed earlier. I can then disconnect that user and delete the lock file for the unopenable file.

    It would be nice if there were a way to have AFP manage the connection of disabled/asleep users similar to the way it manages idle users. For me, this would be much more useful, since my users may legitimately be idle for many minutes and would hate to be disconnected and lose their work, but I could safely automatically disconnect users when their state switches to disabled/asleep. If I could do that, then I would be able to give my users the following script to let them unlock files on their own.

    #!/usr/bin/env python

    from Tkinter import *
    from tkMessageBox import askyesno
    from os import walk, remove
    from os.path import join

    class FileKey:

    def __init__(self, master):

    frame = Frame(master)
    frame.pack()
    self.label01 = Label(frame, text="Select file then click unlock")
    self.label01.grid(row=0, column=1, columnspan=2)

    self.scrollbar01 = Scrollbar(frame, orient=VERTICAL)
    self.listbox01 = Listbox(frame, yscrollcommand=self.scrollbar01.set, selectmode=EXTENDED)
    self.scrollbar01.config(command=self.listbox01.yview)
    self.scrollbar01.grid(row=1, column=4)
    self.listbox01.grid(row=1, column=0, columnspan=3)

    self.button01 = Button(frame, text="Reload", command=self.reload)
    self.button01.grid(row=2, column=1)

    self.button02 = Button(frame, text="Unlock", command=self.unlock)
    self.button02.grid(row=2, column=2)
    self.reload()

    def findLocks(self):
    self.allfiles = walk(‘PathToWorkflowGoesHere’)
    self.lockname = []
    self.lockpath = []
    for root, dirs, files in self.allfiles:
    for name in files:
    if name.endswith(‘idlk’):
    self.lockname.append(name)
    self.lockpath.append(root)

    def reload(self):
    self.findLocks()
    self.listbox01.delete(0, END)
    for name in self.lockname:
    self.listbox01.insert(END, name)

    def unlock(self):
    if askyesno("Warning", "Are you sure you want to try to delete this lock file?"):
    for index in self.listbox01.curselection():
    remove(join(self.lockpath[int(index)], self.lockname[int(index)]))
    self.reload()

    root = Tk()
    theKey = FileKey(root)
    if hasattr(sys, ‘frozen’):
    root.tk.call(‘console’, ‘hide’)
    root.title("FileKey")
    root.mainloop()

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Comments are closed