No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help
View Responses


Grex Info Item 24: Help Logging Out?
Entered by sjg on Thu Feb 18 03:40:11 UTC 1993:

A question...  many times I type Unix, because I want to read news.
That works fine...but I can never quit after I finish.  I try logout
then it says, to try quit so finally I just disconnect the modem.
how am I really supposed to do it?

100 responses total.



#1 of 100 by tsty on Thu Feb 18 06:15:46 1993:

At the login:    prompt, type     bye     and off you go, bye-bye, it's
a process.


#2 of 100 by davel on Thu Feb 18 10:59:54 1993:

At the login prompt, any of the following should userids should execute
a program to disconnect the modem: bye  exit  hangup  quit

Susan, if you're at a Unix shell prompt the exit command is    exit
You can also do a control-D from that point.


#3 of 100 by popcorn on Sun Feb 21 17:45:36 1993:

This response has been erased.



#4 of 100 by cybrspce on Wed Apr 20 08:48:22 1994:

I have been having a problem logging out at my UNIX prompt. It gives me
a not in login shell...so I end up going to menu and L. I would like for 
someone to look at it and maybe get it right...or tell me what to do..
I love learning more. ;)  tnx again!


#5 of 100 by remmers on Wed Apr 20 12:04:41 1994:

Sounds like somehow you ran a shell from some other program.  Try
typing "exit" instead of "logout", and see where it gets you.


#6 of 100 by rcurl on Wed Apr 20 13:47:12 1994:

Or,  "quit"?


#7 of 100 by kentn on Wed Apr 20 14:21:03 1994:

Find out the process number of that shell and 'kill' it. How about
Control-D?  Won't that kill a shell (I know it kills a login shell).


#8 of 100 by cybrspce on Wed Apr 20 17:15:27 1994:

Ok..the only suggestion that was made here I didnt try was ^D...maybe that will
help me.  Thanks again....Yall (southerner ya know) are the best to help ;)


#9 of 100 by omni on Wed Apr 20 19:39:51 1994:

   I had that problem, and how I solved it, was that I created a command
that would exit from the shell. I have two, actually. "a" is my logout
and "e" is my exit command.

  You have to be running .csh to get away with this, but you would need
to to  add

       alias e exit
       alias a logout

to your .cshrc file. This works very well for me.

  Since running MacLayers I usually have to invoke both of these commands
to exit, and with Zterm, only 1 is needed.

Hope that helps you.


#10 of 100 by popcorn on Wed Apr 20 23:56:00 1994:

This response has been erased.



#11 of 100 by remmers on Thu Apr 21 00:58:39 1994:

(Wheels within wheels within wheels...)


#12 of 100 by cybrspce on Thu Apr 21 02:28:02 1994:

omni yeah I amde those alises ...but popcorn was right I was in UNIX shell
but not the right one. I got online help and the problem was solved.
Thank ya both for responding. Don't know if I would make it thru these
times without everyones Grex Wisdom! ;)   err..1st line amde = made


#13 of 100 by omni on Thu Apr 21 04:49:25 1994:

 That's why I read this conference. Feel free to ask as many questions
as you need.


#14 of 100 by tsty on Thu Apr 21 21:59:58 1994:

And then there is always the tried and true .... stty 0    which
has an immediate effect.


#15 of 100 by srw on Fri Apr 22 06:02:11 1994:

Which is roughly equivalent to the power switch on your modem.


#16 of 100 by davel on Fri Apr 22 09:44:24 1994:

Not if you have an internal modem - in which case the power switch is
the power switch for your computer.  (**Why** don't they put an external
switch on internal modems?)


#17 of 100 by srw on Fri Apr 22 19:41:05 1994:

Good point, Dave. stty 0 is roughly equivalent to unplugging your phone cord.


#18 of 100 by popcorn on Sat Apr 23 11:19:59 1994:

This response has been erased.



#19 of 100 by rcurl on Sat Apr 23 21:36:51 1994:

*Another* reason why I don't have a computer with an internal modem.


#20 of 100 by tsty on Sat Apr 30 19:19:00 1994:

Good old tried and true ... it even works with a bang if necessary, !stty 0.
  
Might be rude and crude, but so's chopping fire wood with a single-bitted axe.


#21 of 100 by dam on Sat Apr 30 20:58:44 1994:

this looks like a good place to ask this - 
  since "exec stty 0" in a .logout hangs up the phone, but hangs up your
  internet link if you are on a ttypX, I was told that "stty hupcl" will
  work, as that means 'hang up on close' according to what I understand.
now, what I don't understand, is why it usually doesn't work.  I have that
in my .logout, but in only one time in 10 or so will I get hung up on.
the rest of the time Iwill end up at the login prompt. 
so, I guess I'd like to know either 1) what I'm doing wrong or 2) a simple
one-line "if" structure or something that will do an "exec stty 0" only if
I am on a dialup.


#22 of 100 by tsty on Wed May 25 19:45:26 1994:

any word here ???????


#23 of 100 by popcorn on Thu May 26 02:18:16 1994:

This response has been erased.



#24 of 100 by kentn on Thu May 26 03:51:04 1994:

Don't know.  I always lets grex hang up on me whether I'm telnetting
or dialing in.  I just "logout" and let the system do the rest (with
the exception of having to type "bye" at the login prompt when dialing
in).  I suppose you could look at a finger output and test whether
you're on an "h" tty or a "p" tty and only do an "stty 0" in the former
case.   Something along the lines of "finger -fs mylogin | awk {print $4}"
could be used to pick out the TTY field of the finger output.  You'd
use that to set a shell variable and then test if the variable had an
"h" or a "p" or "q" and proceed accordingly.  Well...just an idea.  I'll
let those shell script wizards make it workable...



