Arbre Empathique Brest – Disable Failsafe Grub on Ubuntu Server

Hi everybody!

Today I will talk a something it happend me at my job. First I will explain in what I was working, later I will explain the problem and the easy solution.

If you follow me at LinkedIn you will know that I work for ADmira Digital Networks, one of the best digital signage companies. This weeks I’ve been working for a project called Arbre Empathique. This project consist in a very big iron tree placed in Brest with hydrophonic plants, cameras, screens, wifi and sensors. The cameras provide real time video to the screens, player takes images from the cameras, data from sensors sensors and shows different content at the same time everything at realtime!. The Wi-Fi was the method to connect people with the tree to get more information from it. If you want to know more, check the ADmira post or just ask ;).

The Wi-Fi was the problem, well, the ubuntu server that is behind the access point. As you probably don’t know, the digital signage  hardware and software has to be prepared to be placed in the worst sites you could ever imagine, and I can promise Brest is one of the worsts I’ve ever see. You have to be prepared to get energy fails, cold, warm, windy, raining, and everything has to work. That’s the reality of digital signage, it’s quite different from a normal software company, but you have to be prepared for the worst.

The problem was the ubuntu server 12.04, it works really great, but it held in Grub window waiting for a keyboard keystroke choosing a boot option. That couldn’t be a problem, if you get your servers in your office, but when your server is located in more than 1200Km, yes, that’s a problem.

The solution, change the Grub script adding a timeout when recordfail gets 1. Let’s see what was there, and what I’ve done it.

/etc/grub.d/00_header

make_timeout ()
{
    cat << EOF
if [ "\${recordfail}" = 1 ]; then
  set timeout=-1 # This tells Grub to wait the keystroke choose
else
  set timeout=${2}
fi
EOF
}

Here the solution, change the -1 to 10.

make_timeout ()
{
    cat << EOF
if [ "\${recordfail}" = 1 ]; then
  set timeout=10 # Here we can just wait 10 seconds 
else
  set timeout=${2}
fi
EOF
}

Remember to run update-grub as root and you’ll never be stucked again.

Just with that change our ubuntu will work although any kind of energy failure happens. Of course, hardware fails and you have to be prepared! That’s digital signage 😉

To finish you can see the video from Cloud9 the architects of that project.

 

Stay in the cloud!

Uso de cookies

Este sitio web utiliza cookies para que usted tenga la mejor experiencia de usuario. Si continúa navegando está dando su consentimiento para la aceptación de las mencionadas cookies y la aceptación de nuestra política de cookies, pinche el enlace para mayor información.plugin cookies