Subject: Re: INBOX(READONLY), How can I fix it?! (fwd)

From: Ahmad Anvari <[email-masked]>
Date: Fri, 17 Nov 2000 01:04:12 +0330 (IRT)

Hi Andy,
I have already tried:
ps fax | grep pine
no pine process belongs to me on that machine. I can
restart the server, but I guess it won't solve the problem!
Any idea?
Ahmad Anvari

On Thu, 16 Nov 2000, Andy Malato wrote:

> obviously there is another pine session that has highjacked your INBOX,
> causing it to be read only.  Make sure you issue a ps -ef and grep for pine
> and your user name.  or use ps -aux for BSD systems.  I belive that there is
> another pine session running.  You just have to find the orphan process and
> issue a HUP signal and all should be well.
> 
> let me know,
> 
> 	---Andy
> 
> > 
> > 
> > ---------- Forwarded message ----------
> > Date: Fri, 17 Nov 2000 00:32:14 +0330 (IRT)
> > From: Ahmad Anvari <[email-masked]>
> > To: [email-masked]
> > Subject: INBOX(READONLY), How can I fix it?!
> > 
> > 
> > Hi guys,
> > I have this problem with my pine, whenever I want
> > to delete a message, it says that your mailbox is
> > readonly and does not let me delete the message.
> > I guess I opened my pine last night and I was 
> > disconnected from the Inetnet accidently. So the
> > session is still open. However, I checked the
> > processes of that machine, (ps) there wasn't such
> > a process!
> > Somebody, please help! My MailBox is gonna be FULL
> > and I will be lost among e-mails!
> > Looking forward for a helping hero,
> > Ahmad Anvari <http://members.fortunecity.com/anvari>
> > 
> > 
> > -- 
> > -----------------------------------------------------------------
> >  For information about this mailing list, and its archives, see: 
> >  http://www.washington.edu/pine/pine-info/
> > -----------------------------------------------------------------
> > 
> 
> 
> 
>

---

From: Ivan Zakharyaschev <[email-masked]>
Date: Fri, 17 Nov 2000 01:39:54 +0300 (MSK)

Hi, Ahmad!

Perhaps some locks on the INBOX have not been removed. Sometimes, they are
implemented as other files somewhere in /var. Anyway, I have seen such
things only with devices. Perhaps removing the corresponding lockfile will
help. Or I'd try renaming the INBOX file to another name and back. No,
better copying - then its inode would change. That could clear the lock.

-- 
Best regards,
      Ivan Z.

---

From: Ahmad Anvari <[email-masked]>
Date: Fri, 17 Nov 2000 02:24:58 +0330 (IRT)

Hi Ivan!
I don't know about the virtual locks on the INBOX files or
virtual data structures. Could you explain more? Okay what if
I just cp /var/spool/mail /var/spool/temp
then rm /var/spool/mail
then cp /var/spool/temp /var/spool/mail
I think everybody's mail messages will be crashed!! [Permissions
problem]

---

From: Frank Zhang <[email-masked]>
Date: Thu, 16 Nov 2000 17:11:21 -0600 (CST)

When the PINE process accidently die, it may leave some file such as .lock
there. It reside at where your email file sit. For example, /var/mail/...
You may go to /var/mail, and ls -la|grep your_user_id, see if there is a
file your_user_id.lock, then delete it.

Frank Zhang
UNIX Systems Administrator
University of North Texas Health Science Center
Telephone: (817)735-2431
Email:  [email-masked]

---

From: Ahmad Anvari <[email-masked]>
Date: Fri, 17 Nov 2000 03:45:00 +0330 (IRT)

Hi Frank,
I checked there with ls -a | grep my_id
only my mail file was returned.
Actually there wasn't any .lock there!
Any other idea?! (It was the most probable answer, not worked!)
Ahmad

---

From: Ivan Zakharyaschev <[email-masked]>
Date: Fri, 17 Nov 2000 14:48:01 +0300 (MSK)

Hi, Ahmad!

Me again. Have new ideas.

I discovered that I get a similar behaviour when another started PINE gets
the lock from the first PINE process. Then even after the second one is
exited, the first PINE thinks the box is read-only. And by that moment
there are no lock files.

So, in my PINE the reason for considering the inbox read-only would be a
fault in creating the lock: no lock created - no right to modify the
inbox. Why could creating the lock fail? - Perhaps, because of a crash in
a system utility or wrong permissions on the place where the lock-file
should by created.

As far as I understand you're working on a RedHat and using PINE 4.10.
Perhaps, handling with locks has changed since 4.10. The latest version
now is 4.30, and I advice you to get the new package from RedHat. It is
build with several patches for handling locked files, but I'm not sure
whether they were applied for 4.10.

-- 
Best regards,
      Ivan Z.

---

From: Ivan Zakharyaschev <[email-masked]>
Date: Fri, 17 Nov 2000 14:31:03 +0300 (MSK)

Hello Ahmad!

> virtual data structures. Could you explain more? Okay what if

I had a look: on my system the locks created on the mailbox opened by PINE
reside in /tmp/. For example, the lock for the current session is
/tmp/.80b.1b36. Look for similar files. Basically, nothing important is
stored in /tmp/, so you can remove anything without losing important data
(but still this might cause problems in other programs).

