On 7/31/05, alok barnwal <alokbarnwal2000@yahoo.com>
wrote:> Hi Hari,
> Your observations is very true.
> And you cannot have 2 processess running on same port.
> Such problem is being faced when you try to restart
> particular service and found that previous instance is
> not properly stopped and hence port was not free when
> new process try to occupy that port.
> Better implementations is that
> 1.Optimise TCP parameters of your system.
> 2.In your daemon script check whether port is free or
> not. if not make it free before starting process.
>
> Regards
> Alok
It is not clear from your reply, why rsync behaves in this nonstandard
way, and why I should optimize TCP parameters, but I can certainly run
rsync client in list-module mode to see if the daemon is already
running. Of course, I can also open a connection to the port, but
using rsync client will certainly be safer.
--
Thank you,
Hari
>
> --- Hari Krishna Dara <haridara@gmail.com> wrote:
>
> > I thought if a daemon is already running on the
> > default port, I
> > thought the additional ones started on the same port
> > will result in an
> > exit with error, but somehow it seems to work just
> > fine. If I kill the
> > first process, the second process seems to take
> > control of the port.
> > As far as I know you can't have two processes
> > binding to the same
> > port, so does that mean the second process is just
> > polling for the
> > port to be available? This seems very
> > counter-intuitive. Can anyone
> > explain?
> >
> > Thanks,
> > Hari