#25 of 100 by remmers on Thu May 26 04:36:16 1994:

The "tty" command tells you what tty you're on.


#26 of 100 by tsty on Thu May 26 07:58:43 1994:

To simplify matters somehat, a series of    exit   commands (including
at the login: ) works well.


#27 of 100 by rcurl on Thu May 26 13:16:09 1994:

I usually disconnnect after I logout. If I use bye/exit, it confuses
my system, and it takes longer to recover. I'm told that a disconnect
at that point leaves no running processes in grex.


#28 of 100 by remmers on Thu May 26 14:07:40 1994:

That's correct -- it should be safe simply to disconnect if you're
at the login prompt.


#29 of 100 by kentn on Thu May 26 15:51:50 1994:

I guess what I liked about the finger output was that it was a bit more
concise than tty, but either could be used.  (!tty = /dev/ttyp8
!finger -fs |awk = p8)  I've been using finger -fs at UM to figure out where
I'm telnetting in from, and then am able to make certain assumptions
about my terminal and such, so that was my first thought.


#30 of 100 by dam on Mon Jun 27 01:46:26 1994:

well, before I came back to this item, this is what I had come
up with for my .logout:
echo dam logged out `date` ; if ( `expr $tty : 'ttyh' ` ) exec stty 0
 
that seems to work.  


#31 of 100 by mwarner on Sat Jul 23 04:51:52 1994:

Question.  I am logged on to 2 tty's right now.  I lost my connection
while using pine, and now that tty is dormant but logged to me.  Can I
order it to close?  Aside from tying up a grex port, Pine doesn't want me
to read/write from 2 places at once.  It gives me a "read only"
convention.  Do dormant lines get purged(of course they do, but when?)
Sometimes I see people with several logs on the fire simultaneously. 
Sorry I couldn't find the answer elsewhere, but thought I might get a
quicker answer, plus share useful info by asking. 



#32 of 100 by mwarner on Sat Jul 23 04:54:52 1994:

I'm still there after 59 minutes as a door-mat.  Hope I don't get mistaken
for a staffer! 

   Extra big :).  I don't know enough for that!


#33 of 100 by rcurl on Sat Jul 23 05:23:44 1994:

There has been discussion of reaping inactive ptty's, but no action
yet. Such "ghost" pttys don't use any bandwidth, so long as there is
no limit on their number. You can kill them yourself, though. Consult
man kill (and then, ask how ;-)).


#34 of 100 by mwarner on Sat Jul 23 05:39:21 1994:

That's what I thought, except for the weird situation with my mail, I
might not have asked, but I'm glad I did.  Thanks.


#35 of 100 by kentn on Sat Jul 23 06:45:19 1994:

Do a 'ps -x' at a Unix prompt (or '!ps -x' from a picospan prompt
to find out which processes are yours.  Chances are pretty good
that the ones that are inactive have a ? under the tty column of
the ps output.  Those are one you can 'kill'.  I'd use 'kill -9
processnumber' (substituting the process number given by ps for
"processnumber" for the processes you want to kill).  My guess is
that if you kill the login shell for that dormant tty, you'll pretty
much kill everything connected with it.  Watch that you don't kill
your current shell..
 
As an example:
 
/home/kentn> ps -x
  PID TT STAT  TIME COMMAND
  850  ? S     0:03 -tcsh (tcsh)
 1022 q7 S     0:02 -tcsh (tcsh)
 1035 q7 S     0:02 newmail -i 30
 3706 q7 R     0:00 ps -x
 
kill -9 850  would do in that abandoned shell.


#36 of 100 by mwarner on Sat Jul 23 07:25:22 1994:

Good. I can understand that even at 3:20 a.m. when my body function is
trying to "kill -9 wakeshell".  Thanks.  BTW, man kill was hard to follow
at first pass without the kind of script just provided, although I
*expect* that the protocols were laid out, just beyond my reach at the
moment without a little guidance.


#37 of 100 by rcurl on Sat Jul 23 16:12:42 1994:

I thank you also. I had a more complex instruction, which I was not
sure of enough to repeat, so hoped someone would offer a simpler one -
and kentn did! The first step I was given was  ps uxt<tty>, where
tty is the idle tty iden (e.g., ps uxtttyh3, for where I am now). The
kill command was then   kill -1 <pid>. I'd be glad to be enlightened
on the whys and wherefores of the two approaches.


#38 of 100 by kentn on Sat Jul 23 19:15:31 1994:

Your ps command asks for info on a particular tty.  I wasn't sure we
knew right off hand which tty was causing a problem, so the more
generic ps -x gives everything your loginid owns, and includes
processes without a controlling terminal (and then you have to sort out
which tty is a problem).  I sometimes use ps -ux, but that gives an
output that usually goes off the right hand side of my screen, making
it difficult to see what process is being run (long path names for the
command cause this).  The -u tells ps to put up information about %CPU
and %MEM usage, which is pretty much irrelevant to identifying the tty
you want to kill.  ps -x is a bit narrower and should give the
information needed.  kill -9 I use just to be sure the process gets
killed.  -9 means "kill it dead dead dead and then burn the evidence".
You might be able to get by with a kill command of lesser severity, but
I couldn't be sure and didn't want to beat around the bush here in cf
trying to figure out which kill command to use, especially since it
was late and I was going to log off.  Those are my reasons for giving
the commands I did; other commands would also work in most cases.
  I'll let the Unix gurus explain it in more detail (I just have a
layman's understanding which may be technically at fault...but we
got the job done anyway :)



#39 of 100 by mwarner on Sat Jul 23 21:43:13 1994:

  Reads like pretty good guru speak to me.  Thanks again.


Next 40 Responses.
Last 40 Responses and Response Form.
No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss