NetEndeavors

Member
Apr 29, 2002
15
0
301
Happened to me yesterday on a brand new RH 7.3 machine -- don't know why -- hope it doesn't happen again....
 

dandanfireman

Well-Known Member
PartnerNOC
May 31, 2002
117
0
316
I would think it would happen if someone vi's a very large file. I happened to intentionally vi a 500M file the other day and got very high util opening and writing the file.
 

feanor

Well-Known Member
Aug 13, 2001
836
0
316
doesn't even matter about the file size.

Vim runs away into the sunset and will run at 99.9% until it's killed..... a sentry program listening for such insanity is something you should definitely employ on a shared box. At least until they fix this, and detach the process from memory if a user is disconnected or somehow logs out without halting the lovely Vim session.

This would never have happened with the sexy as hell core VI

:p
 

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
708
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
the point is, is that this is happening on random machines... I have man redhat machines which are fine. and now it's happening to 4 of my machines (that i have noticed so far).

Somebody should submit a bug to redhat see what they say.

I have totally removed VIM and reinstalled it also with no change
 

bliz42

Member
May 7, 2002
21
0
301
random?

I have experienced this at random intervals from time to time on all my cpanel machines... never seen the problem outside of my cpanel machines.. so either my other machines don't get enough usage, or it's something cpanel specific... doubtful it's related to cpanel.. but who knows.

Anyhow, definately recommend writing a script that checks for it and kills it off.. just be careful not to kill real vi instances that users are working with that happen to be in startup mode, which can shoot the usage up to 99% for just a second.
 

xnull

Well-Known Member
Sep 9, 2001
156
0
316
This has happened to us 3-4 times in the last year, a couple of which actually took the server to its knees. Vim shouldn't do that :)
 

Curt

Well-Known Member
Oct 16, 2001
90
0
306
This happened to me today and I killed the process but I am concerned that this happens. Is there a way to disable VIM?

Thanks!
Curt
 

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
708
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
Disable VIM!!!!! Are you nutz then you'd have to use like Pico or somthing.. Ewwwwww. :p

Ya you can disable it if you like, you'll probably piss off some clients though.

if you really wanted to you could remove the packages or just can do a chmod -x /usr/bin/vim
 

NetEndeavors

Member
Apr 29, 2002
15
0
301
Cron script to take care of the issue.....

Guys / Gals,

Here's the script I've created to eliminate the problem on our servers -- I've called it killvim and put it in the /scripts directory and scheduled it as a cron job to run periodically.... Use it if you care to.....


#!/usr/bin/perl

`ps -ef | grep & vim & | grep & 1 & | grep & ? & & /tmp/vim.$$`;

open(VIMTHRDS, &&/tmp/vim.$$&);
while(&VIMTHRDS&) {
my ($x1, $x2) = split();
chomp $x2;
my ($pid, $trash) = split(/ /, $x2);
if (length(&$pid&) & 0) {
`kill -9 $pid`;
}
}
close(VIMTHRDS);

`rm -f /tmp/vim.$$`;
 

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
708
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
NetEndeavors: that's great and all but from what it looks like your killing off every vim process. I'd hate to be the one who awnsers the phone when a client who was writing a script on the server using vim calls because the process was killed.

Well this morning i decided to go the extra step and find out what the hell is happening. I'm assuming this is a bug.

I found that the problem is in /usr/bin/vim. Their are 2 ways to run vim or vi. by typeing vi or vim. vi exists in /bin/vi and vim exists in /usr/bin/vim. from what i can tell vim comes from vim-enhanced and /bin/vi comes from vim-minimal.

What i did to fix this problem? i removed all vim packages. and reinstalled only 2 of them. I'm not sure what the diffrence is between vim-minimal and vim-enhanced. I'm assuming it's just extra crap that vim has to offer. so this is what i did. i just created a symbolic link from /usr/bin/vim -& /bin/vi.

This should fix the problem.

Steps to Fix this.

1. rpm -e vim-common vim-enhanced vim-minimal
2. download the original vim-common and vim-minimal packages from redhat.
3. rpm -ivh vim-common-x.x-x.i386.rpm vim-minimal-x.x-x.i386.rpm
4. ln -s /bin/vi /usr/bin/vim

That should do it...
 

NetEndeavors

Member
Apr 29, 2002
15
0
301
Shaun,

The triple grep command should prevent attached vim processes from being killed (note the grep for both & 1 & and & ? &). Someone who knows pattern matching in perl better than I could probably rewrite this better, but if you look at the vim processes that are running and attached vs. those that are no longer attached to a session, you'll see that this does appear to work....

Comments??

But hey your approach is worth investigating -- I think we both agree that once it happens to ya', you'll be looking for a fix!!!
 

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
708
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
NetEndeavors: Ahhh i see, i glaced over the code quckly, just saw it going thru killing process's.

So far on the machine i &Patched& it seams to be working fine. No hung up VIM process's. Sombody should probably submit a redhat Bug for VIM-Enhanced... (i hate submitting bugs to redhat :) )
 

jackal

Well-Known Member
PartnerNOC
Feb 23, 2002
708
0
316
Man a post from the dead. Has anyone figured out what to do about this?

Really need some help here same thing happening to us on 2 servers.

cPanel.net Support Ticket Number:
 

jackal

Well-Known Member
PartnerNOC
Feb 23, 2002
708
0
316
Have you made the changes mentioned above?

cPanel.net Support Ticket Number: