Closing terminal window dosn't kill sudo'ed program

Ralf Mardorf ralf.mardorf at alice-dsl.net
Fri May 22 02:04:48 CEST 2015


On Fri, 22 May 2015 01:20:53 +0200, Ralf Mardorf wrote:
>On Thu, 21 May 2015 20:34:45 +0000 (UTC), Grant Edwards wrote:  
>>If I do that, I get _two_ terminal windows.  The one with the app, and
>>the one where the "sudo xfce4-terminal" command was executed.
>>Ugly.    

I forgot to mention, that you don't need to run two terminals, just
follow my advices, resp. test the workaround. IOW uncheck the "run in
terminal" option. Execute xfce4-terminal -x , but use the sudo inside
the srcript, do not run xfce4-terminal -x sudo.

#!/bin/bash
case $1 in
  workaround)
    sudo $0
  ;;
  *)
    while sleep 1
    do
      date
    done
  ;;
esac

xfce4-terminal -x /path/workaround.sh workaround

IOW the name of the script is  workaround.sh  and you start it with the
option  workaround  , this does cause an additional process, but all
processes get terminated when closing the terminal.
-- 
It only looks like a tape-recorder. It's actually a pen.
So you can write with it and no one will know.


More information about the Xfce mailing list