title: Not able to stop init script using start-stop-daemon
body: <p>I want to use <code>start-stop-daemon</code> to stop the scripts it has started, but currently the scripts are not killed, and so I have resorted to hacking around it:</p>
  
  <pre><code>#!/bin/sh
  case $1 in
   start)
    start-stop-daemon --start --background -c myapp --exec /home/myapp/dev-myapp.sh
   ;;
   stop)
    # couldn't get this to work  - hacking around it
    #start-stop-daemon --stop  -c myapp --exec /home/myapp/dev-myapp.sh
  
    # hack
    killall dev-myapp.sh
    sleep 3
    killall -9 dev-myapp.sh
  
   ;;
   restart)
    $0 stop
    $0 start
   ;;
   *)
       echo "No such command. "
       echo "Usage: $0 start|stop|restart"
  esac
  exit 0
  </code></pre>
  
  <p>How can I get the script to kill the bash scripts it has started using <code>start-stop-daemon</code>?</p>
  
  <p>edit: I assume the failure to stop the processes has to do with this section from the man page:</p>
  
  <pre><code>-x, --exec executable
        Check for processes that are instances of this executable. The executable argument should be an  absolute  pathname.  Note:  this
        might not work as intended with interpreted scripts, as the executable will point to the interpreter. Take into account processes
        running from inside a chroot will also be matched, so other match restrictions might be needed.
  </code></pre>
  
  <p>So I might be forced to rely on name detection instead, but I don't know what the process name is ... Is this the whole absolute filename, the filename alone, or something else?</p>