title: -bash: cmd: command not found
body: <p>I have this in /etc/init.d/unicorn</p>
  
  <pre><code>#!/bin/bash
  # /etc/init.d/unicorn
  
  # ### BEGIN INIT INFO
  # chkconfig: 2345 95 016
  # processname: unicorn
  # dscription: Stop/start unicorn
  ### END INIT INFO
  
  export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  
  cmd() {
      cd /vagrant
      unicorn -p 3000 -D
  }
  
  # Start the service
  start() {
      su - vagrant -c cmd
  }
  
  ### main logic ###
  case "$1" in
      start)
          start
          ;;
      *)
          echo $"Usage: $0 {start}"
          exit 1
  esac
  
  exit 0
  </code></pre>
  
  <p>I am trying to start unicorn in my local rails folder. I feel like this command should work:</p>
  
  <pre><code>su - vagrant -c cmd
  </code></pre>
  
  <p>and  cannot figure out the reason. </p>