Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Kill a process on Sun Solaris 8

Thread view: 
Regina - 22 Dec 2005 08:16 GMT
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!
Francesco Devittori - 22 Dec 2005 09:23 GMT
> Hi,
> I want to kill a process running on a Sun Solaris 8 machine with Unix
[quoted text clipped - 3 lines]
> 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
Regina - 22 Dec 2005 09:51 GMT
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!
Roedy Green - 22 Dec 2005 09:57 GMT
>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?
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 22 Dec 2005 10:00 GMT
>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
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Regina - 22 Dec 2005 11:11 GMT
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!
Roedy Green - 22 Dec 2005 11:15 GMT
>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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Regina - 22 Dec 2005 12:03 GMT
How can I make a telnet session.
Can you give me some example?
Thanks!
Roedy Green - 22 Dec 2005 12:37 GMT
>How can I make a telnet session.
>Can you give me some example?
>Thanks!
see http://mindprod.com/jgloss/telnet.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Regina - 22 Dec 2005 13:29 GMT
I prefer an example code, please without using an external library.
Thank you!
Roedy Green - 22 Dec 2005 14:57 GMT
>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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andrea Desole - 22 Dec 2005 12:16 GMT
> 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?
Francesco Devittori - 22 Dec 2005 11:20 GMT
> 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!

http://www.jcraft.com/jsch/

looks promising
Luc The Perverse - 22 Dec 2005 10:26 GMT
> 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!

--
LTP

:)
Francesco Devittori - 22 Dec 2005 10:44 GMT
>>Sei italiano anche tu?
>>
[quoted text clipped - 9 lines]
>
> :)

LOL :-)
Francesco Devittori - 22 Dec 2005 10:46 GMT
> 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
Regina - 22 Dec 2005 16:06 GMT
Ok, I have make rexec command with NetComponents 1.3.8 library.
See you later.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.