[Freeswitch-dev] only one freeswitch at a time (using the same log directory, at least)

Trixter aka Bret McDanel trixter at 0xdecafbad.com
Wed Feb 21 22:28:00 EST 2007

On 2/21/07, David Nicol <davidnicol at gmail.com> wrote:
> On 2/21/07, Trixter aka Bret McDanel <trixter at 0xdecafbad.com> wrote:
> > To anyone that runs multiple instances you want to ensure that the db
> dir
> > isnt used by some other FS process as well.
> there could be a multiple_instances WikiPage...
> my main concern is to avoid crashing the server again if I somehow manage
> to pull off another
>     perl -le '  1 while `/usr/local/freeswitch/bin/freeswitch -nc`'

yeah, that is a potential issue, the patch I submitted to allow for
specification to an alternate config should be consolodated, when I did it I
didnt originally know that log, db and conf needed to be seperate, so I
started out one at a time until I had all 3.  Instead a better thing would
be to edit switch.c (iirc) to have a -prefix-dir arg or something and use
that so you specify one prefix which contains a conf,db,log dir.  So if you
are mucking about in the code to prevent multiple instances (remember the
solution should be cross platform, mikej might be best to advise you on the
windows way, but it shouldnt be a unix only solution, and cant rely on perl
as things like pocket pc which is a supported platform dont have perl).

It would be trivial to adjust the 3 'if' statements into one and adjust
those 3 prefixes (they need to be the same format so they work on both
windows and unix like systems - it was coded the way it was for that
specific reason).  Then just strncpy() + strcat() or whatever works the
different subdirs to the specified main dir.  That would make that part
easier, and look much cleaner at the same time :D

Trixter http://www.0xdecafbad.com     Bret McDanel
Belfast +44 28 9099 6461        US +1 516 687 5200
http://www.trxtel.com the VoIP provider that pays you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20070222/4e1d75c7/attachment.html 

More information about the Freeswitch-dev mailing list