EIB/KNX: Upstart startup script for eibd

Hi,

as a follow up of the 2 previous posts(compiling eibd and SysV startup script) here is a sample Upstart script for the eibd daemon. Some Ubuntu based distributions uses the upstart start mechanism.

Login as root at your machine where eibd is installed and add a user under  which the eibd process should run.

useradd eibd -s /bin/false -U -M

Create the upstart conf file /etc/init/eibd.conf

#######################################################################
# eibd - startscript for the eibd daemon
description "eibd daemon Upstart script"
author "Michael Albert info@michlstechblog.info"

start on (filesystem or resume)
stop on (suspend or runlevel [!2345])
expect fork
normal exit 0

pre-start script
route add 224.0.23.12 dev eth0 2>&1 > /dev/null || true
end script

script
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/eibd
DAEMON_OPTS="-d -D -T -R -S -i -u --eibaddr=1.1.128 ipt:192.168.56.1"
exec start-stop-daemon --start -c eibd --exec $DAEMON -- $DAEMON_OPTS
end script

post-stop script
route delete 224.0.23.12 2>&1 > /dev/null || true
end script
#######################################################################

Update your configuration
initctl reload-configuration
initctl status eibd
initctl start eibd

This script is rarly tested but should work. Any comments are welcome:-)

Note: When the eibd process do not start or you got the error message: initialisation of the eibd unix protocol failed. Check permissions on /tmp/eib. This could occur if the eibd daemon was at least one time started as root. When started as root eibd creates a socket /tmp/eib on which only root has the appropirate rights. Login as root and delete the socket. eibd create a new one at startup.
rm /tmp/eib

Michael

4 thoughts on “EIB/KNX: Upstart startup script for eibd”

  1. Pingback: harvey
  2. Hello, maybe not the right place to post but I set eibd on ubuntu and I am able to send message to my home KNX.
    However I am not capable to understand message from vbusmonitor.
    In particular I have a few thermocouples sending periodically room
    temperature and I want to read temperature to control air conditioning.
    other point is about blinds, can I send command to set blind to say 50% ?

    thanks for any help.
    Fabio

  3. Hello,

    I’m encountering issue to start the eibd daemon at the startup:
    I use your script, it runs well if I run it using the command line: “sudo /etc/init.d/eibd start” BUT I always have to remove the eib socket before using “sudo rm /tmp/eib”.

    It seems that this one is always created at each startup using “root” user.

    So by reading your article I understand that eibd should have been started as root before my startup script… Do you think it is the case? How can I check it? or disable it?

    Thanks for your help!
    Thomas.

Leave a Reply Cancel reply