Closing terminal window dosn't kill sudo'ed program
Grant Edwards
grant.b.edwards at gmail.com
Thu May 21 20:37:49 CEST 2015
Xubuntu 14.04.2, XFCE 4.10, xfce4-terminal 0.6.3
I have a desktop launcher that is configured to run a bash program as
root in a terminal window. The launcher works fine, but closing the
terminal window doesn't kill the program. It hangs around forever.
You can see the same thing with this bash script:
------------------------------testit.sh------------------------------
#!/bin/bash
while sleep 1
do
date
done
---------------------------------------------------------------------
Make it executable, and run it from the command prompt like so:
# xfce4-terminal -x sudo ./testit.sh
And you see this with 'ps axf'
3305 ? Sl 0:04 \_ /usr/bin/xfce4-terminal -x sudo ./menu
3309 ? S 0:00 \_ gnome-pty-helper
3341 pts/8 Ss+ 0:00 \_ bash
5292 pts/0 Ss 0:00 \_ bash
5724 pts/0 R+ 0:00 | \_ ps axf
5685 pts/10 Ss+ 0:00 \_ sudo ./testit.sh
5686 pts/10 S+ 0:00 \_ /bin/bash ./testit.sh
5723 pts/10 S+ 0:00 \_ sleep 1
Then if you close the terminal (click on 'X' in upper right), the
testi.sh program doesn't get killed. Even after you close all
terminals, it's still running:
1207 ? Ss 0:00 \_ init --user
[...] [...]
5685 ? Ss 0:00 \_ sudo ./testit.sh
5686 ? S 0:00 | \_ /bin/bash ./testit.sh
6502 ? S 0:00 | \_ sleep 1
Hmm. I see similar results on Gentoo with XFCE 4.10 and urxvt instead
of xfce4-terminal, so this is is probably not specific to XFCE...
--
Grant Edwards grant.b.edwards Yow! I'm totally DESPONDENT
at over the LIBYAN situation
gmail.com and the price of CHICKEN
...
More information about the Xfce
mailing list