When I run a script (in the background) from a gnome-terminal, it does not get killed when I quit gnome-terminal. It does not even quit when I log out and get back to the GDM login window.
For example, I save this as 'test.sh'
Code:
#!/bin/sh
while true ; do
echo "Hi!" >> ~/test/a;
sleep 2
done
and I run it like this
(no nohup or disown). When I run pstree I get this:
Code:
├─gdm───gdm─┬─Xorg
│ └─gnome-session─┬─devilspie
│ ├─fvwm─┬─FvwmAuto
│ │ ├─emacs-snapshot-───bash
│ │ ├─firefox───run-mozilla.sh───firefox-bin───6*[{fi+
│ │ └─gnome-terminal─┬─bash───ipython───sh───less
│ │ ├─bash─┬─pstree
│ │ │ └─test.sh───sleep
Then I close all apps, log out, press Ctrl-Alt-F2, and run pstree from the virtual console and get:
Code:
init-+-NetworkManager
|-NetworkManagerD
...
|-system-tools-ba---dbus-daemon
|-test.sh---sleep
`-udevd
I believe test.sh should get killed when the gnome-terminal is closed. Why is my shell acting like this? How can I fix it?
Bookmarks