CFEngine in your phone

June 21, 2010

GNU/Linux is taking over the embedded device market, bringing Open Source flexibility and superior Unix management techniques to distributed, partially connected, and nomadic environments. Associate Professor Erik Hjelmås of Gjøvik University College in Norway has been experimenting with the latest CFEngine on a Nokia N900 mobile phone.

If there is one thing that characterizes the 21st century so far, it must be mobility: mobile phones, mobile internet, mobile people. The tools of system administration, on the other hand, by and large assume that infrastructure is fixed and rooted to predefined subnets and domains.

Of course, this is not true. The Navy and any shipping company will tell you that maintaining multiple secure networks on a sea-going vessel is not something you do with the assumption of a reliable Internet connection. There might be limited local connections, but wide area links are either a few kilobytes per second or non-existent. CFEngine is a tool that was designed with unreliable infra-structure in mind, which could explain why it is popular with the military and with shipping. But now there is more.

Location, Location, Linux!

As the GNU/Linux operating system spreads to every imaginable device fom mobile routers to watches and tablets, the problem of operating system management rears its head. Philips televisions now come with a copy of the GNU Public License. Now it is the turn of mobile phones to take on the adaptability – and corresponding complexity – of a standardized classic operating system.

The big question is: what on Earth would anyone want to do with CFEngine on a mobile phone. Is there really anything to configure? The answer is suprisingly prosaic:

Erik Hjelmås explains, “Two to four times a year there are full updates that require you to flash the device and then reconfigure everything from the bottom up. Having automated configuration can be a life-saver.”

“If you forget to put the device lock on, and the phone is in your pocket, all kinds of stuff can happen with the desktop. I’ve often thought it would be great to just run CFEngine once and have everything `self-heal’ back to normal instead of having to search for icons and make shortcuts by hand.”

He adds, “This kind of device is used a lot as a video camera, so the storage promise is useful for monitoring disk space and cleaning up temporary files. I want a warning when the disk is getting full. Moreover, the N900 is based on Debian and has apt-get for package management. CFEngine can handle package updates.”

There are still some challenges in the mobile world, however. “The N900 does not have a cron, so cf-execd can arrange for jobs to be run on a regular schedule. So far though this causes the battery to run down a lot more quickly.”

The challenges of mass configuration are that is has to be lightweight to save energy, and self-healing to deal with unpredictable environments. That is CFEngine in a nutshell, or … well, put your ear to your phone in the future and you won’t hear the sea through a shell, but you might hear CFEngine’s cleansing waves rising and ebbing to a relaxing schedule.