If a port isn't shut down nicely then it can hang around waiting for the
TIME_WAIT to expire (4 minutes by default but you can tune this).
If you definitely shut down your directory and there's no process
hanging around (do a "ps -ef" and grep for the process) then the port
*will* free up eventually. You cannot force it to free up faster (well,
I suppose you *could* reboot, but that would be silly).
Tune your TIME_WAIT interval down by doing (as root)
ndd -set /dev/tcp tcp_time_wait_interval 60000 (default value is
240000 - time is in milliseconds. I don't suggest tuning lower than 60
seconds unless you really know what you're doing.)
You should shut the directory down nicely before uninstalling any
software. This is probably why it's haning around (it was probably
abruptly killed). Uninstalling software does not *necesssarily* stop
the processes associated with it.
Regards
Tim