title: Linux automatically restarting application on crash - Daemons
body: <p>I have an system running embedded linux and it is critical that it runs continuously. Basically it is a process for communicating to sensors and relaying that data to database and web client.</p>
  
  <p>If a crash occurs, how do I restart the application automatically?</p>
  
  <p>Also, there are several threads doing polling(eg sockets &amp; uart communications). How do I ensure none of the threads get hung up or exit unexpectedly? Is there an easy to use watchdog that is threading friendly?</p>