I've tried to write a custom upstart script for uwsgi emperor but it doesn't seem to start uwsgi and only says `Usage: /etc/init.d/uwsgi {start|stop|reload}` when I try to run it using "service uwsgi start".

Can anyone please tell me where I have gone wrong. The snippet below is from my deployment shell script:

```
cat <<EOF >/etc/init.d/uwsgi
#!/bin/bash
daemon=\$APPVENV/bin/uwsgi
args="--emperor \$APPCONF/uwsgi/app.ini --daemonize /var/log/emperor.log --emperor-pidfile \$APPDIR/emperor.pid --gid `id -g \$APPUSER`"
pid=\$APPDIR/emperor.pid
case "$1" in
    start)
        echo "Starting uwsgi"
        start-stop-daemon -m -p \$pid --start --exec \$daemon \$args
        ;;
    stop)
        echo "Stopping script uwsgi"
        start-stop-daemon --signal INT -p \$pid --stop \$daemon \$args
        ;;
    reload)
        echo "Reloading conf"
        kill -HUP \$(cat \$pid)
        ;;
    *)
        echo "Usage: /etc/init.d/uwsgi {start|stop|reload}"
        exit 1
    ;;
esac
exit 0
EOF

chmod u+x /etc/init.d/uwsgi
update-rc.d uwsgi defaults
service uwsgi start 

```