Kill a process on Sun Solaris 8

R

Regina

Hi,
I want to kill a process running on a Sun Solaris 8 machine with Unix
system giving its ProcessId from my application running on Windows
machine.
How can I do this?
Please, help me! I like code example!
Thanks!
 
F

Francesco Devittori

Regina said:
Hi,
I want to kill a process running on a Sun Solaris 8 machine with Unix
system giving its ProcessId from my application running on Windows
machine.
How can I do this?
Please, help me! I like code example!
Thanks!

If you were on linux/unix you could execute a local command like
"ssh -l username yourhost pkill <pid>"
I never did that but I'm pretty sure you can launch some system command
from java.
Now since you are on windows, maybe you can find a substitute for ssh
that can be used from the command-line.

Otherwise you have to create an ssh connection directly in java... not
too easy I guess.
I am assuming you only have ssh access. If you have telnet access then
it should be much easier.

Francesco
 
R

Regina

Sei italiano anche tu?

Da quello che mi hai scritto ho capito che devo inviare un comando di
shell dalla mia applicazione.Giusto?
Ma come?
Grazie!
 
R

Roedy Green

Sei italiano anche tu?

Da quello che mi hai scritto ho capito che devo inviare un comando di
shell dalla mia applicazione.Giusto?
Ma come?
Grazie!

Is this what you meant?
 
R

Roedy Green

Sei italiano anche tu?

Da quello che mi hai scritto ho capito che devo inviare un comando di
shell dalla mia applicazione.Giusto?
Ma come?
Grazie!
Is this what you meant?

Are you Italian too ? From what you have written, I understand that I
must exec a command processor shell from my application. But how?
Thanks!

see http://mindprod.com/jgloss/exec.html
 
L

Luc The Perverse

Regina said:
Sei italiano anche tu?

Da quello che mi hai scritto ho capito che devo inviare un comando di
shell dalla mia applicazione.Giusto?
Ma come?
Grazie!

Non fare lo strozzetoni!
 
F

Francesco Devittori

Regina said:
Sei italiano anche tu?

Da quello che mi hai scritto ho capito che devo inviare un comando di
shell dalla mia applicazione.Giusto?
Ma come?
Grazie!

Yes, ehm, no, Swiss. But I speak italian.
Anyway (sorry, I answer in english so other users understand - if you
don't understand re-ask, I'll translate).

Yes, executing a shell command from java is what I meant. I don't know
if it's the best option, that's just the first idea that jumped to my mind.

Francesco
 
R

Regina

Hi, I have look at your site.
But I have to make this operation in remoth mode.
So, firstly I have to connect with remoth host where the process to
kill is running.
How?
Thanks!
 
R

Roedy Green

But I have to make this operation in remoth mode.
So, firstly I have to connect with remoth host where the process to
kill is running.

to do that either you have to telnet in, or you need some server
running that will do it on receipt of a special message.
 
A

Andrea Desole

Roedy said:
to do that either you have to telnet in, or you need some server
running that will do it on receipt of a special message.

I don't think there is a way in Windows to telnet giving a password, so
calling exec is probably not enough. You still have to wait for the
string 'password', and then give the password. So you'll have to work
with both input and output of your process.
Maybe in this situation a straight socket connection would be better?
 
R

Roedy Green

I prefer an example code, please without using an external library.
Thank you!

Why don't you first look at the code to see just how big a wheel you
are planning to reinvent. If you do decide to do that, you can at
least use it for a model of what you have to do. Telnet is more
complicated that you imagine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top