tun: Kill the tunnel script's process group
tun: Kill the tunnel script's process group

When invoked with --script-tun, openconnect starts the tunnel script
via "/bin/sh -c 'SCRIPT'", then sends SIGHUP to the shell's PID when
shutting down.  However, non-interactive shells are not guaranteed to
send SIGHUP to any running jobs¹; indeed, the observed behavior on
Linux is that only the shell process receives SIGHUP, and the tunnel
script continues running after openconnect exits.

A quick fix is to set the child's pgid == pid, then send SIGHUP to the
entire process group when we want to shut down.

¹ http://www.gnu.org/software/bash/manual/html_node/Signals.html

Signed-off-by: Kevin Cernekee <3105dbb3dd63fbb4f6371cfb04adc6726f76c56b@gmail.com>
Signed-off-by: David Woodhouse <b460d66aaf00c296a3db1c1d9eeafc081d5f7d70@intel.com>

nmav/openconnect-mine,nmav/openconnect-mine,don-johnny/openconnect,brandt/openconnect,lins05/openconnect,don-johnny/openconnect,neshema/openconnect,liiir1985/openconnect,atyndall/openconnect,chadcatlett/openconnect,mtmiller/openconnect,liiir1985/openconnect,neshema/openconnect,liiir1985/openconnect,lins05/openconnect,lins05/openconnect,mveplus/openconnect-client,lins05/openconnect,liiir1985/openconnect,neshema/openconnect,mveplus/openconnect-client,nmav/openconnect-mine,atyndall/openconnect,brandt/openconnect,brandt/openconnect,matlockx/openconnect,atyndall/openconnect,don-johnny/openconnect,matlockx/openconnect,nmav/openconnect-mine,don-johnny/openconnect,chadcatlett/openconnect,chadcatlett/openconnect,mveplus/openconnect-client,atyndall/openconnect,chadcatlett/openconnect,mtmiller/openconnect,cernekee/openconnect,neshema/openconnect,mtmiller/openconnect,cernekee/openconnect,cernekee/openconnect,mtmiller/openconnect,matlockx/openconnect,cernekee/openconnect,mveplus/openconnect-client,brandt/openconnect,matlockx/openconnect