If the place for lock-files is other than on my system, you can try to run
PINE as another user and look at the files it has opened. One of them
should be a lock-file. The files opened by a process can be examined in
the fd/ subdirectory of the process' entry in /proc/-filesystem (the place
where some kernel and process data is mounted). You'll need to know the
PID of the running PINE - I guess you already know how to find it out.

> I think everybody's mail messages will be crashed!! [Permissions

I don't suggest you to remove the whole mail directory. Only to copy
_your_ mailbox (/var/spool/mail/yourname) somewhere else (~, for example),
then remove the original file, and move the saved copy back into
/var/spool/mail/. This could clear inode-based locks on the file.

-- 
Best regards,
      Ivan Z.

---

From: Ahmad Anvari <[email-masked]>
Date: Fri, 17 Nov 2000 16:27:46 +0330 (IRT)

Hi Ivan!
Yea! This time I think the problem is going to be solved!
There is no [/tmp] on the server I'm using pine! :-) So 
where the lock file is stored?!!
Besides, how can I run the pine and see which files are
being opened? [Suppose that I'm super-user, how can I do that?]
Here's what I have in /var/filesystems
ext2
nodev proc
      iso9660
nodev devpts
      vfat

And beside cmdline, environ, exe, maps, mem, stat, statm
and status, I have three directories: root, cwd, and df!!
Last one solves all the problems!! (Also, I'm thinking about
environ, examined that carefully. You think it's the answer?)
Finally, we come to ps fax | grep pine again, finding the 
process ID and going to /proc/ID/df. Yea, found something
over there:
/dev/ttyp2
socket:[2646141]
/home/mail/anvari
Okay, here it comes, another machine with /tmp created, there
is no socket:[blahblah], there is /tmp/.3042.blah!!!
Any other idea?!!!! We're solving the mysterious problem!!!
You guys really rock!
Ahmad

---

From: "Mike A. Harris" <[email-masked]>
Date: Fri, 17 Nov 2000 10:42:37 -0500 (EST)

>where the lock file is stored?!!

Sounds like the machine is foobed.

>being opened?

By doing so from multiple consoles if you've console access, or
using the program "screen" if not, or multiple simultaneous
remote logins.

>[Suppose that I'm super-user, how can I do that?]

Same as above.

>Here's what I have in /var/filesystems

Uhhh...  Is this a Linux system?  Doesn't look like it.  I never
heard of /var/filesystems...

>and status, I have three directories: root, cwd, and df!!

No idea what any of that means.  Sounds like /proc to me.

>process ID and going to /proc/ID/df. Yea, found something

Put square brackets around one letter when grepping the output of
ps, it helps out the display of relevant info a lot, ie:

ps ax | grep "[p]ine"

The []'s guarantee that the "ps" line doesn't get captured by the
grep.

Exactly what operating system is your PINE running under, and
what version, etc..

----------------------------------------------------------------------
      Mike A. Harris  -  Linux advocate  -  Open source advocate
          This message is copyright 2000, all rights reserved.
  Views expressed are my own, not necessarily shared by my employer.
----------------------------------------------------------------------

"If it isn't source, it isn't software."  -- NASA

---

From: Ivan Zakharyaschev <[email-masked]>
Date: Fri, 17 Nov 2000 19:29:29 +0300 (MSK)

> being opened? [Suppose that I'm super-user, how can I do that?]

This is a rhethoric question, I believe. You have done that.

> Any other idea?!!!! We're solving the mysterious problem!!!

Yeah, probably that is the lock file, missing on the other machine. If you
are allowed to, try to create /tmp/ on it. My /tmp/ is created with all
permissions granted to everybody. Perhaps, there is another solution in
telling PINE/the system to locate lock-files somewhere else. Does anybody
know of such a possibility?

-- 
Regards,
      Ivan Z.

PS By the way, Ahmed, look who you are sending messages to. Several last
mesages were delivered to me in three copies (that's not bad at all), but
as far as I can see two of the copies were delivered to the list.

Ivan.

---

From: Ahmad Anvari <[email-masked]>
Date: Sat, 18 Nov 2000 14:42:56 +0330 (IRT)

Dear Ivan, Dear Everybody!
Thanks for everything! The problem with INBOX(READONLY) is
solved now! For quick conculsions, and reference for people who
may expereience this problem in future, I write these lines:

I had a Redhat Linux box in the university and I was reading my
emails when I was home through a simple dialup connection using
PINE. I got disconnected (noise on the line, it sux!), next time
I opened my PINE to read my messages, I noticed a sign at the
top of my pine screen: Folder: INBOX(READONLY)! So I couldn't
delete my emails and send them to other folders!
After careful investigations, we tried several tricks to to solve
the problems, finally, we came to this point that /tmp/ had
been deleted accidently. I went into /proc/procnumber in two 
different machines when a pine session was opened. The difference 
ws that in one of the machines, I had /tmp/.0342.blah and in 
the other one I had socket:[blahblah] under df directory.
Creating a /tmp/ solved the problem. Maybe it's a good idea that 
pine creates its own folder writable by itself, when it's being
run. I don't know if it's been implemented yet, but if any of
the people in charge reads this message, I hope he considers the
accidentally deleted /tmp/ in next versions! :-)

Thanks, everybody, I subscribed this forum some days ago and
I learned so many things here. Specially from you, Ivan. Unfortunately
I have to unsubscribe the mailing list, I will be so glad if
any of you contact my by e-mail if you have any notes on this
matter. 

Good luck, everybody,
Ahmad Anvari < http://members.fortunecity.com/anvari >