title: Best way to make a shell script daemon?
body: <p>I'm wondering if there is a better way to make a daemon that waits for something using only sh than:</p>
  
  <pre><code>#! /bin/sh
  trap processUserSig SIGUSR1
  processUserSig() {
    echo "doing stuff"
  }
  
  while true; do
    sleep 1000
  done
  </code></pre>
  
  <p>In particular, I'm wondering if there's any way to get rid of the loop and still have the thing listen for the signals.</p>