Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I kill a UNIX program??? 1

Status
Not open for further replies.

qednick

Programmer
Jul 26, 2002
516
US
Ok this is going to sound stupid... I created a simple socket server based on a PDF guide I found on the net called "Beej’s Guide to Network Programming". I uploaded it to my unix based web server, compiled it into 'socket.out' and set if off using:

./socket.out&

command as per some instructions in my earlier post. I then tried to connect to it using my web server's address and the pre-determined port number. Needless to say, it didn't work!

However, that's not so much the problem.... now, I can't get the dang thing to die!! If I try to delete the file using ftp I just get a "file or process busy" error message. I also tried messing around with the "kill" command in telnet but couldn't figure it out.

Can anyone tell me how to shoot this blighter in the head, delete it so I can try again?

PS: I've successfully got a perl script to accept and reply to incoming socket connections. Basically, I'm trying to do the same thing with C/C++ on unix.

[cry]
tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
Well, since you invoked it with the terminal ampersand, the app is running in the background of your console.

Issue "fg". Then it "ctrl-c".


If that doesn't do it, try issuing:

ps -aux | grep socket

This will return a list of processes having the string "socket" in them and their process numbers. From that list you can find the process number of your app.

Then issue &quot;kill -9 <process number>&quot; ______________________________________________________________________
TANSTAAFL!
 
Ok Thanks I'll give it a shot...

as for the code not working... well, actually it is. I just made a simple typo in my windows socket client. I rebuilt another version of the unix socket server and incorprated a 'get-out-clause'!!! ;-)

thanks again
tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
Second method worked like a charm!!! THANKS!

:)
tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top