University Systems --> TerpConnect --> All TerpConnect Pages --> Leftover Pine, Mozilla Lock Files -->

Leftover Pine, Mozilla Lock Files

When encountering locked files, the user has either left open a Pine session on another terminal, or is using an offline mail client (Thunderbird, Outlook Express, etc.) and is trying to read mail while the other program has control over the mail files.

If in the current Pine session the "readonly" message shows, the user needs to get out of Pine and determine if the culprit is actually another mail session or simply the lock file from a previous mail session which was not properly removed.

Note: You have to be careful when doing this; removing a lock file for an active mail session could cause mail file(s) to get corrupted, possibly losing some mail items in the process!

The first step is to determine if a lock file exists. Type

  1. cd /mail/$user and hit enter.
  2. ls -al and hit enter.

    A lock file from a Pine session begins with a dot (".") and is followed by seven characters.

            .6700300
       
    

    A lock file from an offline mail client is a longer string, usually containing the word "lock" as well as the word "imap" (part of the host name of the IMAP server which the mail connection came in through.

            mbox.lock.954921580.25647.imap0.glue.umd.edu
       

    Note: There is no leading dot (".") on this latter type of lock file.

  3. If you discover one (or more) of these types of files, the next thing to determine is whether it's from a current or old (defunct) mail session.

  4. The Previous/Last command 'ls -al' displays the date and timestamp for the files listed in the directory. If the timestamp is older than when you started your current mail session or 24 hours previous to the current time, then it is old and can be deleted.

    If the timestamp is after your current mail session then it is most likely still active. If you are not in a mail session then you should not have any lock files in the mail/username folder.

  5. If you have determined that the lock files are from an old session, then follow these steps:

    • Note: If you don't know which directory you are supposed to be in, then type cd /mail/$user
      To remove the lock files, you can use the wildcard "*". Type
      rm mbox.lock.*
    • To remove the pine lock files. Type rm .lockfile name. In this example, you can use the wildcard "*".
      rm .6*
How are we doing? Comments on this page?
Office of Information Technology
Office of Information Technology Help Desk Web Site University of Maryland Web Site Office of Information Technology Web Site