Deemon: Fix handling of broken Database Connection

fixes #14


git-svn-id: file:///home/jan/tmp/wetterstation/trunk@259 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
jan 2008-07-29 14:54:14 +00:00
parent b65de8de92
commit 23ff8045db
4 changed files with 19 additions and 7 deletions

View File

@ -77,7 +77,10 @@ int main(int argc, char *argv[]){
#endif
DEBUGOUT1("Programm gestartet\n");
if(signal(SIGPIPE, SIG_IGN) == SIG_ERR)
exit_error(ERROR_SEIINST);
DEBUGOUT1("SIGPIPE ignoriert\n");
if(signal(SIGABRT, exit_sig_handler) == SIG_ERR)
exit_error(ERROR_SEIINST);
DEBUGOUT1("Signalhandler zum beenden per SIGABRT installiert\n");

View File

@ -113,6 +113,9 @@ static void check_create_query_buffer(){
/* Guckt ob Verbindung da und versucht aufzubauen.
* gibt 1 zurueck, wenn erfolgreich, sonst 0 */
static int pg_connect(){
if (PQstatus(connection) == CONNECTION_OK){
PQexec(connection,"SELECT 1"); /* Status neusetzen erzwingen */
}
if(PQstatus(connection) != CONNECTION_OK){
if (connection == NULL){
if(conn_string == NULL){

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
weatherstation (1.0.16-1) stable; urgency=low
* Daemon: Fix handling of broken Database Connections
-- Jan Losinski <losinski@wh2.tu-dresden.de> Wed, 29 Jul 2008 16:53:00 +0100
weatherstation (1.0.16) stable; urgency=low
* Frontend: Adding caching

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<Set type="full">
<Module id="1">
<FullSet>
<Sensor id="1">
{content:addModule:xmltemp_1}
{content:addModule:xmlhum_1}
{content:addModule:xmlpress_1}
</Sensor>
<Module id="4">
<Sensor id="4">
{content:addModule:xmltemp_4}
{content:addModule:xmlhum_4}
</Sensor>
<Module id="2">
<Sensor id="2">
{content:addModule:xmlwind_2}
</Sensor>
<Module id="3">
<Sensor id="3">
{content:addModule:xmlrain_3}
</Sensor>
</Set>
</FullSet>