Install Ludolph on Raspberry Pi

Ludolph is Jabber Bot with Zabbix support, it is lightweight and has very few dependencies, therefore ideal to run on Raspberry Pi. It is easily extensible and you can write your own plugins in Python, so you can do literary anything with it via Jabber. Ludolph supports both Python 2 and Python 3.

One of the benefits of having a Jabber bot on Raspberry Pi is that you can communicate with it, even if it doesn’t have public IP address. Easiest way is to install in into virtualenv and you can start playing with it immediately. We will go throughout proper Raspbian installation with a separate user and setting service as you would run it on production server.

Add user under which we will run it

useradd -M ludolph

By default Raspberry Pi doesn’t have PIP installed, so we have to add it

sudo apt-get install python-pip

Now we can install Ludolph into Raspbian

sudo pip install ludolph

Download the init script for Debian based linux from Github and make it executable

sudo wget -O /etc/init.d/ludolph https://raw.github.com/erigones/Ludolph/master/init.d/ludolph.debian
sudo chmod +x /etc/init.d/ludolph

We need to make a few amendments in the file.

USER=ludolph
PIDFILE=/tmp/$NAME.pid
DAEMON="/usr/local/bin/$NAME"
  • Make sure USER is set to newly crated user
  • user has proper write permissions for file configured in PIDFILE
  • DEAMON is path to Ludolph executable script. //Update init script. GIT update path to ludolph

Now we need to copy configuration file

sudo wget -O /etc/ludolph.cfg https://raw.github.com/erigones/Ludolph/master/ludolph/ludolph.cfg.example

And setup required fields. We are running it is daemon mode so enable this option, uncomment pidfile option and make sure it matches the path defined in PIDFILE in init script. Also setup login credentials that you would like to use

[global]
# We are going to run Ludolph in daemon mode
daemon = true
# Uncomment, add path to pid file
# Make sure that `USER` has proper write permissions
pidfile = /tmp/ludolph.pid
# Use a dedicated jabber account for Ludolph
username = ludolph@example.com
password = ludolphpassword

Other useful options you probably want to fill in is users and admins configuration variables so nobody (except you) will be able to talk to Ludolph. Just put in there your jabber ID. Afterwards we need to adjust the configuration file ownership and permissions so nobody except the user under which Ludolph runs is able to read it

sudo chown root:USERgroup /etc/ludolph.cfg
sudo chmod 0640 /etc/ludolph.cfg

And now we can start Ludolph as a regular Raspbian service

sudo service ludolph start