How about requiring SHELL in addition to TERM?
$ sudo cat /proc/`pidof whoopsie`/environ | xargs -0n1 PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin TERM=linux CRASH_DB_URL=https://daisy.ubuntu.com RUNLEVEL=2 PREVLEVEL=N UPSTART_EVENTS=runlevel UPSTART_JOB=whoopsie UPSTART_INSTANCE=
That ought to at least work for such system daemons, and they don't have $SHELL. $SHELL is also a "safe" (i. e. non-sensitive) variable, so we keep that.
How about requiring SHELL in addition to TERM?
$ sudo cat /proc/`pidof whoopsie`/environ | xargs -0n1 local/sbin: /usr/local/ bin:/usr/ bin:/usr/ sbin:/sbin: /bin /daisy. ubuntu. com EVENTS= runlevel JOB=whoopsie
PATH=/usr/
TERM=linux
CRASH_DB_URL=https:/
RUNLEVEL=2
PREVLEVEL=N
UPSTART_
UPSTART_
UPSTART_INSTANCE=
That ought to at least work for such system daemons, and they don't have $SHELL. $SHELL is also a "safe" (i. e. non-sensitive) variable, so we keep that.