domotigaServer on startup

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
isno
Starting Member
Starting Member
Posts: 2
Joined: Tue Dec 27, 2011 10:23 pm

domotigaServer on startup

Post by isno »

hello
i am new on domotiga and just installed it on a sheevaplug
i have configured a zwave and 1wire network
now i would like to make domotigaServer start automaticaly when the server start

i have found how to start automaticaly owfs as server but i don't find how to do this for domotiga
i have tried to make a script in init.d with domotigaserver.gambas but it don't work

i have to login and launch it manually

can someone help me ?
thx
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: domotigaServer on startup

Post by RDNZL »

Look at example script 'domotiga.fedora' in domotiga tools directory
http://domotiga.nl/projects/domotiga/wi ... nit-Script
or upstart wiki
http://domotiga.nl/projects/domotiga/wi ... er-Upstart
Regards, Ron.
isno
Starting Member
Starting Member
Posts: 2
Joined: Tue Dec 27, 2011 10:23 pm

Re: domotigaServer on startup

Post by isno »

aie aie aie
I tried since 2 days to make this work but i can't
I have made in the init.d a script and the domotigaserver start when i launch /etc/init.d/domotigaserver start
the file is executable and i have made the links with update-rc.d domotigaserver defaults

but it didn't launch automaticaly when the server start
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: domotigaServer on startup

Post by jrkalf »

Isno,

You're running a sheevaplug with what distribution of linux?
Fedora, Suse, Debian, ubuntu, slackware, Mint ... gentoo?
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.
cmrdomo
Starting Member
Starting Member
Posts: 7
Joined: Thu Feb 09, 2012 1:05 am

Re: domotigaServer on startup

Post by cmrdomo »

jrkalf wrote:Isno,

You're running a sheevaplug with what distribution of linux?
Fedora, Suse, Debian, ubuntu, slackware, Mint ... gentoo?
Hello, i'm another guy usinn an arm5v to run Domotiga Server. My problems are similar.
I'm running Debian Squeeze, and the script for uspstart doesn't work.
I got this error running the script from terminal:

Code: Select all

cmr@Iconnect:~/domotiga/rrd/graphs$ /etc/init.d/domotiga.conf start ..
/etc/init.d/domotiga.conf: line 6: syntax error near unexpected token `('
/etc/init.d/domotiga.conf: line 6: `start on (net-device-up' 
Can you help me making a script for autostart at boot?
Some commands are different is this distro, look at the script:

Code: Select all

# DomotiGa Server Service

# 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=cmr
env GBX2=/usr/local/bin/gbx2
env GBC2=/usr/local/bin/gbc2
env GBC2_OPTS=-pam

# Execute the program
cd /home/cmr/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
Please help.

Carlos
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: domotigaServer on startup

Post by jrkalf »

cmrdomo wrote:
jrkalf wrote:Isno,

You're running a sheevaplug with what distribution of linux?
Fedora, Suse, Debian, ubuntu, slackware, Mint ... gentoo?
Hello, i'm another guy usinn an arm5v to run Domotiga Server. My problems are similar.
I'm running Debian Squeeze, and the script for uspstart doesn't work.
I got this error running the script from terminal:

Code: Select all

cmr@Iconnect:~/domotiga/rrd/graphs$ /etc/init.d/domotiga.conf start ..
/etc/init.d/domotiga.conf: line 6: syntax error near unexpected token `('
/etc/init.d/domotiga.conf: line 6: `start on (net-device-up' 
Can you help me making a script for autostart at boot?
I'm unaware debian is using upstart already for starting processes. Can you verify this? I've found a few articles in which the switch to upstart was discussed, but I've not been able to investigate further.

If so, the net-device-up which is a ubuntu specific command isn't available in debian squeeze. It probably uses another script to verify the network interfaces are up and running. Perhaps you should have a look in your /etc/init directory and find out which script is used. Another option is to remove "net-device-up" from the startup script as it's mostlikely already covered by mysql. I just put it in as a precautionairy measure to make sure network is up and running because I have a ip-socket connection to a device on my network and domotiga won't communicate with it unless the network is up and running.

# DomotiGa Server Service

# 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=cmr
env GBX2=/usr/local/bin/gbx2
env GBC2=/usr/local/bin/gbc2
env GBC2_OPTS=-pam

# Execute the program
cd /home/cmr/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
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.
cmrdomo
Starting Member
Starting Member
Posts: 7
Joined: Thu Feb 09, 2012 1:05 am

Re: domotigaServer on startup

Post by cmrdomo »

Hi!

I removed the lines as you suggested.
But now i got an error like:
/etc/init.d/domotiga.conf: 21: pre-start: not found

I used apt-get to install upstart. Can i revert it? can i uninstall upstart and install other app to run scripts?

Do you know what app Squeeze uses by default? I don't remember what i have before.

regards,

Carlos
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: domotigaServer on startup

Post by jrkalf »

cmrdomo wrote:Hi!

I removed the lines as you suggested.
But now i got an error like:
/etc/init.d/domotiga.conf: 21: pre-start: not found

I used apt-get to install upstart. Can i revert it? can i uninstall upstart and install other app to run scripts?

Do you know what app Squeeze uses by default? I don't remember what i have before.

regards,

Carlos
Mmmmpfh debian....

I'm unaware of the debian make-up. You should have checked if it used the upstart system natively or have used the redhat init script. You can probably still use the redhat script anyway. Most systems with upstart allow for legacy scripts to be started as well.

I'm not sure what the shortcomings of your upstart installation are, it'll be hard to script to that.
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.
cmrdomo
Starting Member
Starting Member
Posts: 7
Joined: Thu Feb 09, 2012 1:05 am

Re: domotigaServer on startup

Post by cmrdomo »

Hi!

Can explain how the script above works?

Why do I have to pre-start?

Why can't I put something like:
./home/Domotiga/domotigaserver.gambas
to start the program?

Also I don't understand the options -h -n or -u

can you shed some light over this subject?

Carlos
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: domotigaServer on startup

Post by jrkalf »

cmrdomo wrote:Hi!

Can explain how the script above works?

Why do I have to pre-start?

Why can't I put something like:
./home/Domotiga/domotigaserver.gambas
to start the program?

Also I don't understand the options -h -n or -u

can you shed some light over this subject?

Carlos
As for the pre-start part, we love to do that to know gambas recompiles the server component each time it starts. Ensuring you run the latest version.
This is because in most svn commits ron doesn't update the .gambas file, merely the .class files. So if he asks you to update from the svn tree and restart the application, the script will automagically recompile the latest domotigaserver on the fly :mrgreen:

For the -h -n -u options, please refer to the sudo manual. I can spell it out, but often the product manual is the best way to learn how the product works to begin with.
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.
Andy_Burn
Starting Member
Starting Member
Posts: 43
Joined: Sun Nov 28, 2010 10:47 pm

Re: domotigaServer on startup

Post by Andy_Burn »

If Domotigaserver starts from the command line, put it in /etc/rc.local (chmod +x to make it executable)
I run all kinds of stuff on my Sheevaplug running Debian
I have No-ip scripts, rtorrent, ntp servers, camera servers (motion) and get_iplayer running.

It works fine :) I might have a go at Domotiga too this Spring....
Post Reply

Return to “DomotiGa Forum”