Help in killing the session !


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help in killing the session !
# 1  
Old 06-13-2008
Help in killing the session !

Hello,
I am new to unix scripts and have been experimenting with do-while structure. I have run into a problem.
my script is,
---
while true
do
./redir --lport=55083 --caddr=14.121.119.21 --cport=55083 2>&1 >> /tmp/out.txt
echo "Restarting `date`"
done
---
As you can see, i didnt handle the exit/break Smilie and ran the script!

now the "redir" keeps spawning itself and I want it to stop. I did close the window, from where i ran the script and also killed the process.
now when I do "ps -eaf" it shows me,

" dcasey 2373 1 0 06:22:13 ? 0:00 ./redir --lport=55083 --caddr=14.121.119.21 --cport=55083"

How do I stop this script? I do have sudo permission on the box..

please help..!
# 2  
Old 06-13-2008
Code:
kill -9 <process id>

In your case it would be

Code:
kill -9 2373

kill -9 is a forceful killing of the process and should be avoided.
# 3  
Old 06-13-2008
Code:
man kill

will tell you how to do it.
# 4  
Old 06-13-2008
Thanks ! "kill -9" did the job
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

Get blank screen when killing a UNIX session on HP-UX

Hi, I have this Unix script that kills a user session. When I run it, my screen goes blank. How do I prevent the blank screen? Ex: I open 2 Unix sessions. The main PID for my 1st session is 1234. In the second session I issue a "kill -HUP 1234". The first session gets killed but the second... (5 Replies)
Discussion started by: rm-r
5 Replies

2. Solaris

Difference between the desktop session and console session

what is the difference between desktop session and console session in solaris as i am wondering we use option -text for the former and -nowin for the later (1 Reply)
Discussion started by: kishanreddy
1 Replies

3. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

4. Shell Programming and Scripting

Determining if session is a login session

Besides 'who am i' and 'tty' what commands could be used to determine if a session is interactive as compared to a web process or cron process. Any command should work with the common unix variants. (3 Replies)
Discussion started by: jgt
3 Replies

5. HP-UX

ssh session getting hung (smilar to hpux telnet session is getting hung after about 15 minutes)

Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies

6. Solaris

I am not able to login in gnome session and java session in Sun solaris 9& 10

I am not able to login in gnome session and java session in Sun solaris 9& 10 respectively through xmanager as a nis user, I am able to login in common desktop , but gnome session its not allowing , when I have given login credentials, its coming back to login screen, what shoul I do to allow nis... (0 Replies)
Discussion started by: durgaprasadr13
0 Replies

7. Shell Programming and Scripting

Hiding Directories on a Session by Session basis

Hi, Apologies if anyone has read my recent post on the same subject in the Linux forum, just thought actually the solution might more likely come from scripting. Essentially, I am trying to restrict access to directories based on the user's name AND their location on a session-by-session... (3 Replies)
Discussion started by: en7smb
3 Replies

8. Shell Programming and Scripting

sqlplus session being able to see unix variables session within a script

Hi there. How do I make the DB connection see the parameter variables passed to the unix script ? The code snippet below isn't working properly. sqlplus << EOF user1@db1/pass1 BEGIN PACKAGE1.perform_updates($1,$2,$3); END; EOF Thanks in advance, Abrahao. (2 Replies)
Discussion started by: 435 Gavea
2 Replies

9. Cybersecurity

Killing Idle session

does any one know how to kill an idle session? I want to kill any idle sessions after 30 min... Local or remote.... i want to do this without a script or TCP wrappers...i want to know if there is a file that i can configure..... ThAnks:rolleyes: (4 Replies)
Discussion started by: securhack
4 Replies
Login or Register to Ask a Question