• Post Reply Bookmark Topic Watch Topic
  • New Topic

In UNIX, how to kill a service thru java prog  RSS feed

 
sridevi kumar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I had written socket programs - client and server. Once i start the server in the background, i tried to run the client in the same m/c or diff m/c. It worked fine.
Now, i want to kill the server which is running in the background thru java program rather killing that process in the prompt thru kill command.
Could anyone help me to kill that process thru java prog?
Thanks a lot...
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually send a special shutdown message to the server. That way the server can close files, wrap us sessions, etc. Simply killing a server is not only rude, but can cause the system to become corrupt due to things being in unpredictable states.
 
sridevi kumar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim Holloway,
Thanks for giving idea. I am planning to do the way you told.
 
NILESH PATEL
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please post an example if it is handy. I am trying to do similar thing. My rmi stuff, once it finishes, it still holds memory on /tmp filesystem on AIX.
To relase that memory i have to kill remote process manually, which gets respawned after lokking at inittab.
But at least memeory gets freed that way. However it will be nice to see special shutdown message that you talked about to kill a remote process.
Please help me.,
Thanks
nilesh patel
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!