I am trying to run Google AppEngine on my Debian machine, I created a file init.d/gae:. /lib/lsb/init-functions## Initialize variables#name=gaeuser=$namepid=/var/run/$name.pidprog=python /opt/google_appengine/dev_appserver.py --host=0.0.0.0 --admin_host=0.0.0.0 --php_executable_path=/usr/bin/php-cgi /var/wwwcase ${1} in   start)      echo Starting...Google App Engine      start-stop-daemon --start --make-pidfile --background --oknodo --user $user --name $name --pidfile $pid --startas $prog       ;;   stop)      echo Stopping...Google App Engine      ;;   restart)      ${0} stop      sleep 1      ${0} start      ;;   *)      echo Usage: ${0} {start|stop|restart}      exit 1      ;;esacexit 0# End scriptnameI am testing the script by manually invoking, and the script runs but not as a daemon or at least it doesn't detach from terminal. I am expecting/looking for similar functionality to Apache.What switch am I missing? I have scoured the manuals and Google and cannot figure this out :(EDIT | I should note that no PID file is being written or created despite the switch indicating it should be created
start-stop-daemon won't start my Python script as service
init.d;start stop daemon
You have two problems I can see:prog=python /opt/google_appengine/dev_appserver.py --host=0.0.0.0 --admin_host=0.0.0.0 --php_executable_path=/usr/bin/php-cgi /var/wwwWill start /opt/google_appengine/dev_appserver.py with prog=python in the environment.  This is before your start block, so start-stop-daemon isn't even getting involved.The quick fix is to quote the entire assignment like this:prog='python /opt/google_appengine/dev_appserver.py --host=0.0.0.0 --admin_host=0.0.0.0 --php_executable_path=/usr/bin/php-cgi /var/www'But a better fix is to use the style from /etc/init.d/skeleton, and doDAEMON='python /opt/google/appengine/dev_appserver.py'DAEMON_ARGS='--host=0.0.0.0 --admin_host=0.0.0.0 --php_executable_path=/usr/bin/php-cgi /var/www'The second problem is that you're wrongly quoting $prog.start-stop-daemon --start --make-pidfile --background --oknodo --user $user --name $name --pidfile $pid --startas $prog tells start-stop-daemon to try to start a program called python /opt/google_appengine/dev_appserver.py --host=0.0.0.0 --admin_host=0.0.0.0 --php_executable_path=/usr/bin/php-cgi /var/www.But clearly there is no program called that.  You want to start python with arguments.  Removing the double quotes there is the quick fix, but a better one, again following /etc/init.d/skeleton, would bestart-stop-daemon --start --quiet --chuid $CHUID --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS