/etc/init.d/opensips restart returns OK when opensips is down...

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

/etc/init.d/opensips restart returns OK when opensips is down...

Toyima Dias
Hello,
 
I've a doubt regarding opensips.init script; it use to happend that restarting opensips with:
 
/etc/init.d/opensips restart
 
It returns OK, but checking with ps -ef | grep opensips does not show opensips running, by the way, checking the opensips.log shows many errors for example that the DB does not exist or whatever the issue, my doubt is not regarding why opensips is not able tu up for X reason, my doubt is why /etc/init.d/opensips restart returns OK even if this is not true?
 
Thanks in advance for any help!

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: /etc/init.d/opensips restart returns OK when opensips is down...

Advantia VoIP Systems
Hi Toyima,

The start-stop-daemon function of the init script returns successfully when launching OpenSIPS as long as your script is syntactically correct and a pidfile can be created.  You likely have an external resource (database perhaps) that is required but not available (database credentials??) causing OpenSIPS to exit after the init script exits.

Cheers,

Mario

On Fri, Jun 3, 2011 at 4:46 AM, Toyima Dias <[hidden email]> wrote:
Hello,

I've a doubt regarding opensips.init script; it use to happend that restarting opensips with:
 
/etc/init.d/opensips restart
 
It returns OK, but checking with ps -ef | grep opensips does not show opensips running, by the way, checking the opensips.log shows many errors for example that the DB does not exist or whatever the issue, my doubt is not regarding why opensips is not able tu up for X reason, my doubt is why /etc/init.d/opensips restart returns OK even if this is not true?
 
Thanks in advance for any help!

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: /etc/init.d/opensips restart returns OK when opensips is down...

Toyima Dias
Let me see if i understand,
 
