gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smsd and MySQL server has gone away


From: massimo citterio
Subject: Re: smsd and MySQL server has gone away
Date: Mon, 25 Sep 2006 12:30:52 +0200

On Fri, 22 Sep 2006 12:12:08 +0200
massimo citterio <address@hidden> wrote:

> hallo
> sometimes smsd lose messages. 
> It's trying to insert sms from phone into db, and if the db is not availabe 
> (I still don't know why), it prints:
> 
> 22 Sep 2006 11:57:59: Inserting sms from +39348XXXXXXX unsuccessful.
> 
> 158: SELECT FROM outbox command failed.
> Error: MySQL server has gone away
> 

we made a patch to smsd, now it exits on insert errors ( I use monit to check 
daemon status), doesn't delete sms from phone if insert fails, and logs all 
info to the logfile.
hope it helps.

diff from version 6.14
diff  smsd.c.orig smsd.c
426,429c426,433
<       if (error)
<         LogFile (_("Inserting sms from %s unsuccessful.\n"), 
data->remote.number);
<       else
<         LogFile (_("Inserting sms from %s successful.\n"), 
data->remote.number);
---
>       if (error) {
>         LogFile (_("Inserting sms from %s unsuccessful.\nWith text: %s\nIn 
> date : %02d-%02d-%02d %02d:%02d:%02d+%02d\nQuitting without delete 
> message\n"), data->remote.number, data->user_data[0].u.text, 
> data->smsc_time.year, data->smsc_time.month, data->smsc_time.day, 
> data->smsc_time.hour, data->smsc_time.minute, data->smsc_time.second, 
> data->smsc_time.timezone);
>       exit(1);
>       LogFile(_("Why exit don't work? Problem"));
>       }
>       else {
>       LogFile (_("Inserting sms from %s successful.\nWith text: %s\nIn date : 
> %02d-%02d-%02d %02d:%02d:%02d+%02d\n"), data->remote.number, 
> data->user_data[0].u.text, data->smsc_time.year, data->smsc_time.month, 
> data->smsc_time.day, data->smsc_time.hour, data->smsc_time.minute, 
> data->smsc_time.second, data->smsc_time.timezone);
>       }



-- 
Ing. Massimo Citterio
FPE srl (sede Milano)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]