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
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
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
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
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