Of course lxterminal
forks off a child process. Think about it. That child process is the interactive shell that is attached to the emulated terminal by lxterminal
(or whatever alternative program one has supplied with the -e
option). It in turn makes further grandchild processes, depending from what one has actually done in that shell.
Killing lxterminal
closes the master side of the pseudo-terminal that it uses, which looks like a terminal hangup as far as the slave side is concerned. The slave side is what the interactive shell sees as its controlling terminal. So the shell should be seeing a normal terminal hangup, generating a SIGHUP
to the session leader if the terminal's -hupcl
setting is on. That session leader is that shell process.
The session leader is responsible for job control within the session, and for passing the hangup signal along to all of its jobs. Obviously, if you have disown
ed something run by that shell, or nohup
ped it, the session leader does not pass along the hangup signal and that something will continue to run even though lxterminal
has been terminated and the master side of the pseudo-terminal has been closed. That's what disown
and nohup
do.
You need to sort out why whatever it is you are running in that interactive session is not dying when the pseudo-terminal is hung up. You haven't told us anything about what that is, and we aren't telepathic. So there's little to suggest beyond generalities about what session leader shells are designed to do.
lxterminal
does a second fork, you can't easily get the pid of the resulting grandchild.