Raspberry Pi and Sensor Tag - Part IV - Update

A reader of this blog pointed out through the ask away button that on my linked post I didn’t show the steps for installing Redis on the RPi but shown only the steps for OS X. Mantis91 is right and below you find the missing piece.
From the command line you will be doing the following:
  1. Download Redis, last stable known version, source code
  2. Build and Test
  3. Configure the service
  4. Make sure that it runs on boot (if you so want)

Step 1 and 2

wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make test  (sanity check!)
cd src
sudo cp redis-server /usr/local/bin
sudo cp redis-cli /usr/local/bin
cd ..
cd ..
rm redis-stable.tar.gz
The operations above will take really long time, so kick it and go kill some angry birds ;-)
[all birds died, back on the keyboard]

Step 3

Now that you built and tested and assuming you didn’t hit any red flag, let go ahead and configure Redis to start at boot time plus some other useful changes. In line with what has been the segway of the previous posts.
cd redis-stablesudo mkdir /etc/redissudo mkdir /var/redissudo cp utils/redis_init_script /etc/init.d/redis_6379sudo cp redis.conf /etc/redis/6379.confsudo mkdir /var/redis/6379sudo nano /etc/redis/6379.conf
In the configuration file set the following options:
daemonize to yes
pidfile to /var/run/redis_6379.pid
loglevel to notice
dir to /var/redis/6379
You might find some already set to the value listed above and you can move on if that is the case.
Save (^O) and then in the console set up the init.d file to run on startup
sudo update-rc.d redis_6379 defaults

Quick Sanity Checks

It is a good idea to make sure that everything works. Reboot the system and test the following:
redis-cli ping
redis save
The first command should return PONG. The second a confirmation that your log has been committed. You should be finding the log file (/var/redis/6379/dumprdb) if you get an error, then you will have to troubleshoot.  Take a look at the log and make sure to reboot as often just like Windex in the My Fat Greek Wedding, fixes everything :-)

Mini Help

At the moment that I writing this article the execution of that last line causes an issue, reported here. There’s an issue with the script that generates the header of your server script. If that you see something like this:
insserv: warning: script ‘K01redis_6379’ missing LSB tags and overrides
insserv: warning: script 'redis_6379’ missing LSB tags and overrides
All you have to is the following:
sudo nano /etc/init.d/redis_6379
paste right after the 3rd line, from the top, this
# chkconfig: - 58 74
# description: redis_6379 is the redis daemon.
# Provides: redis_6379
# Required-Start:    $network $remote_fs $local_fs
# Required-Stop:     $network $remote_fs $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start and stop redis_6379
# Description: Redis daemon
Save and run the update command again, that will get rid of the issue.
If you need to ask for help on a forum, a friend, your imaginary IT guy, the first question will be, what Distro are you running and if you have no clue this command will give you everything that you need.
more /etc/*-releaseuname -a


For the making of this post, I leveraged the following resources. Thank you guys!


Popular posts from this blog

Bring Boxee Box back to life

Postgres on Synology

Zen-inification - The art of decluttering