Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For the life of me, I cannot get this to work. I'm running Debian on Raspberry Pi.

running this command from CLI:

/home/pi/domotiga/DomotiGaServer.gambas -d

runs my home automation server.

How do I go about running this on boot?

I have a file in my /etc/init.d dir that does get loaded, but it doesn't launch the server

file contents:

# Provides:          domotigaserver
# Required-Start:    $syslog $mysql
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: domotiga server
# Description:

# /etc/init.d/domotigaserver

# Carry out specific functions when asked to by the system
case "$1" in
su pi -c '/home/pi/domotiga/DomotiGaServer.gambas -d'
echo "Starting DomotiGa Server " 
pkill DomotiGaServer.gambas
echo "DomotiGa Server has been stopped (didn't double check though)" 
echo "Usage: /etc/init.d/domotigaserver {start|stop}" 
exit 1

exit 0
share|improve this question
Writing the init.d script is not enough, you need to create start/stop links in /etc/rc[0-9].d for the proper run level. Tools like rcconf or update-rc.d can do this for you. See e.g. debianadmin.com/manage-linux-init-or-startup-scripts.html – jofel Dec 30 '12 at 17:46
@jofel A verbose version of that comment would make an excellent answer. – user13742 Dec 30 '12 at 19:20
rcconf reports that the domotigaserver is scheduled to load - is that enough? When watching the startup text, 'domotigaserver started' is also listed, yet the server isn't running. Thanks. – Mike Thrussell Dec 30 '12 at 19:42
@MikeThrussell If you see the message, your script seems to be called. Does the program start if you call your script by hand? – jofel Dec 30 '12 at 20:13
@jofel yes, it starts when called by hand - I log in (ssh) as user 'pi' to do this – Mike Thrussell Dec 30 '12 at 20:29

Creating init.d scripts is not enough. You need to create start/stop links in /etc/rc[0-9].d for the proper run level.

By default, Debian uses run level 2 (configurable in /etc/inittab).

To create appropriate links, you can use update-rc.d. Run

update-rc.d domotigaserver defaults

as root user.

Alternatively, you can use rcconf (install it e.g. by apt-get install rcconf). It offers a nice TUI.

See for example here for more information.

share|improve this answer
Thanks for your detailed answer. Unfortunately this doesn't seem to be my problem. Running '/etc/init.d/domotigaserver start' by hand also starts the server ok, and rcconf reports it is set to run on startup and the script executes, but the server isn't loaded. – Mike Thrussell Dec 31 '12 at 0:59
up vote 1 down vote accepted

Turns out the script was executing too early; before some prerequisites. Symlinks were named S03domotigaserver - I renamed them to S80domotigaserver and it now works.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.