Respawn background process on YUN if it fails?

Hi

I am running MJPG Streamer on the YUN and many times the process fails. Is there a way in which the YUN can detect the process failure and respawn the process.

Dirty method:

BusyBox init

adds an entry to /etc/inittab.

nano /etc/inittab
...
ttyATH0::askfirst:/bin/ash --login
::respawn:/usr/bin/mjpg_streamer
reboot

Clean method

install luci-app-statistics collectd collectd-mod-cpu collectd-mod-memory collectd-mod-load
monitor system load and fix crashing problem.