Page 1 of 1

domotigaServer on startup

Posted: Wed Dec 28, 2011 12:02 pm
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

Re: domotigaServer on startup

Posted: Thu Dec 29, 2011 12:35 pm
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

Re: domotigaServer on startup

Posted: Sat Dec 31, 2011 12:58 pm
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

Re: domotigaServer on startup

Posted: Sun Jan 01, 2012 3:58 pm
by jrkalf
Isno,

You're running a sheevaplug with what distribution of linux?
Fedora, Suse, Debian, ubuntu, slackware, Mint ... gentoo?

Re: domotigaServer on startup

Posted: Mon Feb 27, 2012 1:05 am
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

Re: domotigaServer on startup

Posted: Mon Feb 27, 2012 10:04 am
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

Re: domotigaServer on startup

Posted: Tue Feb 28, 2012 2:16 pm
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

Re: domotigaServer on startup

Posted: Wed Feb 29, 2012 9:34 pm
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.

Re: domotigaServer on startup

Posted: Fri Mar 02, 2012 7:58 pm
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

Re: domotigaServer on startup

Posted: Mon Mar 12, 2012 8:30 pm
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.

Re: domotigaServer on startup

Posted: Wed Mar 14, 2012 8:10 am
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....