Page 1 of 1
domotiga send email strange problem (upstart ?)
Posted: Thu Dec 29, 2011 2:42 am
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
Re: domotiga send email strange problem (upstart ?)
Posted: Thu Dec 29, 2011 12:38 pm
by RDNZL
What does your upstart script look like exactly?
Re: domotiga send email strange problem (upstart ?)
Posted: Thu Dec 29, 2011 1:57 pm
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
Re: domotiga send email strange problem (upstart ?)
Posted: Thu Dec 29, 2011 10:33 pm
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
Re: domotiga send email strange problem (upstart ?)
Posted: Fri Dec 30, 2011 2:00 am
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
Re: domotiga send email strange problem (upstart ?)
Posted: Fri Dec 30, 2011 2:07 am
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