domotiga send email strange problem (upstart ?)

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
User avatar
Aqua-Passion
Starting Member
Starting Member
Posts: 13
Joined: Wed Dec 21, 2011 2:16 pm
Location: FRANCE
Contact:

domotiga send email strange problem (upstart ?)

Post by Aqua-Passion »

Hello
I have a strange problem with domotiga email send on ubuntu 10.04
when I start domotiga server manualy by

Code: Select all

sudo -u username gbr2 /home/userdir/domotiga/DomotiGaServer.gambas -d
(in terminal)
I can send email with domotiga

But for boot startup I start domotiga with "upstart" on ubuntu

Code: Select all

sudo -u username gbr2 /home/userdir/domotiga/DomotiGaServer.gambas -d
start the server , all is ok but email send don't work
On "send test mail" i have :
2011/12/29 01:35:35 Succesfully sent e-mail to 'xxxxx@gmail.com'.
2011/12/29 01:35:35 An error occured sending an e-mail message with subject 'DomotiGa: Test e-mail' to 'xxxxx@gmail.com'.
I have tested http://www.domotiga.nl/projects/domotig ... er-Upstart too , same problem
Domotiga logs files and systems logs files checked but just the
An error occured sending an e-mail message with subject 'DomotiGa: Test e-mail' to 'xxxxx@gmail.com'.
can you help me or give me a way please ?
thanks
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: domotiga send email strange problem (upstart ?)

Post by RDNZL »

What does your upstart script look like exactly?
Regards, Ron.
User avatar
Aqua-Passion
Starting Member
Starting Member
Posts: 13
Joined: Wed Dec 21, 2011 2:16 pm
Location: FRANCE
Contact:

Re: domotiga send email strange problem (upstart ?)

Post by Aqua-Passion »

Code: Select all

# domotiga_server
#
# Serveur Domotiga

description     "DomotiGaServer Service" 
author            "Ron Klinkien <info@domotiga.nl>" 

start on (net-device-up
          and started mysql
          and runlevel [2345])
stop on runlevel [016]

# tell upstart we're creating a daemon
# upstart manages PID creation for you.
respawn
respawn limit 5 5

# configuratio variables

env DOMO_USER=aqua-passion
env GBX2=/usr/bin/gbx2
env GBC2=/usr/bin/gbc2
env GBC2_OPTS=-pam

# Execute the program

chdir /home/aqua-passion/domotiga/DomotiGaServer
pre-start exec sudo -H -n -u $DOMO_USER $GBC2 $GBC2_OPTS
exec sudo -H -n -u $DOMO_USER $GBX2 > /dev/null 2>&1
like from http://www.domotiga.nl/projects/domotig ... er-Upstart
tested with simply

Code: Select all

exec sudo -u aqua-passion gbr2 /home/aqua-passion/domotiga/DomotiGaServer.gambas -d
too

both start server but mail error
2011/12/29 01:35:35 Succesfully sent e-mail to 'xxxxx@gmail.com'.
2011/12/29 01:35:35 An error occured sending an e-mail message with subject 'DomotiGa: Test e-mail' to 'xxxxx@gmail.com'.
when i start server with the same

Code: Select all

sudo -u aqua-passion gbr2 /home/aqua-passion/domotiga/DomotiGaServer.gambas -d
in user terminal
mails send work great !
stange :-(
User avatar
Aqua-Passion
Starting Member
Starting Member
Posts: 13
Joined: Wed Dec 21, 2011 2:16 pm
Location: FRANCE
Contact:

Re: domotiga send email strange problem (upstart ?)

Post by Aqua-Passion »

I have a problem with the zwave module
so I have upgarded gamabas2 and domotiga with the next version
Mails now seems to work !
thanks
I open a new topic for the zwave problem
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: domotiga send email strange problem (upstart ?)

Post by jrkalf »

aqua,

Can you confirm that the issue you had with email wasn't related to the Upstart script? It was the first version of the script for me.
Starting the domotiga server with the latest line you posted:

Code: Select all

sudo -u aqua-passion gbr2 /home/aqua-passion/domotiga/DomotiGaServer.gambas -d
Will eventually lead you to issues with restarting domotiga on your ubuntu system. Or that's at least how I experienced it.
sudo will start the gbr2 process with the DomotigaServer.gambas -d project. What infact will happen is a fork of the process and the originating process will be shutdown. Therefor the Upstart system looses the PID under which it started the initial gbr2 process. This will cause the system to be unable to shutdown the DomotigaServer.gambas and therefor won't restart either.

The most correct way I've found it to be working now was the script I posted on the domotiga.nl website. If you run into any issues or have any improvements. Please let me know, it's a work in progress :mrgreen:
If you can't fix it with a hammer, you've got an electrical problem!

Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
User avatar
Aqua-Passion
Starting Member
Starting Member
Posts: 13
Joined: Wed Dec 21, 2011 2:16 pm
Location: FRANCE
Contact:

Re: domotiga send email strange problem (upstart ?)

Post by Aqua-Passion »

thank you very much for this script

no i have just "do a test" with

Code: Select all

sudo -u aqua-passion gbr2 /home/aqua-passion/domotiga/DomotiGaServer.gambas -d
for see if it resolve mail bug

since i have updated domotiga and gambas
Server start and send mails work great with upstart :

Code: Select all

    # domotiga_server
    #
    # Serveur Domotiga

    description     "DomotiGaServer Service"
    author            "Ron Klinkien <info@domotiga.nl>"

    start on (net-device-up
              and started mysql
              and runlevel [2345])
    stop on runlevel [016]

    # tell upstart we're creating a daemon
    # upstart manages PID creation for you.
    respawn
    respawn limit 5 5

    # configuratio variables

    env DOMO_USER=aqua-passion
    env GBX2=/usr/bin/gbx2
    env GBC2=/usr/bin/gbc2
    env GBC2_OPTS=-pam

    # Execute the program

    chdir /home/aqua-passion/domotiga/DomotiGaServer
    pre-start exec sudo -H -n -u $DOMO_USER $GBC2 $GBC2_OPTS
    exec sudo -H -n -u $DOMO_USER $GBX2 > /dev/null 2>&1
thanks
Post Reply

Return to “DomotiGa Forum”