shutdown of a client from the server

can anyone tell me how to shutdown the client system from the server using theports in a java program.i am new to this topic ..so can anyone pls help me out.?regards lalita
[207 byte] By [lalita_1214a] at [2007-11-26 22:01:38]
# 1
Are you already able to "shutdown the system" using any java code executed on the system itself?
Michael.Nazarov@sun.coma at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 2

hello

can u pls help me by giving a sample code to shutdown the linux system itself using java code...

and also can u give me a program to shutdown all the other systems in my lab fram a server that i am creating using the socket programming in java.....

it is basically my final yr project that i am working on so i need to find a solution for shutdown of all systems from the server through sockets...i am new to this socket programming so i need some help.....

i have not done such programming before....hence very new to this topic...

hoping for a fovorable response....

regards

lalita

lalita_swathia at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 3
http://java.sun.com/docs/books/tutorial/networking/index.html
ejpa at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 4

Hi,

if you are already able to shutdown a linux machine by the command line, have a look to this link (how to execute a command through a java program.....but i didn't try it!)

http://www.jguru.com/faq/view.jsp?EID=344255

then, on each machine you can issue a server (in order to shutdown all the machines of a subnet I would bind a UDP server accepting broadcast UDP packets) waiting for a remote packet.

Once the packet arrives, you perform the command by java (thanks to the link)....please check the packet content before to shutdown all the PC....otherwise anybody would be able to turn off your PCs

Hope this help.

Bye

giusevaa at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 5

Dear lalita_1214,

to remotely shutdown a computer there is to approaches you can follow:

1-Either you implement your own protocol "very easy" and when you send a specific command from your client to the server e.g.shutdown, the server recognize and perfom the poweroff procedure by using the jGuru link which was posted earlier.

2-The second choice which is ofcourse more secure is to install an SSH server on the server machine and develop an SSH client, and use the ordinary OS commands e.g. if it was Linux box shutdown -h now or whatever you like.

hope that helped.

Amr M. Kamel

Radi0Shacka at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 6
Dear Radi0Shack , Thank you so much for the post tat u have sent...it really helped me a lot...regardsLalita
lalita_swathia at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 7
Dear giusevathanks a lot i have tried it n it works.......regardsLalita
lalita_swathia at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 8
Your're welcome,I am glad to help people when possible ;)Bye
giusevaa at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 9

hi

I have a small problem regarding the viewing of the log files of the server from the client....i need to just get the log files of the client when server asks the xlient for it...it shud all be done via a socket..... can u pls help me regarding this matter..... i need a small code that can solve my problem....

regards

Lalita

lalita_swathia at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 10

hi

I have a small problem regarding the viewing of the log files of the server from the client....i need to just get the log files of the client when server asks the xlient for it...it shud all be done via a socket..... can u pls help me regarding this matter..... i need a small code that can solve my problem....

regards

Lalita

lalita_swathia at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 11
Your posting is not relevant to this thread.
ejpa at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...
# 12
If it is XP mins conect from remotly and shutdownothe whays stat-run-type a commnd-computer namenad type shut down-i
nagaraj_heroa at 2007-7-10 10:41:48 > top of Java-index,Core,Core APIs...