• Post Reply Bookmark Topic Watch Topic
  • New Topic

problems killing RMIRegistry on UNIX?  RSS feed

 
Shawn Kuenzler
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After closing my application, which uses RMI, my clients are instructed to kill the rmiregistry process to free up the port. I've found that on Solaris, sometimes even after killing the pid for rmiregistry, it's still running on the system. You have to dig a little deeper by running ps -eaf to find it though it's not listed if you run ps -f.

Perhaps this is more of a UNIX question than a problem with rmiregistry but I think it's a little strange. Any ideas? Better yet, is there a way to kill the process for good without knowing the pid? That way I could script it in a StopServer.sh. Couldn't find anything on Google.

Thanks!
 
jittu goud
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
with in the shell script write a case for stopping the process

pid=`ps auxwww | grep "rmiregistry" |grep -v initlog | head -1 |awk 1'{print$2'`

if "$pid"=""; then
echo "No Process to Stop"

else
echo "stopping rmi : with PID : $pid"
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jithendar",
Please check your private messages.
 
kelby zorgdrager
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not sure which version of java and the rmiregistry you are using..

but if your application is the only thing that uses the rmiregistry, you may want to consider having the application start and stop it directly.. you could either use the process stuff built into the language and "fork" a process or.. better yet, you could use JMX and MBean and do some remote management..

this may not solve your current unix issue, but would probably end up being a cleaner approach as your application is "self cleaning" requiring no additional end user interaction..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!