If opensips has not started (ps -ef | grep opensips doesn't show any opensips pid), how is possible that /etc/init.d/opensips returns [OK] when you execute /etc/init.d/opensips restart...is this beacuse of mysql? is that what you mean...this script should return 1 (not succesfull, different than 0) it no pid file has been created, am i right?

2011/6/4 Advantia VoIP Systems <[hidden email]>
Hi Toyima,

The start-stop-daemon function of the init script returns successfully when launching OpenSIPS as long as your script is syntactically correct and a pidfile can be created.  You likely have an external resource (database perhaps) that is required but not available (database credentials??) causing OpenSIPS to exit after the init script exits.

Cheers,

Mario

On Fri, Jun 3, 2011 at 4:46 AM, Toyima Dias <[hidden email]> wrote:
Hello,

I've a doubt regarding opensips.init script; it use to happend that restarting opensips with:
 
/etc/init.d/opensips restart
 
It returns OK, but checking with ps -ef | grep opensips does not show opensips running, by the way, checking the opensips.log shows many errors for example that the DB does not exist or whatever the issue, my doubt is not regarding why opensips is not able tu up for X reason, my doubt is why /etc/init.d/opensips restart returns OK even if this is not true?
 
Thanks in advance for any help!

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: /etc/init.d/opensips restart returns OK when opensips is down...

Andrew Pogrebennyk-3
On 06.06.2011 14:15, Toyima Dias wrote:
> If opensips has not started (ps -ef | grep opensips doesn't show any
> opensips pid), how is possible that /etc/init.d/opensips returns [OK]
> when you execute /etc/init.d/opensips restart...is this beacuse of
> mysql? is that what you mean...this script should return 1 (not
> succesfull, different than 0) it no pid file has been created, am i right?

Correct, but there can be a case when opensips starts but then some
module's initialization function fails due to mysql connect error or
incompatible table version and the opensips will exit.

--
Sincerely,
Andrew Pogrebennyk

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: /etc/init.d/opensips restart returns OK when opensips is down...

Toyima Dias
Ok, but it any case, the script should return 1 if opensips failed to initialize; i'm thinking to build a HA infraestructure with opensips (heartbeat, cluster glue...) and this opensips init script behavior seems not to be appropriate; i will have to take a deeper look at the opensips.init script 

2011/6/6 Andrew Pogrebennyk <[hidden email]>
On 06.06.2011 14:15, Toyima Dias wrote:
If opensips has not started (ps -ef | grep opensips doesn't show any
opensips pid), how is possible that /etc/init.d/opensips returns [OK]
when you execute /etc/init.d/opensips restart...is this beacuse of
mysql? is that what you mean...this script should return 1 (not
succesfull, different than 0) it no pid file has been created, am i right?

Correct, but there can be a case when opensips starts but then some module's initialization function fails due to mysql connect error or incompatible table version and the opensips will exit.

--
Sincerely,
Andrew Pogrebennyk


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: /etc/init.d/opensips restart returns OK when opensips is down...

thomcr
I have an HA setup with Pacemaker using heartbeat stack.

I created a script that monitors opensips via the pid file. Eventhough the start event succeed and then opensips crash due to a module. The next monitor round will report an error, and the resource would be migrated to the  next node.

I don't think the start stop daemon utility used to bring up opensips would succeed, and then opensips would crash starting the modules.

On Mon, Jun 6, 2011 at 10:44 AM, Toyima Dias <[hidden email]> wrote:
Ok, but it any case, the script should return 1 if opensips failed to initialize; i'm thinking to build a HA infraestructure with opensips (heartbeat, cluster glue...) and this opensips init script behavior seems not to be appropriate; i will have to take a deeper look at the opensips.init script 

2011/6/6 Andrew Pogrebennyk <[hidden email]>
On 06.06.2011 14:15, Toyima Dias wrote:
If opensips has not started (ps -ef | grep opensips doesn't show any
opensips pid), how is possible that /etc/init.d/opensips returns [OK]
when you execute /etc/init.d/opensips restart...is this beacuse of
mysql? is that what you mean...this script should return 1 (not
succesfull, different than 0) it no pid file has been created, am i right?

Correct, but there can be a case when opensips starts but then some module's initialization function fails due to mysql connect error or incompatible table version and the opensips will exit.

--
Sincerely,
Andrew Pogrebennyk


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




--
Robert

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: /etc/init.d/opensips restart returns OK when opensips is down...

Dave Singer-2
Toyima,

What I've done to deal with errors on a restart is to copy the config
to a temp, replace a couple things like fifo file and ports, start it
with foreground option, piping output to check for errors. The group
is backgrounded with & and the init script waits for 2 sec. If bk
process is still running and no errors, it is killed and real restart
is proceeded with.

I posted my init script a few months back in the list if you want more details.
Be cautious of the script return value as restart failure may be just
that the config was bad and opensips was not restarted but still
running old config, you may not want to have HA kick to other server.

Dave

On Mon, Jun 6, 2011 at 3:24 PM, Robert Thomas <[hidden email]> wrote:

> I have an HA setup with Pacemaker using heartbeat stack.
>
> I created a script that monitors opensips via the pid file. Eventhough the
> start event succeed and then opensips crash due to a module. The next
> monitor round will report an error, and the resource would be migrated to
> the  next node.
>
> I don't think the start stop daemon utility used to bring up opensips would
> succeed, and then opensips would crash starting the modules.
>
> On Mon, Jun 6, 2011 at 10:44 AM, Toyima Dias <[hidden email]> wrote:
>>
>> Ok, but it any case, the script should return 1 if opensips failed to
>> initialize; i'm thinking to build a HA infraestructure with opensips
>> (heartbeat, cluster glue...) and this opensips init script behavior
>> seems not to be appropriate; i will have to take a deeper look at
>> the opensips.init script
>>
>> 2011/6/6 Andrew Pogrebennyk <[hidden email]>
>>>
>>> On 06.06.2011 14:15, Toyima Dias wrote:
>>>>
>>>> If opensips has not started (ps -ef | grep opensips doesn't show any
>>>> opensips pid), how is possible that /etc/init.d/opensips returns [OK]
>>>> when you execute /etc/init.d/opensips restart...is this beacuse of
>>>> mysql? is that what you mean...this script should return 1 (not
>>>> succesfull, different than 0) it no pid file has been created, am i
>>>> right?
>>>
>>> Correct, but there can be a case when opensips starts but then some
>>> module's initialization function fails due to mysql connect error or
>>> incompatible table version and the opensips will exit.
>>>
>>> --
>>> Sincerely,
>>> Andrew Pogrebennyk
>>>
>>> _______________________________________________
>>> Users mailing list
>>> [hidden email]
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
>
> --
> Robert
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>



--
David Singer

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users