kill the tty


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting kill the tty
# 8  
Old 04-08-2004
Well what's happening there is a daggling utmp entry. How that happened depends on exactly how you logged in. In a typical scenario, telnetd is forked when someone connects via telnet. telnetd forks a login program which makes the utmp entry that you saw. The login program execs a shell. Eventually the shell exits. telnetd is the parent of that shell and notices the death of its child. So it cleans up that utmp entry and exits.

Now, consider what would happen if that telnetd instance was killed with a -9 signal. It dies immediately. It can't clean anything up.

I see you are still going straight for the -9 in your script. You might want to try the advice I gave in that first thread.

With all of this said, the telnetd instance does not normally acquire the terminal as a controlling terminal and so I would not expect this particular script to kill telnetd. And you may not be using telnet anyway. Still, somehow, the parent process of the shell is dying permaturely. And I would tend to suspect your -9 habit as the cause.

Also the contents of the utmp file is not really important. People can connect and not have a utmp entry. And, as you see, utmp can have garbage laying around. ps is the command to use to know what's happening on your system.
# 9  
Old 04-09-2004
thanks for that explanation
The users login using telnet
and i did follow your advise on using -15 instead of -9.
The problem is that when users login, the profile send's them directly to the aplication they use on the machine , and using -15 on that first script that you pointed to me, will kill the aplication processes but living them in the operating system, wich i don't want to happen. I believe this has to do with the profile, but i'll have to check that out. On this script i'm now using -15 and i will see how it goes.
thanks a lot Perderabo
# 10  
Old 04-09-2004
with this script , -15 is working fine and no longer (at least till now) left me with that kind of processes.
So, you'r right
thanks once again
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Python: Redirecting to tty and reading from tty

In bash, you can do something like this: #!/bin/bash echo -n "What is your name? " > /dev/tty read thename < /dev/tty How can I do the same in python? I have a python script that has the following content: #!/usr/bin/python2.7 import getpass import sys import telnetlib import... (2 Replies)
Discussion started by: SkySmart
2 Replies

2. Shell Programming and Scripting

Kill an specific process ID using the KILL and GREP commands

Good afternoon I need to KILL a process in a single command sentence, for example: kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'` That sentence Kills the process ID corresponding to the program CAL255.4ge. However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies

3. Solaris

Cannot kill a process with kill -9

Hello everyone, I have a process that I want to kill. I have tried kill-9 PID but it doesn't work. I have tried preap PID but it doesn't work too. The parent of my process is the process whose PID is 1, so I can't kill it. My OS is a Solaris 9. Can anyone help me understand what's going... (3 Replies)
Discussion started by: adilyos
3 Replies

4. UNIX for Advanced & Expert Users

imposible to kill a tty

Hello. We have a hp-ux 11i server , when i run who -u the output command show to me a old session as: xxx pts/t0 Feb 12 13:53 old 13040 xx.xxx.xx.xx when i try to kill with kill -9 13040 i receive this message kill: 13040: The specified process does not exist I've... (5 Replies)
Discussion started by: ct2marer
5 Replies

5. Linux

Kill a process without using kill command

I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies

6. Shell Programming and Scripting

Kill a process without using kill command

Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies

7. UNIX for Advanced & Expert Users

Diff b/n kill and kill -9

Hi, I have a process with say pid x. What is the difference b/n kill x and kill -9 x in unix Thanks Ammu (2 Replies)
Discussion started by: ammu
2 Replies

8. Programming

kill(0,-9) don't kill the process

Hi all i have simple c program , when i wish to kill the app im using kill(0,-9) , but it seams this command don't do any thing and the program. just ignore it . what im doing wrong here ? im using HP-UX ia64 Thanks (9 Replies)
Discussion started by: umen
9 Replies

9. UNIX for Dummies Questions & Answers

not able to kill find with kill -9

Hello everyone I am using HP Ux and had run a find command. Now I am trying to kill it with kill or kill -9 but it is not getting killed and still running. Any clues ? Thanks Sidhu (5 Replies)
Discussion started by: Amardeep
5 Replies

10. UNIX for Advanced & Expert Users

When kill doesnt work, how to kill a process ?

Hi All, I am unable to kill a process using kill command. I am using HP-UX system. I have tried with kill -9 and i have root privilages. How can i terminate this daemon ? ? ? Regards, Vijay Hegde (3 Replies)
Discussion started by: VijayHegde
3 Replies
Login or Register to Ask a Question