domotiga send email strange problem (upstart ?)

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

domotiga send email strange problem (upstart ?)

Postby Aqua-Passion » Thu Dec 29, 2011 1:42 am

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
Aqua-Passion
Starting Member
Starting Member
 
Posts: 13
Joined: December 2011
Location: FRANCE

Re: domotiga send email strange problem (upstart ?)

Postby RDNZL » Thu Dec 29, 2011 11:38 am

What does your upstart script look like exactly?
Regards, Ron.
http://domotiga.nl - open source home automation software for Linux.
User avatar
RDNZL
Forum Moderator
Forum Moderator
 
Posts: 943
Joined: September 2006
Location: Dordrecht, The Netherlands

Re: domotiga send email strange problem (upstart ?)

Postby Aqua-Passion » Thu Dec 29, 2011 12:57 pm

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: December 2011
Location: FRANCE

Re: domotiga send email strange problem (upstart ?)

Postby Aqua-Passion » Thu Dec 29, 2011 9:33 pm

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
Aqua-Passion
Starting Member
Starting Member
 
Posts: 13
Joined: December 2011
Location: FRANCE

Re: domotiga send email strange problem (upstart ?)

Postby jrkalf » Fri Dec 30, 2011 1:00 am

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
jrkalf
Member
Member
 
Posts: 291
Joined: November 2010
Location: Nootdorp

Re: domotiga send email strange problem (upstart ?)

Postby Aqua-Passion » Fri Dec 30, 2011 1:07 am

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
User avatar
Aqua-Passion
Starting Member
Starting Member
 
Posts: 13
Joined: December 2011
Location: FRANCE


Return to DomotiGa Forum

Who is online

Users browsing this forum: No registered users and 1 guest