Re: [PATCH] Add start- stop- box/smsc, store-status functionality to debian init script

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
I would suggest to wait for 2 minutes, because I saw some buggy SMSCs that didn't accept unbind pdu.

If then bearerbox still running you can send SIGABRT to the process, this ensure that Kannel cleanups pid files.

Alex

Am 12.03.2013 um 10:33 schrieb Konstantin Vayner <[email protected]>:

> Looking at your init script;
> I can merge these together
> 
> Question is - what if bearerbox is stuck and does not shut down?
> I've ran across this before with ucp smscs that were not letting go ;)
> 
> Regards,
>    Konstantin
> 
> 
> On Tue, Mar 12, 2013 at 11:25 AM, spameden <[email protected]> wrote:
> 2013/3/12 Alexander Malysh <[email protected]>:
> > Hi,
> >
> > patch not tested but the idea is good and I'm +1 to commit it.
> >
> > Any objections?
> >
> > Alex
> >
> > Am 12.03.2013 um 00:09 schrieb Konstantin Vayner <[email protected]>:
> >
> >> This adds some new features to debian init script:
> >>
> >> 1. Allow start/stop separate boxes via /etc/init.d/kannel {start|stop}-box boxname
> 
> Nice idea, but needs better handling, I've looked into the patch it
> seems does not support multiple configuration files (for example for
> starting multiple smsbox'es or sqlbox'es, e.g.
> /etc/kannel/sqlbox1.conf /etc/kannel/sqlbox2.conf, etc)
> 
> >> 2. Allow start/stop smsc by /etc/init.d/kannel {start|stop}-smsc smsc-id
> >> 3. Allow querying store status via /etc/init.d/kannel store-status
> >> 4. Actually, it also allows arbitrary http admin commands via /etc/init.d/kannel http-admin command params , where params should be a single-argument string, prepared to be passed via url (in form "param1=value&param2=value")
> 
> Would be nice to require/chacking of lynx installation before giving
> any of the opportunity to execute those commands.
> 
> >>
> >> NB: startup/shutdown output format changed to multiple lines of output here (because it uses start-box / stop-box internally, and each call like that outputs a line)
> 
> The main problem with current init.d script it's not always working.
> 
> If there was a big queue on the restart bearerbox takes some time to
> populate the memory with it, thus
> 
> sleep 1 is not enough anymore.
> 
> I'm using this solution on the start:
> 
> PORTCONF=$(grep '^smsbox-port' ${CONF}|awk {'print $3'})
> while [ -z "$(netstat -nl|grep ":${PORTCONF}.*LISTEN")" ]; do sleep 1; done
> 
> and on stop:
> 
> while [ ! -z "$(netstat -nl|grep ":${PORTCONF}.*LISTEN")" ]; do sleep 1; done
> 
> 
> My version also handles multiple sqlbox.conf files depending on the
> values in the /etc/default/kannel file for debian.
> 
> So if you don't want to start specific service (e.g. OpenSMPPBox, you
> just change value from 1 to 0 for START_SMPPBOX in the
> /etc/default/kannel).
> 
> I've attached my init.d script and default file for understanding.
> >>
> >> Attached.
> >>
> >> Regards,
> >>    Konstantin
> >> <debian_kannel_init.patch>
> >
> >
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.