Operating System - HP-UX
1833016 Members
3381 Online
110048 Solutions
New Discussion

Re: System Console Locked Help

 
SOLVED
Go to solution
Laurie A. Krumrey
Regular Advisor

System Console Locked Help

I typed this:

view /etc/fstab > fstab.out

and now my console is locked and I can't
control c out..

Help

Laurie
Happiness is a choice
11 REPLIES 11
James R. Ferguson
Acclaimed Contributor

Re: System Console Locked Help

Hi Laurie:

Simply login somewhere else (telnet, etc.) and do:

# ps -ef|grep view

Find the pid of the hung 'view' and 'kill' it.

...JRF...
Laurie A. Krumrey
Regular Advisor

Re: System Console Locked Help

I didn't mention all telnet is down.

I got in by doing a ctrl-B and going into CM
Mode, I couldn't break the vi(ew) command I did
and then a RS to reboot.

We had a disk crash and all telnet and disk
is out, I'm trying to re-create.

I hope it comes backup up..it's at another site.
Happiness is a choice
Alan Riggs
Honored Contributor
Solution

Re: System Console Locked Help

General hint:

When working on the console, especially on a system that has lost remote access, use tsm.

Tsm allows you to run multiple shells through a console interface. It is ideal for recovering from just the sort of lock up you experienced.
Jordan Bean
Honored Contributor

Re: System Console Locked Help

view? Isn't that just vi? ctrl-C won't work anyway... even though you can't see what you're doing, you still be able to enter hit ESC and enter :q! to exit vi and get back to the shell. Tell me if I'm wrong.
Laurie A. Krumrey
Regular Advisor

Re: System Console Locked Help

Well, I was using Web Console and control C
or the Escape key would not break me out of
the eternal vi mode.

I don't remember what I did to fix this, yesterday was a bad day. I think I went
into Control B and into

CM Mode (whatever that is)
and type rs

and that seemed to fix it.

If you want to lock up your telnet session
type

view filename > filename.out

You'll see what I mean...
Not pretty...
Happiness is a choice
Sorrel G. Jakins
Valued Contributor

Re: System Console Locked Help

Pardon me if I am stating the obvious, but...

I think you probably want to use
cat filename>filename.out
Jordan Bean
Honored Contributor

Re: System Console Locked Help

I personally have never used the web console, so I don't know what it expects control keys to be. I'd like to see as what the interrupt key is defined (^C or DEL or whatever) by looking at the result of stty -a.
Laurie A. Krumrey
Regular Advisor

Re: System Console Locked Help

intr=^C and eof=^D on the Web Console, but
what it doesn't work...Vi can be dangerous

and quit=^\ (which I didn't know about)

Web console you can't do a copy and paste
and you can only do a screen print.

Unix is so fun, but Web Consoles are
even more fun...Laurie
Happiness is a choice
A. Clay Stephenson
Acclaimed Contributor

Re: System Console Locked Help

Hi Laurie,

I know it's too late now - but you were not
actually in all that terrible a mess (at least initially). First your view > xxx had redirected standard output but you still had standard input. All you really had to do was ":q!" to exit view and all would have been well. In this particular case, ctrl-c (SIGINT) would have done you no good because vi traps it. By the way, don't be afraid to use ctrl-c - it almost always does no harm.

You did well in that you actually knew the command that did you in.

I would urge you to learn one lesson that few sys admins take to heart - use kill -9 as a weapon of absolute last resort. It does no cleanup and shared memory segments are left,
tmp files are left, and sometimes databases are unrecoverable.

Just food for future thought, Clay
If it ain't broke, I can fix that.
Laurie A. Krumrey
Regular Advisor

Re: System Console Locked Help

Well I forgot to mention my system had crashed
and I had no other telnet's available. I only
had the one web console with no physical console. So when I tried all my vi exit
commands

ZZ
:q!
Control C
Control D
I must have hit the escape key - twenty million
types and still I was not breaking my
connection. I tried them all several times..
(let's see insanity is trying the same thing
over and over again and excepting different
results..Yes I was there)

Web Console is not friendly..I would have loved
to do a kill -9, I use that command a lot..
but I had no other way of getting into my
box...It was just a bad day to make that kind
of error... Never do "view filename > output"
Never never never again...

Today is good..I got the server back manually..
Thanks..Laurie
Happiness is a choice
Jordan Bean
Honored Contributor

Re: System Console Locked Help

I've been able to suspend vi (aka: e, edit, ex, vedit, view) with ctrl-Z (stty susp) and terminate it with kill -HUP %1 or kill -TERM %1. (Of course, I don't use SIGKILL, and SIGINT is trapped.)